mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
feat(ui): migrate to @recloudstudio/ui, add theme toggle and polish console UX
This commit is contained in:
45 files changed
+1489
-1343
No files matched your search
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user