refactor(storage): update storage keys to use 'doktainer' prefix

This commit is contained in:
KodekaTeam committed 2026-08-06 01:51:40 +07:00
1 parent cc9fbcabec
commit a2cd6b7099
3 files changed
+11 -9

No files matched your search

+6 -4
View File
@@ -1,6 +1,6 @@
const TOKEN_KEY = "vps_token"; const TOKEN_KEY = "doktainer_token";
const USER_KEY = "vps_user"; const USER_KEY = "doktainer_user";
const ORGANIZATION_STORAGE_KEY = "vps_active_organization"; const ORGANIZATION_STORAGE_KEY = "doktainer_active_organization";
type SensitiveStorageKey = type SensitiveStorageKey =
| typeof TOKEN_KEY | 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; return getLocalStorage()?.getItem(key) ?? null;
} }
+4 -4
View File
@@ -11,10 +11,10 @@ export {
resolveThemePreference, resolveThemePreference,
} from "@/lib/theme"; } from "@/lib/theme";
const SETTINGS_EVENT = "vps:settings-updated"; const SETTINGS_EVENT = "doktainer:settings-updated";
const PANEL_NAME_KEY = "vps_panel_name"; const PANEL_NAME_KEY = "doktainer_panel_name";
const PANEL_URL_KEY = "vps_panel_url"; const PANEL_URL_KEY = "doktainer_panel_url";
const SESSION_TIMEOUT_KEY = "vps_session_timeout_minutes"; const SESSION_TIMEOUT_KEY = "doktainer_session_timeout_minutes";
const DEFAULT_PANEL_NAME = process.env.NEXT_PUBLIC_PANEL_NAME || "DOKTAINER"; const DEFAULT_PANEL_NAME = process.env.NEXT_PUBLIC_PANEL_NAME || "DOKTAINER";
function resolveDefaultPanelUrl() { function resolveDefaultPanelUrl() {
+1 -1
View File
@@ -1,6 +1,6 @@
export type ThemePreference = "dark" | "light" | "system"; 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"; export const DEFAULT_THEME: ThemePreference = "dark";
function isThemePreference(value: string | null): value is ThemePreference { function isThemePreference(value: string | null): value is ThemePreference {