open-nomad/ui/app/controllers/jobs/job/index.js

34 lines
797 B
JavaScript
Raw Normal View History

import { inject as service } from '@ember/service';
2018-07-11 16:34:22 +00:00
import { alias } from '@ember/object/computed';
import Controller from '@ember/controller';
import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
2017-09-19 14:47:10 +00:00
export default Controller.extend(WithNamespaceResetting, {
system: service(),
2017-09-19 14:47:10 +00:00
queryParams: {
currentPage: 'page',
sortProperty: 'sort',
sortDescending: 'desc',
},
currentPage: 1,
2018-07-11 16:34:22 +00:00
job: alias('model'),
2017-09-19 14:47:10 +00:00
sortProperty: 'name',
sortDescending: false,
actions: {
gotoTaskGroup(taskGroup) {
this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup);
},
gotoJob(job) {
this.transitionToRoute('jobs.job', job, {
queryParams: { jobNamespace: job.get('namespace.name') },
});
},
2017-09-19 14:47:10 +00:00
},
});