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

38 lines
882 B
JavaScript
Raw Normal View History

2017-09-19 14:47:10 +00:00
import Ember from 'ember';
import Sortable from 'nomad-ui/mixins/sortable';
const { Controller, computed, inject } = Ember;
export default Controller.extend(Sortable, {
system: inject.service(),
2017-09-19 14:47:10 +00:00
jobController: inject.controller('jobs.job'),
queryParams: {
currentPage: 'page',
sortProperty: 'sort',
sortDescending: 'desc',
},
currentPage: 1,
pageSize: 10,
sortProperty: 'name',
sortDescending: false,
breadcrumbs: computed.alias('jobController.breadcrumbs'),
job: computed.alias('model'),
taskGroups: computed('model.taskGroups.[]', function() {
return this.get('model.taskGroups') || [];
}),
listToSort: computed.alias('taskGroups'),
sortedTaskGroups: computed.alias('listSorted'),
actions: {
gotoTaskGroup(taskGroup) {
this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup);
},
},
});