2018-10-31 02:50:38 +00:00
|
|
|
angular.module('portainer.docker')
|
2019-07-02 15:51:17 +00:00
|
|
|
.controller('TasksDatatableController', ['$scope', '$controller', 'DatatableService',
|
|
|
|
function ($scope, $controller, DatatableService) {
|
|
|
|
|
|
|
|
angular.extend(this, $controller('GenericDatatableController', {$scope: $scope}));
|
|
|
|
|
|
|
|
this.state = Object.assign(this.state, {
|
2018-10-31 02:50:38 +00:00
|
|
|
showQuickActionStats: true,
|
|
|
|
showQuickActionLogs: true,
|
2019-05-29 00:15:52 +00:00
|
|
|
showQuickActionExec: true,
|
2018-10-31 02:50:38 +00:00
|
|
|
showQuickActionInspect: true,
|
2019-07-02 15:51:17 +00:00
|
|
|
showQuickActionAttach: false
|
|
|
|
});
|
2018-10-31 02:50:38 +00:00
|
|
|
|
|
|
|
this.$onInit = function() {
|
2019-07-02 15:51:17 +00:00
|
|
|
this.setDefaults();
|
|
|
|
this.prepareTableFromDataset();
|
2018-10-31 02:50:38 +00:00
|
|
|
|
2019-08-12 14:25:35 +00:00
|
|
|
this.state.orderBy = this.orderBy;
|
2018-10-31 02:50:38 +00:00
|
|
|
var storedOrder = DatatableService.getDataTableOrder(this.tableKey);
|
|
|
|
if (storedOrder !== null) {
|
|
|
|
this.state.reverseOrder = storedOrder.reverse;
|
|
|
|
this.state.orderBy = storedOrder.orderBy;
|
|
|
|
}
|
2018-12-06 19:54:34 +00:00
|
|
|
|
|
|
|
var textFilter = DatatableService.getDataTableTextFilters(this.tableKey);
|
|
|
|
if (textFilter !== null) {
|
|
|
|
this.state.textFilter = textFilter;
|
2019-07-02 15:51:17 +00:00
|
|
|
this.onTextFilterChange();
|
2018-12-06 19:54:34 +00:00
|
|
|
}
|
2018-10-31 02:50:38 +00:00
|
|
|
|
2019-07-02 15:51:17 +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;
|
|
|
|
}
|
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-02 15:51:17 +00:00
|
|
|
};
|
2018-10-31 02:50:38 +00:00
|
|
|
}]);
|