2018-06-27 20:39:57 +00:00
|
|
|
import Controller from '@ember/controller';
|
2017-10-23 23:59:30 +00:00
|
|
|
import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
|
2018-07-11 16:34:22 +00:00
|
|
|
import { alias } from '@ember/object/computed';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2018-07-11 16:34:22 +00:00
|
|
|
export default Controller.extend(WithNamespaceResetting, {
|
|
|
|
job: alias('model.job'),
|
2018-08-21 23:46:24 +00:00
|
|
|
definition: alias('model.definition'),
|
|
|
|
|
|
|
|
isEditing: false,
|
|
|
|
|
|
|
|
edit() {
|
|
|
|
this.get('job').set('_newDefinition', JSON.stringify(this.get('definition'), null, 2));
|
|
|
|
this.set('isEditing', true);
|
|
|
|
},
|
|
|
|
|
|
|
|
onCancel() {
|
|
|
|
this.set('isEditing', false);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSubmit(id, namespace) {
|
|
|
|
this.transitionToRoute('jobs.job', id, {
|
|
|
|
queryParams: { jobNamespace: namespace },
|
|
|
|
});
|
|
|
|
},
|
2018-07-11 16:34:22 +00:00
|
|
|
});
|