github.com/emate/nomad@v0.8.2-wo-binpacking/ui/app/routes/allocations/allocation.js (about)

     1  import Route from '@ember/routing/route';
     2  import { collect } from '@ember/object/computed';
     3  import { watchRecord } from 'nomad-ui/utils/properties/watch';
     4  import WithWatchers from 'nomad-ui/mixins/with-watchers';
     5  import notifyError from 'nomad-ui/utils/notify-error';
     6  
     7  export default Route.extend(WithWatchers, {
     8    startWatchers(controller, model) {
     9      controller.set('watcher', this.get('watch').perform(model));
    10    },
    11  
    12    model() {
    13      // Preload the job for the allocation since it's required for the breadcrumb trail
    14      return this._super(...arguments)
    15        .then(allocation => allocation.get('job').then(() => allocation))
    16        .catch(notifyError(this));
    17    },
    18  
    19    watch: watchRecord('allocation'),
    20  
    21    watchers: collect('watch'),
    22  });