feat: тёмная тема на admin/register/security + бамп версии

Распространил тёмную тему на остальные живые страницы (админка, регистрация,
страница безопасности) — выбор общий с чатом через localStorage['theme'],
FOUC-скрипт в <head>, переключатель (в навигации админки / плавающая кнопка
на register и security). Палитра та же, что в чате. Депрекированные фреймы
(batch3/ssr/wizard/generate/reference/check — кнопки закомментированы) не трогал.

Версия: v.2026-06-10b.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-06-10 01:54:17 +10:00
co-authored by Claude Opus 4.8
parent ed913b2918
commit e7363f1aba
4 changed files with 62 additions and 1 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ MAX_MESSAGE_LEN = 10_000
# ⚠️ Версия UI — единый источник. БАМПАТЬ ПРИ КАЖДОМ ДЕПЛОЕ (формат: YYYY-MM-DD + буква).
# Фронт берёт её через GET /api/version (chat.html + admin.html, элемент .app-version).
APP_VERSION = "2026-06-10a"
APP_VERSION = "2026-06-10b"
# Audit: path → action name mapping
_AUDIT_MAP = [
+21
View File
@@ -35,7 +35,27 @@ a { color: var(--accent); text-decoration: none; }
.btn { padding: .5rem 1rem; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.btn:hover { background: #a83830; }
.btn-sm { padding: 2px 8px; font-size: .7rem; margin: 1px; cursor: pointer; border: 1px solid var(--border); border-radius: 3px; background: var(--card); }
/* ===== Тёмная тема (общая с чатом; выбор хранится в localStorage['theme']) ===== */
html { color-scheme: light; }
:root[data-theme="dark"] {
color-scheme: dark;
--bg: #16140f; --card: #211d17; --text: #ece4d7; --muted: #a89c8a;
--accent: #d9695c; --border: #3a332a;
--sidebar: #201c16; --sidebar-text: #d8cdbd; --sidebar-active: #d9695c; --green: #3fa066;
}
:root[data-theme="dark"] th { background: #2a2620; }
:root[data-theme="dark"] td { border-top-color: #2f2820; }
:root[data-theme="dark"] table, :root[data-theme="dark"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
:root[data-theme="dark"] .btn:hover { background: #c2564a; }
</style>
<script>
/* Тема до первой отрисовки (FOUC): сохранённый выбор → система → светлая */
(function(){try{var t=localStorage.getItem('theme');if(t!=='dark'&&t!=='light'){t=(window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();
function toggleTheme(){var n=document.documentElement.getAttribute('data-theme')==='dark'?'light':'dark';document.documentElement.setAttribute('data-theme',n);try{localStorage.setItem('theme',n);}catch(e){}applyThemeIcon();}
function applyThemeIcon(){var b=document.getElementById('theme-toggle');if(b)b.textContent=document.documentElement.getAttribute('data-theme')==='dark'?'☀ Светлая тема':'🌙 Тёмная тема';}
document.addEventListener('DOMContentLoaded',applyThemeIcon);
</script>
</head>
<body>
@@ -47,6 +67,7 @@ a { color: var(--accent); text-decoration: none; }
<a href="#sessions" onclick="return showPage('sessions')">Сессии</a>
<a href="#audit" onclick="return showPage('audit')">Журнал</a>
<a href="#files" onclick="return showPage('files')">Файлы</a>
<a href="#" id="theme-toggle" onclick="toggleTheme();return false">🌙 Тёмная тема</a>
<a href="/" class="back">← Вернуться в чат</a>
<div class="app-version" style="position:absolute;bottom:.5rem;left:1rem;font-size:.65rem;color:#999"></div>
</nav>
+19
View File
@@ -23,9 +23,28 @@ button:disabled { background: var(--border); cursor: not-allowed; }
.link:hover { text-decoration: underline; }
.step { display: none; }
.step.active { display: block; }
/* ===== Тёмная тема (общая с чатом; выбор в localStorage['theme']) ===== */
html { color-scheme: light; }
:root[data-theme="dark"] {
color-scheme: dark;
--bg: #16140f; --card: #211d17; --text: #ece4d7; --muted: #a89c8a;
--accent: #d9695c; --border: #3a332a; --green: #3fa066;
}
:root[data-theme="dark"] .card { box-shadow: 0 2px 16px rgba(0,0,0,.5); }
:root[data-theme="dark"] input { background: #262019; color: var(--text); }
:root[data-theme="dark"] button:hover { background: #c2564a; }
#theme-fab { position: fixed; top: .8rem; right: .8rem; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; }
</style>
<script>
(function(){try{var t=localStorage.getItem('theme');if(t!=='dark'&&t!=='light'){t=(window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();
function toggleTheme(){var n=document.documentElement.getAttribute('data-theme')==='dark'?'light':'dark';document.documentElement.setAttribute('data-theme',n);try{localStorage.setItem('theme',n);}catch(e){}applyThemeIcon();}
function applyThemeIcon(){var b=document.getElementById('theme-fab');if(b)b.textContent=document.documentElement.getAttribute('data-theme')==='dark'?'☀':'☾';}
document.addEventListener('DOMContentLoaded',applyThemeIcon);
</script>
</head>
<body>
<button id="theme-fab" onclick="toggleTheme()" title="Светлая / тёмная тема" aria-label="Переключить тему">☾</button>
<div class="card">
<h1>Регистрация</h1>
<p class="subtitle">Сметный ИИ-ассистент</p>
+21
View File
@@ -29,9 +29,30 @@ th { background: var(--bg); font-weight: 600; }
.back:hover { text-decoration: underline; }
.compare-good { color: #2b8a3e; }
.compare-bad { color: #c92a2a; }
/* ===== Тёмная тема (общая с чатом; выбор в localStorage['theme']) ===== */
html { color-scheme: light; }
:root[data-theme="dark"] {
color-scheme: dark;
--bg: #16140f; --bg-card: #211d17; --text: #ece4d7; --text-muted: #a89c8a;
--border: #3a332a; --accent: #d9695c;
--shadow-md: 0 8px 28px rgba(0,0,0,.55);
}
:root[data-theme="dark"] strong { color: #ece4d7; }
:root[data-theme="dark"] .highlight { background: #2a2410; }
:root[data-theme="dark"] .compare-good { color: #5fc27e; }
:root[data-theme="dark"] .compare-bad { color: #ff8585; }
#theme-fab { position: fixed; top: .8rem; right: .8rem; width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; }
</style>
<script>
(function(){try{var t=localStorage.getItem('theme');if(t!=='dark'&&t!=='light'){t=(window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();
function toggleTheme(){var n=document.documentElement.getAttribute('data-theme')==='dark'?'light':'dark';document.documentElement.setAttribute('data-theme',n);try{localStorage.setItem('theme',n);}catch(e){}applyThemeIcon();}
function applyThemeIcon(){var b=document.getElementById('theme-fab');if(b)b.textContent=document.documentElement.getAttribute('data-theme')==='dark'?'☀':'☾';}
document.addEventListener('DOMContentLoaded',applyThemeIcon);
</script>
</head>
<body>
<button id="theme-fab" onclick="toggleTheme()" title="Светлая / тёмная тема" aria-label="Переключить тему">☾</button>
<div class="container">