From df6b87ddb84786f9ddf61474b493ec0ebc0ac935 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Thu, 19 Mar 2015 14:09:16 +0100 Subject: [PATCH] Fix duration on running jobs list --- app/controllers/running-jobs.coffee | 9 +++++++++ app/templates/queue.hbs | 4 +++- app/templates/running-jobs.hbs | 8 +++++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/controllers/running-jobs.coffee b/app/controllers/running-jobs.coffee index d7d21cb6..10b09e45 100644 --- a/app/controllers/running-jobs.coffee +++ b/app/controllers/running-jobs.coffee @@ -1,6 +1,15 @@ `import Ember from 'ember'` Controller = Ember.ArrayController.extend + init: -> + @_super.apply this, arguments + if !Ember.testing + Visibility.every @config.intervals.updateTimes, @updateTimes.bind(this) + + updateTimes: -> + if content = @get('content') + content.forEach (job) -> job.updateTimes() + isLoaded: false content: (-> result = @store.filter('job', { state: 'started' }, (job) -> diff --git a/app/templates/queue.hbs b/app/templates/queue.hbs index 2dee38d5..76fdcf0f 100644 --- a/app/templates/queue.hbs +++ b/app/templates/queue.hbs @@ -10,7 +10,9 @@

- {{#link-to "job" job.repo job}}{{job.number}}{{/link-to}} + {{#if job.repo.slug}} + {{#link-to "job" job.repo job}}{{job.number}}{{/link-to}} + {{/if}}

diff --git a/app/templates/running-jobs.hbs b/app/templates/running-jobs.hbs index 0ec37c96..d039ae2d 100644 --- a/app/templates/running-jobs.hbs +++ b/app/templates/running-jobs.hbs @@ -10,14 +10,16 @@

- {{#link-to "job" job.repo job}}{{job.number}}{{/link-to}} + {{#if job.repo.slug}} + {{#link-to "job" job.repo job}}{{job.number}}{{/link-to}} + {{/if}}

- Duration: + Duration: - {{format-duration job.startedAt}} + {{format-duration job.duration}}