feat(containers): store show all filter value in a cookie (#1203)
parent
61f652da04
commit
910136ee9b
|
@ -1,9 +1,9 @@
|
|||
angular.module('containers', [])
|
||||
.controller('ContainersController', ['$q', '$scope', '$filter', 'Container', 'ContainerService', 'ContainerHelper', 'SystemService', 'Notifications', 'Pagination', 'EntityListService', 'ModalService', 'ResourceControlService', 'EndpointProvider',
|
||||
function ($q, $scope, $filter, Container, ContainerService, ContainerHelper, SystemService, Notifications, Pagination, EntityListService, ModalService, ResourceControlService, EndpointProvider) {
|
||||
.controller('ContainersController', ['$q', '$scope', '$filter', 'Container', 'ContainerService', 'ContainerHelper', 'SystemService', 'Notifications', 'Pagination', 'EntityListService', 'ModalService', 'ResourceControlService', 'EndpointProvider', 'LocalStorage',
|
||||
function ($q, $scope, $filter, Container, ContainerService, ContainerHelper, SystemService, Notifications, Pagination, EntityListService, ModalService, ResourceControlService, EndpointProvider, LocalStorage) {
|
||||
$scope.state = {};
|
||||
$scope.state.pagination_count = Pagination.getPaginationCount('containers');
|
||||
$scope.state.displayAll = true;
|
||||
$scope.state.displayAll = LocalStorage.getFilterContainerShowAll();
|
||||
$scope.state.displayIP = false;
|
||||
$scope.sortType = 'State';
|
||||
$scope.sortReverse = false;
|
||||
|
@ -133,6 +133,7 @@ angular.module('containers', [])
|
|||
};
|
||||
|
||||
$scope.toggleGetAll = function () {
|
||||
LocalStorage.storeFilterContainerShowAll($scope.state.displayAll);
|
||||
update({all: $scope.state.displayAll ? 1 : 0});
|
||||
};
|
||||
|
||||
|
|
|
@ -43,6 +43,16 @@ angular.module('portainer.services')
|
|||
},
|
||||
clean: function() {
|
||||
localStorageService.clearAll();
|
||||
},
|
||||
storeFilterContainerShowAll: function(filter) {
|
||||
localStorageService.cookie.set('filter_containerShowAll', filter);
|
||||
},
|
||||
getFilterContainerShowAll: function() {
|
||||
var filter = localStorageService.cookie.get('filter_containerShowAll');
|
||||
if (filter === null) {
|
||||
filter = true;
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
|
Loading…
Reference in New Issue