Implement counts for running jobs
This commit is contained in:
parent
8324d967c4
commit
ea9e9d81c1
|
@ -24,7 +24,7 @@ Controller = Ember.ArrayController.extend
|
|||
@container.lookup('router:main').send('redirectToGettingStarted')
|
||||
|
||||
isLoadedBinding: 'content.isLoaded'
|
||||
needs: ['currentUser', 'repo']
|
||||
needs: ['currentUser', 'repo', 'runningJobs', 'queue']
|
||||
currentUserBinding: 'controllers.currentUser'
|
||||
selectedRepo: (->
|
||||
# we need to observe also repo.content here, because we use
|
||||
|
@ -33,6 +33,11 @@ Controller = Ember.ArrayController.extend
|
|||
@get('controllers.repo.repo.content') || @get('controllers.repo.repo')
|
||||
).property('controllers.repo.repo', 'controllers.repo.repo.content')
|
||||
|
||||
startedJobsCount: Ember.computed.alias('controllers.runningJobs.length')
|
||||
allJobsCount: (->
|
||||
@get('startedJobsCount') + @get('controllers.queue.length')
|
||||
).property('startedJobsCount', 'controllers.queue.length')
|
||||
|
||||
init: ->
|
||||
@_super.apply this, arguments
|
||||
if !Ember.testing
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
{{#if config.pro}}
|
||||
<li id="tab_running" {{bind-attr class="view.classRunning"}}>
|
||||
<a href="#" {{action "showRunningJobs"}}>Running (2/3)</a>
|
||||
<a href="#" {{action "showRunningJobs"}}>Running ({{startedJobsCount}}/{{allJobsCount}})</a>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
{{!-- <h4>Running Jobs ({{controller.length}})</h4> --}}
|
||||
|
||||
{{#if isLoaded}}
|
||||
{{#if controller.length}}
|
||||
{{#each job in controller}}
|
||||
|
|
Loading…
Reference in New Issue
Block a user