Fix duration on running jobs list

This commit is contained in:
Piotr Sarnacki 2015-03-19 14:09:16 +01:00
parent 8cd3da7f5b
commit df6b87ddb8
3 changed files with 17 additions and 4 deletions

View File

@ -1,6 +1,15 @@
`import Ember from 'ember'` `import Ember from 'ember'`
Controller = Ember.ArrayController.extend 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 isLoaded: false
content: (-> content: (->
result = @store.filter('job', { state: 'started' }, (job) -> result = @store.filter('job', { state: 'started' }, (job) ->

View File

@ -10,7 +10,9 @@
<p class="tile-title float-right"> <p class="tile-title float-right">
<span class="icon icon--hash"></span> <span class="icon icon--hash"></span>
{{#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}}
</p> </p>
<p> <p>

View File

@ -10,14 +10,16 @@
<p class="tile-title float-right"> <p class="tile-title float-right">
<span class="icon icon--hash"></span> <span class="icon icon--hash"></span>
{{#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}}
</p> </p>
<p> <p>
<span class="icon icon--clock"></span> <span class="icon icon--clock"></span>
Duration: Duration:
<abbr class="duration" {{bind-attr title="job.startedAt"}}> <abbr class="duration" {{bind-attr title="job.startedAt"}}>
{{format-duration job.startedAt}} {{format-duration job.duration}}
</abbr> </abbr>
</p> </p>