forked from AdguardTeam/AdGuardHome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
6206 get table page size from local storage
Updates AdguardTeam#6206 Squashed commit of the following: commit 0308913 Merge: 7078c44 3ce3c41 Author: Ildar Kamalov <ik@adguard.com> Date: Wed Oct 11 15:25:11 2023 +0300 Merge branch 'master' into ADG-7558 commit 7078c44 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Oct 9 19:47:58 2023 +0300 fix default page size commit 6456948 Author: Ildar Kamalov <ik@adguard.com> Date: Mon Oct 9 19:47:22 2023 +0300 remove unused commit 17614fa Author: Ildar Kamalov <ik@adguard.com> Date: Mon Oct 9 19:30:22 2023 +0300 ADG-7473 get table page size from local storage
- Loading branch information
1 parent
3ce3c41
commit 6a36615
Showing
7 changed files
with
67 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export const LOCAL_STORAGE_KEYS = { | ||
THEME: 'account_theme', | ||
BLOCKLIST_PAGE_SIZE: 'blocklist_page_size', | ||
ALLOWLIST_PAGE_SIZE: 'allowlist_page_size', | ||
CLIENTS_PAGE_SIZE: 'clients_page_size', | ||
REWRITES_PAGE_SIZE: 'rewrites_page_size', | ||
AUTO_CLIENTS_PAGE_SIZE: 'auto_clients_page_size', | ||
}; | ||
|
||
export const LocalStorageHelper = { | ||
setItem(key, value) { | ||
try { | ||
localStorage.setItem(key, JSON.stringify(value)); | ||
} catch (error) { | ||
console.error(`Error setting ${key} in local storage: ${error.message}`); | ||
} | ||
}, | ||
|
||
getItem(key) { | ||
try { | ||
const item = localStorage.getItem(key); | ||
return item ? JSON.parse(item) : null; | ||
} catch (error) { | ||
console.error(`Error getting ${key} from local storage: ${error.message}`); | ||
return null; | ||
} | ||
}, | ||
|
||
removeItem(key) { | ||
try { | ||
localStorage.removeItem(key); | ||
} catch (error) { | ||
console.error(`Error removing ${key} from local storage: ${error.message}`); | ||
} | ||
}, | ||
|
||
clear() { | ||
try { | ||
localStorage.clear(); | ||
} catch (error) { | ||
console.error(`Error clearing local storage: ${error.message}`); | ||
} | ||
}, | ||
}; |