github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/routes/jobs/job/evaluations.js (about)

     1  import Route from '@ember/routing/route';
     2  import { collect } from '@ember/object/computed';
     3  import { watchRelationship } 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 EvaluationsRoute extends Route.extend(WithWatchers) {
     8    @service store;
     9  
    10    model() {
    11      const job = this.modelFor('jobs.job');
    12      return job && job.get('evaluations').then(() => job);
    13    }
    14  
    15    startWatchers(controller, model) {
    16      if (model) {
    17        controller.set('watchEvaluations', this.watchEvaluations.perform(model));
    18      }
    19    }
    20  
    21    @watchRelationship('evaluations') watchEvaluations;
    22  
    23    @collect('watchEvaluations') watchers;
    24  }