2019-05-24 21:53:10 +00:00
|
|
|
angular.module('portainer.docker')
|
2019-07-02 15:51:17 +00:00
|
|
|
.controller('StoridgeDrivesDatatableController', ['$scope', '$controller', 'DatatableService',
|
|
|
|
function ($scope, $controller, DatatableService) {
|
2019-05-24 21:53:10 +00:00
|
|
|
angular.extend(this, $controller('GenericDatatableController', {$scope: $scope}));
|
|
|
|
|
2019-07-02 15:51:17 +00:00
|
|
|
this.allowSelection = function (item) {
|
|
|
|
return item.Status !== 'normal';
|
|
|
|
};
|
|
|
|
|
|
|
|
this.$onInit = function() {
|
|
|
|
this.setDefaults();
|
|
|
|
this.prepareTableFromDataset();
|
|
|
|
|
|
|
|
var storedOrder = DatatableService.getDataTableOrder(this.tableKey);
|
|
|
|
if (storedOrder !== null) {
|
|
|
|
this.state.reverseOrder = storedOrder.reverse;
|
|
|
|
this.state.orderBy = storedOrder.orderBy;
|
|
|
|
}
|
|
|
|
|
|
|
|
var textFilter = DatatableService.getDataTableTextFilters(this.tableKey);
|
|
|
|
if (textFilter !== null) {
|
|
|
|
this.state.textFilter = textFilter;
|
|
|
|
this.onTextFilterChange();
|
|
|
|
}
|
|
|
|
|
|
|
|
var storedFilters = DatatableService.getDataTableFilters(this.tableKey);
|
|
|
|
if (storedFilters !== null) {
|
|
|
|
this.filters = storedFilters;
|
|
|
|
}
|
|
|
|
if (this.filters && this.filters.state) {
|
|
|
|
this.filters.state.open = false;
|
2019-05-24 21:53:10 +00:00
|
|
|
}
|
2019-07-22 10:54:59 +00:00
|
|
|
|
|
|
|
var storedSettings = DatatableService.getDataTableSettings(this.tableKey);
|
|
|
|
if (storedSettings !== null) {
|
|
|
|
this.settings = storedSettings;
|
|
|
|
this.settings.open = false;
|
|
|
|
}
|
|
|
|
this.onSettingsRepeaterChange();
|
2019-07-23 03:09:43 +00:00
|
|
|
this.state.orderBy = this.orderBy;
|
2019-05-24 21:53:10 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
]);
|