From b6b4b1b4d95868555089105885a2cfa5b73cfef9 Mon Sep 17 00:00:00 2001 From: duffyduck Date: Mon, 11 May 2026 23:07:42 +0200 Subject: [PATCH] fix(diagnostic): loadBrainStatus updated jetzt beide Cards (Main + Gehirn) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symptom: Main-Tab "ARIA BRAIN"-Card blieb auf "Lade..." haengen. Klick auf "Status pruefen" tat scheinbar nichts. Ursache: loadBrainStatus() suchte nur brain-status (Gehirn-Tab). Die Card im Main-Tab hat aber andere IDs (brain-dot + brain-status-short + brain-error), die wurden nirgends mehr befuellt seit updateState() das nicht mehr macht. Fix: loadBrainStatus update jetzt BEIDE Anzeigen synchron — kompakte Main-Card mit Dot/Status/Error UND die ausfuehrliche Gehirn-Tab-Zeile. Co-Authored-By: Claude Opus 4.7 (1M context) --- diagnostic/index.html | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/diagnostic/index.html b/diagnostic/index.html index a99d605..a14732c 100644 --- a/diagnostic/index.html +++ b/diagnostic/index.html @@ -2881,16 +2881,29 @@ // ── Gehirn-Tab ──────────────────────────────────────────── async function loadBrainStatus() { - const el = document.getElementById('brain-status'); - if (!el) return; + // Es gibt ZWEI Brain-Status-Anzeigen: kompakte Card im Main-Tab + // (brain-dot + brain-status-short + brain-error) und die ausfuehrliche + // im Gehirn-Tab (brain-status). Beide muessen synchron updated werden. + const mainShort = document.getElementById('brain-status-short'); + const mainDot = document.getElementById('brain-dot'); + const mainErr = document.getElementById('brain-error'); + const detail = document.getElementById('brain-status'); try { const r = await fetch('/api/brain/health'); if (!r.ok) throw new Error('HTTP ' + r.status); const d = await r.json(); - const st = d.status === 'ok' ? '🟢 online' : '🟡 ' + (d.status || 'unknown'); - el.innerHTML = `${st} · ${d.memory_count ?? '?'} Memories · Qdrant: ${d.qdrant || '-'}`; + const ok = d.status === 'ok'; + const st = ok ? '🟢 online' : '🟡 ' + (d.status || 'unknown'); + const detailText = `${st} · ${d.memory_count ?? '?'} Memories · Qdrant: ${d.qdrant || '-'}`; + if (detail) detail.innerHTML = detailText; + if (mainShort) mainShort.textContent = ok ? 'online' : (d.status || 'unbekannt'); + if (mainDot) mainDot.className = `dot ${ok ? 'connected' : 'disconnected'}`; + if (mainErr) mainErr.textContent = ok ? '' : (d.error || ''); } catch (e) { - el.innerHTML = `🔴 Brain nicht erreichbar (${e.message})`; + if (detail) detail.innerHTML = `🔴 Brain nicht erreichbar (${e.message})`; + if (mainShort) mainShort.textContent = 'nicht erreichbar'; + if (mainDot) mainDot.className = 'dot disconnected'; + if (mainErr) mainErr.textContent = e.message; } // Conversation-Stats (separater Endpoint) const conv = document.getElementById('conversation-status');