2020-03-25 12:51:26 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2020-03-31 04:29:30 +00:00
|
|
|
import { alias, readOnly } from '@ember/object/computed';
|
2020-03-25 12:51:26 +00:00
|
|
|
import Controller, { inject as controller } from '@ember/controller';
|
|
|
|
import SortableFactory from 'nomad-ui/mixins/sortable-factory';
|
|
|
|
|
|
|
|
export default Controller.extend(
|
|
|
|
SortableFactory([
|
|
|
|
'id',
|
|
|
|
'schedulable',
|
|
|
|
'controllersHealthyProportion',
|
|
|
|
'nodesHealthyProportion',
|
|
|
|
'provider',
|
|
|
|
]),
|
|
|
|
{
|
|
|
|
system: service(),
|
2020-03-31 04:29:30 +00:00
|
|
|
userSettings: service(),
|
2020-03-25 12:51:26 +00:00
|
|
|
csiController: controller('csi'),
|
|
|
|
|
|
|
|
isForbidden: alias('csiController.isForbidden'),
|
|
|
|
|
|
|
|
queryParams: {
|
|
|
|
currentPage: 'page',
|
|
|
|
sortProperty: 'sort',
|
|
|
|
sortDescending: 'desc',
|
|
|
|
},
|
|
|
|
|
|
|
|
currentPage: 1,
|
2020-03-31 04:29:30 +00:00
|
|
|
pageSize: readOnly('userSettings.pageSize'),
|
2020-03-25 12:51:26 +00:00
|
|
|
|
|
|
|
sortProperty: 'id',
|
2020-04-04 01:32:26 +00:00
|
|
|
sortDescending: false,
|
2020-03-25 12:51:26 +00:00
|
|
|
|
|
|
|
listToSort: alias('model'),
|
|
|
|
sortedVolumes: alias('listSorted'),
|
2020-03-31 04:29:30 +00:00
|
|
|
|
|
|
|
// TODO: Remove once this page gets search capability
|
|
|
|
resetPagination() {
|
|
|
|
if (this.currentPage != null) {
|
|
|
|
this.set('currentPage', 1);
|
|
|
|
}
|
|
|
|
},
|
2020-03-25 12:51:26 +00:00
|
|
|
}
|
|
|
|
);
|