2017-12-15 21:39:18 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2018-07-11 16:34:22 +00:00
|
|
|
import { alias } from '@ember/object/computed';
|
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';
|
2020-06-10 13:49:16 +00:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
import classic from 'ember-classic-decorator';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@classic
|
|
|
|
export default class IndexController extends Controller.extend(WithNamespaceResetting) {
|
|
|
|
@service system;
|
2018-03-23 01:59:53 +00:00
|
|
|
|
2020-06-11 13:38:33 +00:00
|
|
|
queryParams = [
|
|
|
|
{
|
|
|
|
currentPage: 'page',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
sortProperty: 'sort',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
sortDescending: 'desc',
|
|
|
|
},
|
|
|
|
];
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
currentPage = 1;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@alias('model') job;
|
2018-07-11 16:34:22 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
sortProperty = 'name';
|
|
|
|
sortDescending = false;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@action
|
|
|
|
gotoTaskGroup(taskGroup) {
|
|
|
|
this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup);
|
|
|
|
}
|
2018-01-25 22:18:53 +00:00
|
|
|
|
2020-06-10 13:49:16 +00:00
|
|
|
@action
|
|
|
|
gotoJob(job) {
|
|
|
|
this.transitionToRoute('jobs.job', job, {
|
|
|
|
queryParams: { jobNamespace: job.get('namespace.name') },
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|