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