diff --git a/ui/app/routes/csi/plugins/plugin/allocations.js b/ui/app/routes/csi/plugins/plugin/allocations.js new file mode 100644 index 000000000..b46d2b5a5 --- /dev/null +++ b/ui/app/routes/csi/plugins/plugin/allocations.js @@ -0,0 +1,27 @@ +import Route from '@ember/routing/route'; +import { collect } from '@ember/object/computed'; +import { watchRecord } from 'nomad-ui/utils/properties/watch'; +import WithWatchers from 'nomad-ui/mixins/with-watchers'; + +export default Route.extend(WithWatchers, { + startWatchers(controller, model) { + if (!model) return; + + controller.set('watchers', { + model: this.watch.perform(model), + }); + }, + + resetController(controller, isExiting) { + if (isExiting) { + controller.setProperties({ + currentPage: 1, + qpType: '', + qpHealth: '', + }); + } + }, + + watch: watchRecord('plugin'), + watchers: collect('watch'), +});