github.com/hernad/nomad@v1.6.112/ui/app/routes/jobs/job/evaluations.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 { watchRelationship } 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 EvaluationsRoute extends Route.extend(WithWatchers) { 13 @service store; 14 15 model() { 16 const job = this.modelFor('jobs.job'); 17 return job && job.get('evaluations').then(() => job); 18 } 19 20 startWatchers(controller, model) { 21 if (model) { 22 controller.set('watchEvaluations', this.watchEvaluations.perform(model)); 23 } 24 } 25 26 @watchRelationship('evaluations') watchEvaluations; 27 28 @collect('watchEvaluations') watchers; 29 }