Watch the allocation on the allocation and task pages

This commit is contained in:
Michael Lange
2018-02-28 11:48:06 -08:00
parent 5307803598
commit e7a26ce8d1
2 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
import Watchable from './watchable';
export default Watchable.extend();

View File

@@ -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'),
});