diff --git a/ui/app/adapters/allocation.js b/ui/app/adapters/allocation.js new file mode 100644 index 000000000..8aa4b662f --- /dev/null +++ b/ui/app/adapters/allocation.js @@ -0,0 +1,3 @@ +import Watchable from './watchable'; + +export default Watchable.extend(); diff --git a/ui/app/routes/allocations/allocation.js b/ui/app/routes/allocations/allocation.js index 17aa8b10c..4d2cbe66c 100644 --- a/ui/app/routes/allocations/allocation.js +++ b/ui/app/routes/allocations/allocation.js @@ -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'), +});