github.com/manicqin/nomad@v0.9.5/ui/app/controllers/jobs/job/task-group.js (about) 1 import { alias } from '@ember/object/computed'; 2 import 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 queryParams: { 10 currentPage: 'page', 11 searchTerm: 'search', 12 sortProperty: 'sort', 13 sortDescending: 'desc', 14 }, 15 16 currentPage: 1, 17 pageSize: 10, 18 19 sortProperty: 'modifyIndex', 20 sortDescending: true, 21 22 searchProps: computed(() => ['shortId', 'name']), 23 24 allocations: computed('model.allocations.[]', function() { 25 return this.get('model.allocations') || []; 26 }), 27 28 listToSort: alias('allocations'), 29 listToSearch: alias('listSorted'), 30 sortedAllocations: alias('listSearched'), 31 32 actions: { 33 gotoAllocation(allocation) { 34 this.transitionToRoute('allocations.allocation', allocation); 35 }, 36 }, 37 });