Watch job versions

This commit is contained in:
Michael Lange
2018-02-27 14:57:57 -08:00
parent 88df7fe537
commit 34c712d5c5

View File

@@ -1,8 +1,21 @@
import Route from '@ember/routing/route';
import { watchRelationship } from 'nomad-ui/utils/properties/watch';
export default Route.extend({
model() {
const job = this.modelFor('jobs.job');
return job.get('versions').then(() => job);
},
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'),
});