github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/controllers/csi/plugins/index.js (about) 1 import { inject as service } from '@ember/service'; 2 import { computed } from '@ember/object'; 3 import { alias, readOnly } from '@ember/object/computed'; 4 import Controller, { inject as controller } from '@ember/controller'; 5 import SortableFactory from 'nomad-ui/mixins/sortable-factory'; 6 import Searchable from 'nomad-ui/mixins/searchable'; 7 import { lazyClick } from 'nomad-ui/helpers/lazy-click'; 8 9 export default Controller.extend( 10 SortableFactory([ 11 'plainId', 12 'controllersHealthyProportion', 13 'nodesHealthyProportion', 14 'provider', 15 ]), 16 Searchable, 17 { 18 userSettings: service(), 19 pluginsController: controller('csi/plugins'), 20 21 isForbidden: alias('pluginsController.isForbidden'), 22 23 queryParams: { 24 currentPage: 'page', 25 searchTerm: 'search', 26 sortProperty: 'sort', 27 sortDescending: 'desc', 28 }, 29 30 currentPage: 1, 31 pageSize: readOnly('userSettings.pageSize'), 32 33 searchProps: computed(() => ['id']), 34 fuzzySearchProps: computed(() => ['id']), 35 36 sortProperty: 'id', 37 sortDescending: false, 38 39 listToSort: alias('model'), 40 listToSearch: alias('listSorted'), 41 sortedPlugins: alias('listSearched'), 42 43 actions: { 44 gotoPlugin(plugin, event) { 45 lazyClick([() => this.transitionToRoute('csi.plugins.plugin', plugin.plainId), event]); 46 }, 47 }, 48 } 49 );