From cbd9942b0b2d77f504e3197b42a73c5cae011b54 Mon Sep 17 00:00:00 2001 From: oliver Date: Tue, 11 Aug 2026 03:25:48 +0800 Subject: [PATCH] Align Admin/Chat UI with NetX dark ops shell. Add a netx theme preset as the default, variable-drive chrome styles, and keep legacy DeepSeek/other palettes available. Co-authored-by: Cursor --- interfaces/admin/static/admin-theme.js | 23 +- interfaces/admin/static/app.js | 6 +- interfaces/admin/static/chat.js | 10 +- interfaces/admin/static/index.html | 1 + interfaces/admin/static/styles.css | 292 ++++++++++++++++----- interfaces/admin/static/theme-deepseek.css | 16 +- interfaces/admin/static/theme-presets.css | 59 ++++- 7 files changed, 317 insertions(+), 90 deletions(-) diff --git a/interfaces/admin/static/admin-theme.js b/interfaces/admin/static/admin-theme.js index 4f99bc3a..91609cca 100644 --- a/interfaces/admin/static/admin-theme.js +++ b/interfaces/admin/static/admin-theme.js @@ -1,29 +1,32 @@ /* Admin + standalone /chat: restore palette from localStorage before first paint. */ (function () { const STORAGE_KEY = "oclaw_admin_theme"; - const THEMES = ["deepseek", "github", "nord", "dracula", "forest", "catppuccin", "light"]; + const DEFAULT_THEME = "netx"; + const THEMES = ["netx", "deepseek", "github", "nord", "dracula", "forest", "catppuccin", "light"]; const LEGIT = new Set(THEMES); function applyAdminTheme(theme) { - const t = theme && LEGIT.has(theme) ? theme : "deepseek"; + const t = theme && LEGIT.has(theme) ? theme : DEFAULT_THEME; if (t === "deepseek") document.body.removeAttribute("data-admin-theme"); else document.body.setAttribute("data-admin-theme", t); } function initAdminThemeFromStorage() { - let raw = "deepseek"; + let raw = DEFAULT_THEME; try { - raw = localStorage.getItem(STORAGE_KEY) || "deepseek"; + const stored = localStorage.getItem(STORAGE_KEY); + // Missing key → netx. Existing deepseek/github/… prefs are preserved. + raw = stored == null || stored === "" ? DEFAULT_THEME : stored; } catch (_) { - raw = "deepseek"; + raw = DEFAULT_THEME; } - if (!LEGIT.has(raw)) raw = "deepseek"; + if (!LEGIT.has(raw)) raw = DEFAULT_THEME; applyAdminTheme(raw); return raw; } function persistAdminTheme(theme) { - const t = theme && LEGIT.has(theme) ? theme : "deepseek"; + const t = theme && LEGIT.has(theme) ? theme : DEFAULT_THEME; try { localStorage.setItem(STORAGE_KEY, t); } catch (_) {} @@ -33,14 +36,16 @@ function currentAdminTheme() { try { const v = localStorage.getItem(STORAGE_KEY); - return v && LEGIT.has(v) ? v : "deepseek"; + if (v == null || v === "") return DEFAULT_THEME; + return LEGIT.has(v) ? v : DEFAULT_THEME; } catch (_) { - return "deepseek"; + return DEFAULT_THEME; } } window.OclawAdminTheme = { STORAGE_KEY, + DEFAULT_THEME, THEMES, applyAdminTheme, initAdminThemeFromStorage, diff --git a/interfaces/admin/static/app.js b/interfaces/admin/static/app.js index b0bcfe4c..20cf22a2 100644 --- a/interfaces/admin/static/app.js +++ b/interfaces/admin/static/app.js @@ -273,7 +273,8 @@ const I18N = { "common.forbidden": "无权访问该页面。", "common.error": "错误", "theme.label": "界面配色", - "theme.deepseek": "DeepSeek 默认", + "theme.netx": "NetX 暗色", + "theme.deepseek": "DeepSeek", "theme.github": "GitHub 暗色", "theme.nord": "Nord", "theme.dracula": "Dracula", @@ -755,7 +756,8 @@ const I18N = { "common.forbidden": "You do not have access to this page.", "common.error": "Error", "theme.label": "Color theme", - "theme.deepseek": "DeepSeek (default)", + "theme.netx": "NetX Dark", + "theme.deepseek": "DeepSeek", "theme.github": "GitHub Dark", "theme.nord": "Nord", "theme.dracula": "Dracula", diff --git a/interfaces/admin/static/chat.js b/interfaces/admin/static/chat.js index 2632a4a5..de4ea0d2 100644 --- a/interfaces/admin/static/chat.js +++ b/interfaces/admin/static/chat.js @@ -87,7 +87,8 @@ const I18N = { "auth.disabled": "账号已被禁用,请联系管理员", "common.error": "错误", "theme.label": "界面配色", - "theme.deepseek": "DeepSeek 默认", + "theme.netx": "NetX 暗色", + "theme.deepseek": "DeepSeek", "theme.github": "GitHub 暗色", "theme.nord": "Nord", "theme.dracula": "Dracula", @@ -276,7 +277,8 @@ const I18N = { "auth.disabled": "Account is disabled", "common.error": "Error", "theme.label": "Color theme", - "theme.deepseek": "DeepSeek (default)", + "theme.netx": "NetX Dark", + "theme.deepseek": "DeepSeek", "theme.github": "GitHub Dark", "theme.nord": "Nord", "theme.dracula": "Dracula", @@ -3017,10 +3019,10 @@ function syncAuthUserLabel() { style: "width:100%;margin:4px 8px 8px;max-width:calc(100% - 16px);", }); try { - (window.OclawAdminTheme && window.OclawAdminTheme.THEMES ? window.OclawAdminTheme.THEMES : ["deepseek"]).forEach((tid) => { + (window.OclawAdminTheme && window.OclawAdminTheme.THEMES ? window.OclawAdminTheme.THEMES : ["netx"]).forEach((tid) => { themeSelMenu.appendChild(el("option", { value: tid, text: t(`theme.${tid}`) })); }); - themeSelMenu.value = window.OclawAdminTheme ? window.OclawAdminTheme.currentAdminTheme() : "deepseek"; + themeSelMenu.value = window.OclawAdminTheme ? window.OclawAdminTheme.currentAdminTheme() : "netx"; } catch (_) {} themeSelMenu.addEventListener("change", () => { try { diff --git a/interfaces/admin/static/index.html b/interfaces/admin/static/index.html index ffe98f69..953321de 100644 --- a/interfaces/admin/static/index.html +++ b/interfaces/admin/static/index.html @@ -98,6 +98,7 @@