2018-02-28 02:58:25 +00:00
|
|
|
import Route from '@ember/routing/route';
|
|
|
|
import { collect } from '@ember/object/computed';
|
|
|
|
import { watchRecord, watchRelationship } from 'nomad-ui/utils/properties/watch';
|
2018-03-01 00:27:15 +00:00
|
|
|
import WithWatchers from 'nomad-ui/mixins/with-watchers';
|
2018-02-28 02:58:25 +00:00
|
|
|
|
2018-03-01 00:27:15 +00:00
|
|
|
export default Route.extend(WithWatchers, {
|
2018-02-28 02:58:25 +00:00
|
|
|
setupController(controller, model) {
|
|
|
|
controller.set('watchers', {
|
|
|
|
model: this.get('watch').perform(model),
|
|
|
|
summary: this.get('watchSummary').perform(model),
|
|
|
|
evaluations: this.get('watchEvaluations').perform(model),
|
|
|
|
deployments: this.get('watchDeployments').perform(model),
|
|
|
|
});
|
|
|
|
|
|
|
|
return this._super(...arguments);
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: watchRecord('job'),
|
|
|
|
watchSummary: watchRelationship('summary'),
|
|
|
|
watchEvaluations: watchRelationship('evaluations'),
|
|
|
|
watchDeployments: watchRelationship('deployments'),
|
|
|
|
|
2018-03-01 00:27:15 +00:00
|
|
|
watchers: collect('watch', 'watchSummary', 'watchEvaluations', 'watchDeployments'),
|
2018-02-28 02:58:25 +00:00
|
|
|
});
|