diff --git a/app/controllers/queue.coffee b/app/controllers/queue.coffee index cabd5b7f..a89d1b28 100644 --- a/app/controllers/queue.coffee +++ b/app/controllers/queue.coffee @@ -1,9 +1,14 @@ `import Ember from 'ember'` Controller = Ember.ArrayController.extend + isLoaded: false content: (-> - @store.filter 'job', {}, (job) -> + result = @store.filter('job', {}, (job) -> ['created', 'queued'].indexOf(job.get('state')) != -1 + ) + result.then => + @set('isLoaded', true) + result ).property() `export default Controller` diff --git a/app/controllers/running-jobs.coffee b/app/controllers/running-jobs.coffee index 44ca18fc..d7d21cb6 100644 --- a/app/controllers/running-jobs.coffee +++ b/app/controllers/running-jobs.coffee @@ -1,9 +1,14 @@ `import Ember from 'ember'` Controller = Ember.ArrayController.extend + isLoaded: false content: (-> - @store.filter 'job', { state: 'started' }, (job) -> + result = @store.filter('job', { state: 'started' }, (job) -> ['started', 'received'].indexOf(job.get('state')) != -1 + ) + result.then => + @set('isLoaded', true) + result ).property() `export default Controller` diff --git a/app/templates/queue.hbs b/app/templates/queue.hbs index aef94c04..5a7d24d6 100644 --- a/app/templates/queue.hbs +++ b/app/templates/queue.hbs @@ -1,4 +1,4 @@ - +{{#if isLoaded}} {{#if length}} {{#each job in controller}}