mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 07:03:15 +08:00
fix(desktop): external gateway mode and start script alignment
- Add desktop env for non-embedded gateway (OCLAW_DESKTOP_EMBED_BACKEND, base URL, skip channel). - Wire start_all/start_desktop to pass gateway URL when keeping existing gateway; fix root start_all flags. - Prefer electron.cmd for background desktop launch; admin static theme presets and chat boot timeouts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
19e51e2c12
commit
16169b3de2
12 changed files with 566 additions and 45 deletions
51
interfaces/admin/static/admin-theme.js
Normal file
51
interfaces/admin/static/admin-theme.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/* 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 LEGIT = new Set(THEMES);
|
||||
|
||||
function applyAdminTheme(theme) {
|
||||
const t = theme && LEGIT.has(theme) ? theme : "deepseek";
|
||||
if (t === "deepseek") document.body.removeAttribute("data-admin-theme");
|
||||
else document.body.setAttribute("data-admin-theme", t);
|
||||
}
|
||||
|
||||
function initAdminThemeFromStorage() {
|
||||
let raw = "deepseek";
|
||||
try {
|
||||
raw = localStorage.getItem(STORAGE_KEY) || "deepseek";
|
||||
} catch (_) {
|
||||
raw = "deepseek";
|
||||
}
|
||||
if (!LEGIT.has(raw)) raw = "deepseek";
|
||||
applyAdminTheme(raw);
|
||||
return raw;
|
||||
}
|
||||
|
||||
function persistAdminTheme(theme) {
|
||||
const t = theme && LEGIT.has(theme) ? theme : "deepseek";
|
||||
try {
|
||||
localStorage.setItem(STORAGE_KEY, t);
|
||||
} catch (_) {}
|
||||
applyAdminTheme(t);
|
||||
}
|
||||
|
||||
function currentAdminTheme() {
|
||||
try {
|
||||
const v = localStorage.getItem(STORAGE_KEY);
|
||||
return v && LEGIT.has(v) ? v : "deepseek";
|
||||
} catch (_) {
|
||||
return "deepseek";
|
||||
}
|
||||
}
|
||||
|
||||
window.OclawAdminTheme = {
|
||||
STORAGE_KEY,
|
||||
THEMES,
|
||||
applyAdminTheme,
|
||||
initAdminThemeFromStorage,
|
||||
persistAdminTheme,
|
||||
currentAdminTheme,
|
||||
};
|
||||
initAdminThemeFromStorage();
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue