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:
oliver 2026-05-06 11:06:16 +08:00
parent 19e51e2c12
commit 16169b3de2
12 changed files with 566 additions and 45 deletions

View 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();
})();