github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/controllers/jobs/job/allocations.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: 25, 18 19 sortProperty: 'modifyIndex', 20 sortDescending: true, 21 22 job: alias('model'), 23 24 searchProps: computed(() => ['shortId', 'name', 'taskGroupName']), 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 actions: { 35 gotoAllocation(allocation) { 36 this.transitionToRoute('allocations.allocation', allocation); 37 }, 38 }, 39 });