2020-04-10 21:54:53 +00:00
|
|
|
angular.module('portainer.docker').controller('TasksDatatableController', [
|
|
|
|
'$scope',
|
|
|
|
'$controller',
|
|
|
|
'DatatableService',
|
|
|
|
function ($scope, $controller, DatatableService) {
|
|
|
|
angular.extend(this, $controller('GenericDatatableController', { $scope: $scope }));
|
2019-07-02 15:51:17 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
this.state = Object.assign(this.state, {
|
|
|
|
showQuickActionStats: true,
|
|
|
|
showQuickActionLogs: true,
|
|
|
|
showQuickActionExec: true,
|
|
|
|
showQuickActionInspect: true,
|
|
|
|
showQuickActionAttach: false,
|
|
|
|
});
|
2019-07-02 15:51:17 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
this.$onInit = function () {
|
|
|
|
this.setDefaults();
|
|
|
|
this.prepareTableFromDataset();
|
2018-10-31 02:50:38 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
this.state.orderBy = this.orderBy;
|
|
|
|
var storedOrder = DatatableService.getDataTableOrder(this.tableKey);
|
|
|
|
if (storedOrder !== null) {
|
|
|
|
this.state.reverseOrder = storedOrder.reverse;
|
|
|
|
this.state.orderBy = storedOrder.orderBy;
|
|
|
|
}
|
2018-10-31 02:50:38 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
var textFilter = DatatableService.getDataTableTextFilters(this.tableKey);
|
|
|
|
if (textFilter !== null) {
|
|
|
|
this.state.textFilter = textFilter;
|
|
|
|
this.onTextFilterChange();
|
|
|
|
}
|
2018-12-06 19:54:34 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
var storedFilters = DatatableService.getDataTableFilters(this.tableKey);
|
|
|
|
if (storedFilters !== null) {
|
|
|
|
this.filters = storedFilters;
|
|
|
|
}
|
|
|
|
if (this.filters && this.filters.state) {
|
|
|
|
this.filters.state.open = false;
|
|
|
|
}
|
2018-10-31 02:50:38 +00:00
|
|
|
|
2020-04-10 21:54:53 +00:00
|
|
|
var storedSettings = DatatableService.getDataTableSettings(this.tableKey);
|
|
|
|
if (storedSettings !== null) {
|
|
|
|
this.settings = storedSettings;
|
|
|
|
this.settings.open = false;
|
|
|
|
}
|
|
|
|
this.onSettingsRepeaterChange();
|
|
|
|
};
|
|
|
|
},
|
|
|
|
]);
|