github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/routes/jobs/job/versions.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 class VersionsRoute extends Route.extend(WithWatchers) {
     7    model() {
     8      const job = this.modelFor('jobs.job');
     9      return job && job.get('versions').then(() => job);
    10    }
    11  
    12    startWatchers(controller, model) {
    13      if (model) {
    14        controller.set('watcher', this.watchVersions.perform(model));
    15      }
    16    }
    17  
    18    @watchRelationship('versions') watchVersions;
    19    @collect('watchVersions') watchers;
    20  }