github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/routes/jobs/job/allocations.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 AllocationsRoute extends Route.extend(WithWatchers) { 8 @service store; 9 10 model() { 11 const job = this.modelFor('jobs.job'); 12 return job && job.get('allocations').then(() => job); 13 } 14 15 startWatchers(controller, model) { 16 if (model) { 17 controller.set('watchAllocations', this.watchAllocations.perform(model)); 18 } 19 } 20 21 @watchRelationship('allocations') watchAllocations; 22 23 @collect('watchAllocations') watchers; 24 }