Commit Graph

59 Commits

Author SHA1 Message Date
Piotr Sarnacki
65eb4e15fb Don't try to delete flash if there is no data from server 2013-02-26 05:05:36 +01:00
Piotr Sarnacki
1bccb5d177 Fix line numbers when loading an url 2013-02-25 15:18:59 +01:00
Piotr Sarnacki
f0ea65b114 Keep the hash in the location so we can scroll to line in logs 2013-02-23 00:21:01 +01:00
Piotr Sarnacki
553495c56c Add @svenfuchs' log reimplementation 2013-02-22 17:00:50 +01:00
Piotr Sarnacki
83fb0ebb2c Fix incomplete implementation 2013-02-21 23:22:54 +01:00
Piotr Sarnacki
4cdd4df515 Tabs and basic views are mostly working 2013-02-21 23:22:51 +01:00
Piotr Sarnacki
f0e95ddd3f Main view mostly works on new router 2013-02-21 23:22:51 +01:00
Piotr Sarnacki
fd08feb992 Add 'Your build has been stopped' to texts which expand folds 2013-02-13 14:32:58 +01:00
Piotr Sarnacki
3862dd163d Limit log to 5000 lines 2013-02-13 04:03:02 +01:00
Piotr Sarnacki
c1674e9d76 Fix fold expansion when script exits before fold finishes 2013-02-13 03:30:41 +01:00
Piotr Sarnacki
8202eaa452 Add error callback to Travis.ajax, pass all args to callbacks 2013-01-29 04:16:46 +01:00
Piotr Sarnacki
ba2f691ae6 No need to set content type for requests without body 2013-01-29 04:16:19 +01:00
Piotr Sarnacki
a8fb681bfc Always convert method passed to Travis.ajax to upper case 2013-01-29 04:15:47 +01:00
Piotr Sarnacki
eb2feca02a Set proper content type for logs requests 2013-01-28 18:18:16 +01:00
Piotr Sarnacki
5fbf153ed9 Use /jobs/:id/log.txt endpoint for fetching logs 2013-01-27 02:46:18 +01:00
Piotr Sarnacki
42e93c9f94 Sometimes empty value is passed to lines, abort in such cases 2013-01-10 13:44:24 +01:00
Piotr Sarnacki
938aaafc71 Merge pull request #84 from randym/instrumentation
WIP! Added first level instrumentation for travis-web
2013-01-03 07:13:34 -08:00
Piotr Sarnacki
2daed5f36f Replace *all* unsupported ansi escape chars. 2012-12-19 17:13:22 +01:00
Randy Morgan
fa7f8b9332 Added first level instrumentation for travis-web
This is not enabled by default. You need to run:

Travis.Instrumentation.subscribe('render.view')

To start capturing info
2012-12-14 19:31:05 +09:00
Piotr Sarnacki
23a58866bd Fix LimitedArray to work properly with SortableMixin 2012-12-14 04:31:28 +01:00
Piotr Sarnacki
de9d695c5e Remove console.log 2012-12-11 15:53:09 +01:00
Piotr Sarnacki
fd82bf3791 Use contentArrayWillChange for deleting records from LimitedArray
Using contentArrayDidChange is usless for deletion, because the records
were already deleted, so we can't fetch them from the content array.
2012-12-11 15:51:11 +01:00
Piotr Sarnacki
e36fb0d7a2 Properly hide 'show more job' link in the queues 2012-12-11 15:03:47 +01:00
Piotr Sarnacki
79e6f5e037 Allow to change the place of insertion for limited array 2012-12-11 14:41:21 +01:00
Piotr Sarnacki
8e97b68313 Make the app work with disabled cookies
Browsers disable local storage and session storage when cookies are
disabled - any call to one of those will cause an error. This commit
provides fallback storage, which will store items in memory.
2012-12-10 17:37:09 +01:00
Piotr Sarnacki
0a635c8b39 Quick hack for </span> landing in the wrong place in logs
We change ansi terminal instructions into HTML tags before splitting the
log into lines, which sometimes may end up with </span> in the beginning
of the line. This is a quick hack to fix that problem, but we need
better solution.
2012-12-08 01:02:04 +01:00
Piotr Sarnacki
e9077f1a04 Fix initial setting in logs - it should be set to null after 1st line 2012-12-05 01:53:25 +01:00
Piotr Sarnacki
e431e30420 Fix small problem with duplicated first log line 2012-12-05 01:14:25 +01:00
Piotr Sarnacki
4e7329f638 Open fold if folded command returns an error 2012-12-05 00:33:26 +01:00
Piotr Sarnacki
fc40190c29 Optimize log viewer
Till now, log viewer was rendered in handlebars, which was the simplest
solution, but it had a major drawback - every append to log caused it to
rerender which was not efficient and memory consuming.

The new approach is to make Travis.Log interpret the log and send lines
with instructions to the view, so for example if view should add a line,
it gets something like:

    { number: 1, content: '$ bundle install' }

Such approach is required to handle cases where data coming from pusher
is not actually a new line. For example output containing dots from
tests needs to be appended:

    $ rake
    ....

Such output could be sent to client in 2 chunks: "$ rake\n.." and "..".
In such situation we would need to send 3 instructions:

  { number: 1, content: '$ rake' }
  { number: 2, content: '..'     }
  { number: 2, content: '..', append: true }

The third instruction can come much later, because tests can take a
while to run, so we can't assume that each line will come in one piece.

The other scenario is \r, for example when showing progress:

    \rDownloading: 10%
    \rDownloading: 50%
    \rDownloading: 100%

Such input should be changed into such instructions:

  { number: 1, content: 'Downloading: 10%' }
  { number: 1, content: 'Downloading: 50%',  replace: true }
  { number: 1, content: 'Downloading: 100%', replace: true }

Travis.Log also supports folds, for example on bundle install, the code
was rewritten to make folds management simpler.
2012-12-04 22:57:57 +01:00
Piotr Sarnacki
27dee49a8e Swallow ansi control sequences, which we don't support 2012-11-30 22:44:58 +01:00
Piotr Sarnacki
52e6959c9c Do not refresh entire LimitedArray if there is not such need 2012-11-28 01:00:44 +01:00
Piotr Sarnacki
d1633e796a Slightly better implementation of showAll for jobs in queues 2012-11-28 00:26:37 +01:00
Piotr Sarnacki
afa1d07fbe Show only first 15 elements from each queue for now
With shitloads of jobs in queues app becomes unusable, this is a quick
solution to make it better.
2012-11-28 00:04:23 +01:00
Sven Fuchs
d94b001e81 restore isLoaded for repos controller 2012-11-10 04:21:49 +01:00
Piotr Sarnacki
49f1c74a12 Extend message on loaded models and fix undefined ke problem 2012-11-06 11:47:12 +01:00
Piotr Sarnacki
eef8e55cfe Check if key is defined in incomplete checks 2012-10-31 14:56:17 +01:00
Piotr Sarnacki
6bf5bd3356 Needed to move part of incomplete impl. to store
When using get with path (eg. get('foo.bar.baz')), get method is called
only on the current object and computed property will be called. Because
there is no easy way to overwrite the computed property, I moved
incomplete record loading to ember-data. It's not DRY and it should be
rewritten, but I don't want to do it at this point as we will need to
completely rewrite it when upgrading ember-data.
2012-10-31 00:46:13 +01:00
Piotr Sarnacki
d1ab28abcc Remove console.log entry 2012-10-30 02:23:41 +01:00
Piotr Sarnacki
5ae7e1d046 Check also associations for incomplete records 2012-10-28 23:43:17 +01:00
Piotr Sarnacki
3f0babcf55 Fix adding builds to a build list on pusher event 2012-10-28 23:43:15 +01:00
Piotr Sarnacki
939212302a Fix loading page with #L<line-number>
Ember changed a way HistoryLocation works and it no longer calls
getURL(). I'm monkey patching it, but I will submit a pull request to
fix it.
2012-10-22 21:45:43 +02:00
Piotr Sarnacki
300ad58516 Fix incomplete implementation
While testing in the wild I spotted a few problems with it:

* it didn't work for camel case names.
* it was sometimes setting loaded data too late - it needed to use find
  and then save data on the record. Instead it should save data in
  special array saved on store, indexed by clientId
* there is already method to get attributes in ember-data, it just
  doesn't work with Travis.Foo.get('attributes'), it needs
  Ember.get(Travis.Foo, 'attributes') - it makes implementation much
  shorter
2012-10-22 02:54:48 +02:00
Sven Fuchs
90fb2c3b78 add broadcasts 2012-10-18 03:53:19 +02:00
Piotr Sarnacki
9d07ef79ac Fix bug with undefined loadedAttributes 2012-10-16 17:47:03 +02:00
Piotr Sarnacki
c05ce673bf Load incomplete records when trying to get unknown attribute
In order to minimize ajax requests, I implemented isComplete property,
which can be used to check if record is fetched from the API or if it
was just partially loaded (for example by pusher event). This is nice in
terms of requests reduction, but caries risk of showing incomplete data.

This commit fixes this situation by saving which attributes were
provided on "incomplete" load and triggering refresh when any unknown
attribute is tried to be fetched.

The implementation is really simple and will probably need refactoring,
but I would like to test it in the wild before putting much more time
into it.
2012-10-16 03:05:38 +02:00
Sven Fuchs
ed94cb7329 Merge branch 'master' of github.com:travis-ci/travis-web
Conflicts:
	assets/scripts/lib/travis/model.coffee
	public/scripts/app.js
	public/scripts/min/app.js
	public/version
2012-10-13 21:22:42 +02:00
Sven Fuchs
e7a26524d4 move select() functionality to Travis.Model and reuse it for accounts 2012-10-13 21:20:11 +02:00
Piotr Sarnacki
c707135ccd First spike of 'isComplete' functionality
When we get payload from pusher, we usually don't send the entire
record. Initially such records where fetched from server right away to
get missing data. This was done becuase Ember can't tell if given data
is complete or not and just assumes that the record is loaded.

To not fire unneeded request, this code sets incomplete flag on records
loaded from pusher and loads the rest of the data only if needed.
2012-10-13 20:47:21 +02:00
Piotr Sarnacki
2575218ddb Fix logs to always point to build or job view 2012-10-12 18:32:25 +02:00