github.com/hspak/nomad@v0.7.2-0.20180309000617-bc4ae22a39a5/ui/app/controllers/jobs/job/task-group.js (about) 1 import { alias } from '@ember/object/computed'; 2 import Controller, { inject as controller } from '@ember/controller'; 3 import { computed } from '@ember/object'; 4 import Sortable from 'nomad-ui/mixins/sortable'; 5 import Searchable from 'nomad-ui/mixins/searchable'; 6 import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting'; 7 8 export default Controller.extend(Sortable, Searchable, WithNamespaceResetting, { 9 jobController: controller('jobs.job'), 10 11 queryParams: { 12 currentPage: 'page', 13 searchTerm: 'search', 14 sortProperty: 'sort', 15 sortDescending: 'desc', 16 }, 17 18 currentPage: 1, 19 pageSize: 10, 20 21 sortProperty: 'modifyIndex', 22 sortDescending: true, 23 24 searchProps: computed(() => ['shortId', 'name']), 25 26 allocations: computed('model.allocations.[]', function() { 27 return this.get('model.allocations') || []; 28 }), 29 30 listToSort: alias('allocations'), 31 listToSearch: alias('listSorted'), 32 sortedAllocations: alias('listSearched'), 33 34 breadcrumbs: computed('jobController.breadcrumbs.[]', 'model.{name}', function() { 35 return this.get('jobController.breadcrumbs').concat([ 36 { label: this.get('model.name'), args: ['jobs.job.task-group', this.get('model.name')] }, 37 ]); 38 }), 39 40 actions: { 41 gotoAllocation(allocation) { 42 this.transitionToRoute('allocations.allocation', allocation); 43 }, 44 }, 45 });