github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/routes/csi/plugins/plugin/allocations.js (about) 1 import Route from '@ember/routing/route'; 2 import { collect } from '@ember/object/computed'; 3 import { watchRecord } from 'nomad-ui/utils/properties/watch'; 4 import WithWatchers from 'nomad-ui/mixins/with-watchers'; 5 import { inject as service } from '@ember/service'; 6 7 export default class AllocationsRoute extends Route.extend(WithWatchers) { 8 @service store; 9 10 startWatchers(controller, model) { 11 if (!model) return; 12 13 controller.set('watchers', { 14 model: this.watch.perform(model), 15 }); 16 } 17 18 resetController(controller, isExiting) { 19 if (isExiting) { 20 controller.setProperties({ 21 currentPage: 1, 22 qpType: '', 23 qpHealth: '', 24 }); 25 } 26 } 27 28 @watchRecord('plugin') watch; 29 @collect('watch') watchers; 30 }