mirror of
https://github.com/portainer/portainer.git
synced 2025-07-30 10:49:40 +02:00
refactor(global): service separation #552
This commit is contained in:
parent
0abe8883d1
commit
fe0bf77bbb
48 changed files with 1029 additions and 1015 deletions
30
app/services/localStorage.js
Normal file
30
app/services/localStorage.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
angular.module('portainer.services')
|
||||
.factory('LocalStorage', ['localStorageService', function LocalStorageFactory(localStorageService) {
|
||||
'use strict';
|
||||
return {
|
||||
storeEndpointState: function(state) {
|
||||
localStorageService.set('ENDPOINT_STATE', state);
|
||||
},
|
||||
getEndpointState: function() {
|
||||
return localStorageService.get('ENDPOINT_STATE');
|
||||
},
|
||||
storeJWT: function(jwt) {
|
||||
localStorageService.set('JWT', jwt);
|
||||
},
|
||||
getJWT: function() {
|
||||
return localStorageService.get('JWT');
|
||||
},
|
||||
deleteJWT: function() {
|
||||
localStorageService.remove('JWT');
|
||||
},
|
||||
storePaginationCount: function(key, count) {
|
||||
localStorageService.cookie.set('pagination_' + key, count);
|
||||
},
|
||||
getPaginationCount: function(key) {
|
||||
return localStorageService.cookie.get('pagination_' + key);
|
||||
},
|
||||
clean: function() {
|
||||
localStorageService.clearAll();
|
||||
}
|
||||
};
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue