Settings: promote Added Models to its own sidebar menu

Move the Added Models endpoint lists out of the Add Models card into a
dedicated sidebar tab between Add Models and AI Defaults. The card now
focuses purely on adding (Local / API tabs), while the new panel owns
the existing endpoints + Probe and Clear-offline controls.

admin.js: defensive fallback so a stale 'added' value in localStorage
falls back to 'local' instead of leaving both panes hidden.
This commit is contained in:
pewdiepie-archdaemon
2026-06-09 14:52:48 +09:00
parent c9fecd53dc
commit 2252776a97
2 changed files with 35 additions and 26 deletions
+5 -1
View File
@@ -1452,8 +1452,12 @@ function initEndpointForm() {
const panes = document.querySelectorAll('.adm-models-pane');
if (!tabs.length || !panes.length) return;
const KEY = 'odysseus.addModels.activeTab';
const validTabs = new Set(Array.from(tabs).map((t) => t.dataset.modelsTab));
let active = 'local';
try { active = localStorage.getItem(KEY) || 'local'; } catch {}
try {
const stored = localStorage.getItem(KEY);
if (stored && validTabs.has(stored)) active = stored;
} catch {}
const apply = (name) => {
active = name;
try { localStorage.setItem(KEY, name); } catch {}