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

23 lines
480 B
JavaScript
Raw Normal View History

import Route from '@ember/routing/route';
2017-09-19 14:47:10 +00:00
export default class DefinitionRoute extends Route {
2017-09-19 14:47:10 +00:00
model() {
const job = this.modelFor('jobs.job');
if (!job) return;
2017-09-19 14:47:10 +00:00
return job.fetchRawDefinition().then(definition => ({
job,
definition,
}));
}
resetController(controller, isExiting) {
if (isExiting) {
2019-03-26 07:46:44 +00:00
const job = controller.job;
job.rollbackAttributes();
job.resetId();
controller.set('isEditing', false);
}
}
}