mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Watch the allocation on the allocation and task pages
This commit is contained in:
3
ui/app/adapters/allocation.js
Normal file
3
ui/app/adapters/allocation.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import Watchable from './watchable';
|
||||
|
||||
export default Watchable.extend();
|
||||
@@ -1,4 +1,17 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import WithModelErrorHandling from 'nomad-ui/mixins/with-model-error-handling';
|
||||
import { watchRecord } from 'nomad-ui/utils/properties/watch';
|
||||
|
||||
export default Route.extend(WithModelErrorHandling);
|
||||
export default Route.extend(WithModelErrorHandling, {
|
||||
setupController(controller, model) {
|
||||
controller.set('watcher', this.get('watch').perform(model));
|
||||
return this._super(...arguments);
|
||||
},
|
||||
|
||||
deactivate() {
|
||||
this.get('watch').cancelAll();
|
||||
return this._super(...arguments);
|
||||
},
|
||||
|
||||
watch: watchRecord('allocation'),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user