github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/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  
     6  export default class AllocationsRoute extends Route.extend(WithWatchers) {
     7    startWatchers(controller, model) {
     8      if (!model) return;
     9  
    10      controller.set('watchers', {
    11        model: this.watch.perform(model),
    12      });
    13    }
    14  
    15    resetController(controller, isExiting) {
    16      if (isExiting) {
    17        controller.setProperties({
    18          currentPage: 1,
    19          qpType: '',
    20          qpHealth: '',
    21        });
    22      }
    23    }
    24  
    25    @watchRecord('plugin') watch;
    26    @collect('watch') watchers;
    27  }