github.com/hernad/nomad@v1.6.112/ui/app/routes/csi/plugins/plugin/index.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 IndexRoute 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    @watchRecord('plugin') watch;
    24    @collect('watch') watchers;
    25  }