mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
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:
@@ -41,11 +41,6 @@ export default ApplicationAdapter.extend({
|
||||
|
||||
return this.ajax(url, 'GET', {
|
||||
data: params,
|
||||
}).catch(error => {
|
||||
if (error instanceof AbortError) {
|
||||
return [];
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user