refactor(storage): update storage keys to use 'doktainer' prefix
This commit is contained in:
1 parent
cc9fbcabec
commit
a2cd6b7099
3 files changed
+12
-10
No files matched your search
@@ -1,6 +1,6 @@
|
||||
const TOKEN_KEY = "vps_token";
|
||||
const USER_KEY = "vps_user";
|
||||
const ORGANIZATION_STORAGE_KEY = "vps_active_organization";
|
||||
const TOKEN_KEY = "doktainer_token";
|
||||
const USER_KEY = "doktainer_user";
|
||||
const ORGANIZATION_STORAGE_KEY = "doktainer_active_organization";
|
||||
|
||||
type SensitiveStorageKey =
|
||||
| typeof TOKEN_KEY
|
||||
@@ -17,7 +17,9 @@ function getLocalStorage(): Storage | null {
|
||||
}
|
||||
}
|
||||
|
||||
export function getSensitiveStorageItem(key: SensitiveStorageKey): string | null {
|
||||
export function getSensitiveStorageItem(
|
||||
key: SensitiveStorageKey,
|
||||
): string | null {
|
||||
return getLocalStorage()?.getItem(key) ?? null;
|
||||
}
|
||||
|
||||
@@ -36,4 +38,4 @@ export const sensitiveStorageKeys = {
|
||||
token: TOKEN_KEY,
|
||||
user: USER_KEY,
|
||||
organization: ORGANIZATION_STORAGE_KEY,
|
||||
} as const;
|
||||
} as const;
|
||||
@@ -11,10 +11,10 @@ export {
|
||||
resolveThemePreference,
|
||||
} from "@/lib/theme";
|
||||
|
||||
const SETTINGS_EVENT = "vps:settings-updated";
|
||||
const PANEL_NAME_KEY = "vps_panel_name";
|
||||
const PANEL_URL_KEY = "vps_panel_url";
|
||||
const SESSION_TIMEOUT_KEY = "vps_session_timeout_minutes";
|
||||
const SETTINGS_EVENT = "doktainer:settings-updated";
|
||||
const PANEL_NAME_KEY = "doktainer_panel_name";
|
||||
const PANEL_URL_KEY = "doktainer_panel_url";
|
||||
const SESSION_TIMEOUT_KEY = "doktainer_session_timeout_minutes";
|
||||
const DEFAULT_PANEL_NAME = process.env.NEXT_PUBLIC_PANEL_NAME || "DOKTAINER";
|
||||
|
||||
function resolveDefaultPanelUrl() {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
export type ThemePreference = "dark" | "light" | "system";
|
||||
|
||||
export const THEME_STORAGE_KEY = "vps_theme";
|
||||
export const THEME_STORAGE_KEY = "doktainer_theme";
|
||||
export const DEFAULT_THEME: ThemePreference = "dark";
|
||||
|
||||
function isThemePreference(value: string | null): value is ThemePreference {
|
||||
|
||||
Reference in new issue
Block a user