1cca7abcab
This is extracted from #8094, where I have run into some snags. Since these ESLint fixes aren’t actually connected to the Ember 3.16 update but involve changes to many files, we might as well address them separately. Where possible I fixed the problems but in cases where a fix seemed too involved, I added per-line or -file exceptions.
54 lines
1.4 KiB
JavaScript
54 lines
1.4 KiB
JavaScript
import { inject as service } from '@ember/service';
|
|
import { computed } from '@ember/object';
|
|
import { alias, readOnly } from '@ember/object/computed';
|
|
import Controller, { inject as controller } from '@ember/controller';
|
|
import SortableFactory from 'nomad-ui/mixins/sortable-factory';
|
|
import Searchable from 'nomad-ui/mixins/searchable';
|
|
import { lazyClick } from 'nomad-ui/helpers/lazy-click';
|
|
|
|
export default Controller.extend(
|
|
SortableFactory([
|
|
'plainId',
|
|
'controllersHealthyProportion',
|
|
'nodesHealthyProportion',
|
|
'provider',
|
|
]),
|
|
Searchable,
|
|
{
|
|
userSettings: service(),
|
|
pluginsController: controller('csi/plugins'),
|
|
|
|
isForbidden: alias('pluginsController.isForbidden'),
|
|
|
|
queryParams: {
|
|
currentPage: 'page',
|
|
searchTerm: 'search',
|
|
sortProperty: 'sort',
|
|
sortDescending: 'desc',
|
|
},
|
|
|
|
currentPage: 1,
|
|
pageSize: readOnly('userSettings.pageSize'),
|
|
|
|
searchProps: computed(function() {
|
|
return ['id'];
|
|
}),
|
|
fuzzySearchProps: computed(function() {
|
|
return ['id'];
|
|
}),
|
|
|
|
sortProperty: 'id',
|
|
sortDescending: false,
|
|
|
|
listToSort: alias('model'),
|
|
listToSearch: alias('listSorted'),
|
|
sortedPlugins: alias('listSearched'),
|
|
|
|
actions: {
|
|
gotoPlugin(plugin, event) {
|
|
lazyClick([() => this.transitionToRoute('csi.plugins.plugin', plugin.plainId), event]);
|
|
},
|
|
},
|
|
}
|
|
);
|