github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/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  
     6  export default Route.extend(WithWatchers, {
     7    model() {
     8      const job = this.modelFor('jobs.job');
     9      return job.get('allocations').then(() => job);
    10    },
    11  
    12    startWatchers(controller, model) {
    13      controller.set('watchAllocations', this.get('watchAllocations').perform(model));
    14    },
    15  
    16    watchAllocations: watchRelationship('allocations'),
    17  
    18    watchers: collect('watchAllocations'),
    19  });