open-nomad/ui/app/routes/jobs/job/versions.js

22 lines
563 B
JavaScript
Raw Normal View History

import Route from '@ember/routing/route';
2018-02-27 22:57:57 +00:00
import { watchRelationship } from 'nomad-ui/utils/properties/watch';
2017-09-19 14:47:10 +00:00
export default Route.extend({
model() {
const job = this.modelFor('jobs.job');
return job.get('versions').then(() => job);
},
2018-02-27 22:57:57 +00:00
setupController(controller, model) {
controller.set('watcher', this.get('watchVersions').perform(model));
return this._super(...arguments);
},
deactivate() {
this.get('watchVersions').cancelAll();
return this._super(...arguments);
},
watchVersions: watchRelationship('versions'),
2017-09-19 14:47:10 +00:00
});