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

37 lines
907 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';
import { action } from '@ember/object';
import classic from 'ember-classic-decorator';
2017-09-19 14:47:10 +00:00
@classic
export default class IndexController extends Controller.extend(WithNamespaceResetting) {
@service system;
queryParams = {
2017-09-19 14:47:10 +00:00
currentPage: 'page',
sortProperty: 'sort',
sortDescending: 'desc',
};
2017-09-19 14:47:10 +00:00
currentPage = 1;
2017-09-19 14:47:10 +00:00
@alias('model') job;
2018-07-11 16:34:22 +00:00
sortProperty = 'name';
sortDescending = false;
2017-09-19 14:47:10 +00:00
@action
gotoTaskGroup(taskGroup) {
this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup);
}
@action
gotoJob(job) {
this.transitionToRoute('jobs.job', job, {
queryParams: { jobNamespace: job.get('namespace.name') },
});
}
}