github.com/emate/nomad@v0.8.2-wo-binpacking/ui/app/routes/jobs/job/index.js (about)

     1  import Route from '@ember/routing/route';
     2  import { collect } from '@ember/object/computed';
     3  import { watchRecord, watchRelationship, watchAll } from 'nomad-ui/utils/properties/watch';
     4  import WithWatchers from 'nomad-ui/mixins/with-watchers';
     5  
     6  export default Route.extend(WithWatchers, {
     7    startWatchers(controller, model) {
     8      if (!model) {
     9        return;
    10      }
    11      controller.set('watchers', {
    12        model: this.get('watch').perform(model),
    13        summary: this.get('watchSummary').perform(model.get('summary')),
    14        evaluations: this.get('watchEvaluations').perform(model),
    15        deployments: model.get('supportsDeployments') && this.get('watchDeployments').perform(model),
    16        list: model.get('hasChildren') && this.get('watchAll').perform(),
    17      });
    18    },
    19  
    20    watch: watchRecord('job'),
    21    watchAll: watchAll('job'),
    22    watchSummary: watchRecord('job-summary'),
    23    watchEvaluations: watchRelationship('evaluations'),
    24    watchDeployments: watchRelationship('deployments'),
    25  
    26    watchers: collect('watch', 'watchAll', 'watchSummary', 'watchEvaluations', 'watchDeployments'),
    27  });