github.com/emate/nomad@v0.8.2-wo-binpacking/ui/app/routes/jobs/job/deployments.js (about) 1 import Route from '@ember/routing/route'; 2 import RSVP from 'rsvp'; 3 import { collect } from '@ember/object/computed'; 4 import { watchRelationship } from 'nomad-ui/utils/properties/watch'; 5 import WithWatchers from 'nomad-ui/mixins/with-watchers'; 6 7 export default Route.extend(WithWatchers, { 8 model() { 9 const job = this.modelFor('jobs.job'); 10 return RSVP.all([job.get('deployments'), job.get('versions')]).then(() => job); 11 }, 12 13 startWatchers(controller, model) { 14 controller.set('watchDeployments', this.get('watchDeployments').perform(model)); 15 controller.set('watchVersions', this.get('watchVersions').perform(model)); 16 }, 17 18 watchDeployments: watchRelationship('deployments'), 19 watchVersions: watchRelationship('versions'), 20 21 watchers: collect('watchDeployments', 'watchVersions'), 22 });