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