github.com/anuvu/nomad@v0.8.7-atom1/ui/app/controllers/clients/client.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 7 export default Controller.extend(Sortable, Searchable, { 8 queryParams: { 9 currentPage: 'page', 10 searchTerm: 'search', 11 sortProperty: 'sort', 12 sortDescending: 'desc', 13 }, 14 15 currentPage: 1, 16 pageSize: 8, 17 18 sortProperty: 'modifyIndex', 19 sortDescending: true, 20 21 searchProps: computed(() => ['shortId', 'name']), 22 23 listToSort: alias('model.allocations'), 24 listToSearch: alias('listSorted'), 25 sortedAllocations: alias('listSearched'), 26 27 sortedEvents: computed('model.events.@each.time', function() { 28 return this.get('model.events') 29 .sortBy('time') 30 .reverse(); 31 }), 32 33 sortedDrivers: computed('model.drivers.@each.name', function() { 34 return this.get('model.drivers').sortBy('name'); 35 }), 36 37 actions: { 38 gotoAllocation(allocation) { 39 this.transitionToRoute('allocations.allocation', allocation); 40 }, 41 }, 42 });