feat: refine BoosAPI console and user workspace

This commit is contained in:
boos
2026-06-09 16:48:18 +08:00
parent aaba6f152e
commit 59106e6a96
284 changed files with 59886 additions and 5594 deletions
+15 -4
View File
@@ -10,11 +10,22 @@
<body class="min-h-screen">
<script>
(function(){
var t = localStorage.getItem('theme');
if (t === 'dark' || (!t && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.setAttribute('data-theme', 'dark');
var mode = localStorage.getItem('theme_mode');
var legacy = localStorage.getItem('theme');
var preset = localStorage.getItem('theme_preset');
var normalizedMode = mode === 'system' || mode === 'light' || mode === 'dark'
? mode
: (legacy === 'light' || legacy === 'dark' ? legacy : 'system');
var normalizedPreset = preset === 'terminal' || preset === 'studio' ? preset : 'clearops';
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
var resolved = normalizedMode === 'system' ? (prefersDark ? 'dark' : 'light') : normalizedMode;
document.documentElement.setAttribute('data-theme', resolved);
document.documentElement.setAttribute('data-theme-mode', normalizedMode);
document.documentElement.setAttribute('data-theme-preset', normalizedPreset);
if (normalizedPreset === 'terminal') {
document.documentElement.setAttribute('data-theme-tone', 'dark');
} else {
document.documentElement.setAttribute('data-theme', 'light');
document.documentElement.setAttribute('data-theme-tone', resolved);
}
})();
</script>