fix(phase-a): Kontext-Cap, Download-State, Recipe-Edit, OS-Badge, Swap-Flash

A1: 32768-Kontext-Cap entfernt (install-recipe, install-model, register) →
    max_ctx_for() liefert nun bis zu 128k auf Strix Halo; behebt "context
    size exceeded" bei externen Tools.
A2: Download-State jetzt im Status-Endpoint sichtbar: Modelle zeigen
    "↓ Download X%" statt "bereit" während Job läuft (Backend + Frontend).
A3: PUT /api/cookbook/user-recipe/{id} + Edit-Button (✎) für eigene Setups.
    Download-Modal setzt Kontext-Input automatisch auf optimal.
A4: /api/updates liefert apt_cache_age_h; Badge zeigt Tooltip + ⚠ wenn >24h.
A5: Swap-Flash: Topbar-Text pulst kurz teal wenn Modell den State wechselt.
A6: LLM-Engine-Update fragt jetzt per confirmModal nach (Konsistenz).
A7: Event-Delegation statt per-render addEventListener in models.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-22 21:33:03 +02:00
parent 022c42dccb
commit 82d15d82db
10 changed files with 214 additions and 45 deletions
+10 -3
View File
@@ -116,14 +116,21 @@ function capTag(caps) {
return `<span class="tag text">Text</span>`;
}
function stackRow(m) {
const downloading = m.state === "downloading";
const on = RUNNING.has(m.state);
const dot = m.state === "loading" || m.state === "starting" ? "load" : on ? "on" : "";
const status = on ? (m.state === "loading" ? "lädt…" : "geladen") : "bereit";
const dot = (m.state === "loading" || m.state === "starting" || downloading) ? "load" : on ? "on" : "";
let status;
if (downloading) {
const pct = m.download_progress != null ? ` ${Math.round(m.download_progress)}%` : "";
status = `↓ Download${pct}`;
} else {
status = on ? (m.state === "loading" ? "lädt…" : "geladen") : "bereit";
}
const file = m.meta?.filename ? `<div class="li-sub mono-sm">${esc(m.meta.filename)}</div>` : "";
return `<div class="li"><span class="li-dot ${dot}"></span>
<div class="li-main">
<div class="flex items-center gap-2"><span class="li-id">${esc(m.name)}</span>${capTag(m.meta?.caps)}</div>${file}</div>
<span class="li-meta" style="white-space:nowrap">${status}</span></div>`;
<span class="li-meta" style="white-space:nowrap">${esc(status)}</span></div>`;
}
async function renderNews() {