Move jobs polling from jobs to jobs.index

It's only necessary for the list view, not the entire route hierarchy
This commit is contained in:
Michael Lange
2018-02-27 19:55:03 -08:00
parent 9cd5632d69
commit 093bd4128b
3 changed files with 13 additions and 15 deletions

View File

@@ -41,11 +41,6 @@ export default ApplicationAdapter.extend({
return this.ajax(url, 'GET', {
data: params,
}).catch(error => {
if (error instanceof AbortError) {
return [];
}
throw error;
});
},

View File

@@ -3,7 +3,6 @@ import Route from '@ember/routing/route';
import { run } from '@ember/runloop';
import WithForbiddenState from 'nomad-ui/mixins/with-forbidden-state';
import notifyForbidden from 'nomad-ui/utils/notify-forbidden';
import { watchAll } from 'nomad-ui/utils/properties/watch';
export default Route.extend(WithForbiddenState, {
system: service(),
@@ -36,18 +35,9 @@ export default Route.extend(WithForbiddenState, {
setupController(controller) {
this.syncToController(controller);
controller.set('modelWatch', this.get('watch').perform());
return this._super(...arguments);
},
deactivate() {
this.get('watch').cancelAll();
this._super(...arguments);
},
watch: watchAll('job'),
actions: {
refreshRoute() {
this.refresh();

View File

@@ -1,6 +1,19 @@
import Route from '@ember/routing/route';
import { watchAll } from 'nomad-ui/utils/properties/watch';
export default Route.extend({
setupController(controller) {
controller.set('modelWatch', this.get('watch').perform());
return this._super(...arguments);
},
deactivate() {
this.get('watch').cancelAll();
this._super(...arguments);
},
watch: watchAll('job'),
actions: {
refreshRoute() {
return true;