From b2458f9891dd63b64228d193f54c3e53dc6f11d9 Mon Sep 17 00:00:00 2001 From: pewdiepie-archdaemon Date: Tue, 9 Jun 2026 14:57:42 +0900 Subject: [PATCH] Settings/Add Models: split Local and API into separate cards, always show API key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the in-card Local/API tab strip — each is now its own admin card with a normal h2 heading (Local on top, API below). The API key input is always visible (no more click-to-reveal toggle), matching how cloud providers actually work. Local keeps the optional key reveal since local servers usually don't need one. Dead code removed: wireModelsTabs IIFE and the adm-epApiKeyBtn toggle wire. --- static/index.html | 57 ++++++++++++---------------------------------- static/js/admin.js | 33 --------------------------- 2 files changed, 15 insertions(+), 75 deletions(-) diff --git a/static/index.html b/static/index.html index 64acbe1a7..b9dc14e4e 100644 --- a/static/index.html +++ b/static/index.html @@ -2002,36 +2002,19 @@
-
-

Add Models (Endpoints)

-
- - -
- -
-
Add a local model server (Ollama, llama.cpp, vLLM).
-
-
+ +
+

Local Models

+
Add a local model server (Ollama, llama.cpp, vLLM).
+
+
- -
-
-
+
diff --git a/static/js/admin.js b/static/js/admin.js index 116ef20c3..69b3179dc 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -1168,7 +1168,6 @@ function initEndpointForm() { }); }; _wireKeyToggle('adm-epLocalKeyBtn', 'adm-epLocalApiKey-row'); - _wireKeyToggle('adm-epApiKeyBtn', 'adm-epApiKey-row'); // ── Added Models toolbar: Probe + Clear offline ──────────────────── // Both buttons act over the currently-rendered endpoint list. The @@ -1444,38 +1443,6 @@ function initEndpointForm() { }); } - // Add Models card has Local / API tabs (each tab pairs an Add form - // with its corresponding Added list). Remember the active tab in - // localStorage so the user lands back where they were. - (function wireModelsTabs() { - const tabs = document.querySelectorAll('.adm-models-tab'); - 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 { - const stored = localStorage.getItem(KEY); - if (stored && validTabs.has(stored)) active = stored; - } catch {} - const apply = (name) => { - active = name; - try { localStorage.setItem(KEY, name); } catch {} - tabs.forEach((t) => { - const on = t.dataset.modelsTab === name; - t.classList.toggle('active', on); - t.setAttribute('aria-selected', on ? 'true' : 'false'); - // Inline style swap so we don't need a CSS rule for active. - t.style.borderBottomColor = on ? 'var(--accent, var(--red))' : 'transparent'; - t.style.color = on ? 'var(--fg)' : 'var(--fg-muted)'; - }); - panes.forEach((p) => { - p.classList.toggle('hidden', p.dataset.modelsPane !== name); - }); - }; - tabs.forEach((t) => t.addEventListener('click', () => apply(t.dataset.modelsTab))); - apply(active); - })(); document.querySelectorAll('.adm-quickstart-section').forEach((sec) => { const head = sec.querySelector('.adm-quickstart-toggle'); if (!head) return;