feat(ui): migrate to @recloudstudio/ui, add theme toggle and polish console UX

This commit is contained in:
RhenCloud committed 2026-10-03 22:54:32 +08:00
1 parent a899e16604
commit fbbff669a3
45 files changed
+1489 -1343

No files matched your search

+12
View File
@@ -8,7 +8,19 @@ export interface AdminSession {
login: string;
}
export function isDebugMode(env: Env): boolean {
if (env.DEBUG_MODE === "true") return true;
const anyEnv = env as unknown as Record<string, string | undefined>;
if (anyEnv["debug_mode"] === "true") return true;
const proc = (globalThis as unknown as { process?: { env?: Record<string, string | undefined> } }).process;
if (proc?.env?.NODE_ENV !== "test") {
if (proc?.env?.DEBUG_MODE === "true" || proc?.env?.debug_mode === "true") return true;
}
return false;
}
export function isAdminUser(env: Env, userId: string, login: string): boolean {
if (isDebugMode(env)) return true;
const ids = (env.ADMIN_USER_IDS ?? "")
.split(",")
.map((s) => s.trim())