fix(diagnostic): JS-Crash beim Laden durch Ghost-IDs aus OpenClaw-Zeit
Die Diagnostic-Seite lud nicht mehr richtig: bei jedem state-Update vom
Server crashte updateState() auf null.className weil 'gw-dot' nicht mehr
existiert (Gateway-Card wurde durch Brain-Card ersetzt). Mehrere weitere
Stellen waren ebenfalls auf nicht mehr existierende Elemente geleitet.
Bereinigt:
- updateState() nutzt jetzt brain-dot/short/error (null-safe)
- openCoreTerminal entfernt (aria-core ist raus)
- closeTermModal null-safe fuer btn-core-term
- 'core_auth' WS-Event entfernt
- 'session_restarted' WS-Event entfernt (perms-status-Element war auch raus)
- 'openclaw_config' WS-Event entfernt
- rc-compact-after read/write aus loadRuntimeConfig/saveRuntimeConfig raus
(Compact-After-Messages-Setting wurde mit aria-core entfernt)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-43
@@ -1230,12 +1230,7 @@
|
||||
el.textContent = msg.error ? `Fehler: ${msg.error}` : msg.info;
|
||||
return;
|
||||
}
|
||||
if (msg.type === 'core_auth') {
|
||||
const el = document.getElementById('core-auth');
|
||||
el.style.display = 'block';
|
||||
el.textContent = msg.error ? `Fehler: ${msg.error}` : msg.info;
|
||||
return;
|
||||
}
|
||||
// core_auth WS-Event entfernt — aria-core ist raus.
|
||||
// Live SSH + Desktop
|
||||
if (msg.type?.startsWith('live_ssh_')) { handleLiveSSH(msg); return; }
|
||||
if (msg.type === 'desktop_status') { handleDesktop(msg); return; }
|
||||
@@ -1310,32 +1305,15 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// Settings (permissions_list/permissions_saved entfernt — Alles-oder-Nichts via --dangerously-skip-permissions)
|
||||
if (msg.type === 'session_restarted') {
|
||||
const s = document.getElementById('perms-status');
|
||||
s.style.display = 'block';
|
||||
if (msg.status === 'restarting') {
|
||||
s.style.color = '#FFD60A';
|
||||
s.textContent = 'aria-core wird neu gestartet...';
|
||||
} else if (msg.status === 'ok') {
|
||||
s.style.color = '#34C759';
|
||||
s.textContent = msg.info || 'Session neu gestartet!';
|
||||
} else {
|
||||
s.style.color = '#FF6B6B';
|
||||
s.textContent = 'Restart fehlgeschlagen: ' + (msg.error || '?');
|
||||
}
|
||||
return;
|
||||
}
|
||||
// session_restarted / openclaw_config WS-Events entfernt — aria-core ist raus.
|
||||
if (msg.type === 'model_info') {
|
||||
const el = document.getElementById('setting-model');
|
||||
const st = document.getElementById('model-status');
|
||||
if (msg.model) el.value = msg.model;
|
||||
st.textContent = msg.info || '';
|
||||
st.style.color = msg.error ? '#FF6B6B' : '#34C759';
|
||||
return;
|
||||
}
|
||||
if (msg.type === 'openclaw_config') {
|
||||
document.getElementById('openclaw-config').textContent = msg.config || msg.error || '(leer)';
|
||||
if (el && msg.model) el.value = msg.model;
|
||||
if (st) {
|
||||
st.textContent = msg.info || msg.error || '';
|
||||
st.style.color = msg.error ? '#FF6B6B' : '#34C759';
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (msg.type === 'response') { return; }
|
||||
@@ -1422,15 +1400,12 @@
|
||||
openTermModal('Claude Login Terminal (aria-proxy)', { action: 'proxy_login' });
|
||||
}
|
||||
|
||||
function openCoreTerminal() {
|
||||
document.getElementById('btn-core-term').disabled = true;
|
||||
openTermModal('aria-core Shell', { action: 'core_terminal' });
|
||||
}
|
||||
// openCoreTerminal entfernt — aria-core ist raus.
|
||||
|
||||
function closeTermModal() {
|
||||
document.getElementById('term-modal').classList.remove('open');
|
||||
document.getElementById('btn-proxy-login').disabled = false;
|
||||
document.getElementById('btn-core-term').disabled = false;
|
||||
const proxyBtn = document.getElementById('btn-proxy-login');
|
||||
if (proxyBtn) proxyBtn.disabled = false;
|
||||
// Terminal aufraeumen
|
||||
if (term) { term.dispose(); term = null; }
|
||||
}
|
||||
@@ -1496,12 +1471,15 @@
|
||||
}
|
||||
|
||||
function updateState(state) {
|
||||
// Gateway
|
||||
// Brain-Status (loest die alte gw-* Gateway-Card ab — wenn loadBrainStatus
|
||||
// gleich danach laeuft, kriegt es die korrekten Werte; hier nur Default)
|
||||
const brainDot = document.getElementById('brain-dot');
|
||||
const brainShort = document.getElementById('brain-status-short');
|
||||
const brainErr = document.getElementById('brain-error');
|
||||
const gw = state.gateway || {};
|
||||
document.getElementById('gw-dot').className = `dot ${gw.status || 'disconnected'}`;
|
||||
document.getElementById('gw-status').textContent =
|
||||
(STATUS_LABELS[gw.status] || gw.status) + (gw.handshakeOk ? ' (Handshake OK)' : '');
|
||||
document.getElementById('gw-error').textContent = gw.lastError || '';
|
||||
if (brainDot) brainDot.className = `dot ${gw.status === 'connected' ? 'connected' : 'disconnected'}`;
|
||||
if (brainShort) brainShort.textContent = gw.status === 'disabled' ? 'aria-core entfernt — Brain-Loop' : (STATUS_LABELS[gw.status] || gw.status || '-');
|
||||
if (brainErr) brainErr.textContent = gw.lastError || '';
|
||||
|
||||
// RVS
|
||||
const rvs = state.rvs || {};
|
||||
@@ -2280,7 +2258,6 @@
|
||||
document.getElementById('rc-rvs-tls').value = String(cfg.RVS_TLS) === 'false' ? 'false' : 'true';
|
||||
document.getElementById('rc-rvs-token').value = cfg.RVS_TOKEN || '';
|
||||
document.getElementById('rc-auth-token').value = cfg.ARIA_AUTH_TOKEN || '';
|
||||
document.getElementById('rc-compact-after').value = cfg.compactAfterMessages != null ? cfg.compactAfterMessages : 140;
|
||||
statusEl.textContent = 'Geladen.';
|
||||
statusEl.style.color = '#34C759';
|
||||
loadOnboardingQR(); // QR bei Config-Wechsel neu generieren
|
||||
@@ -2293,14 +2270,12 @@
|
||||
async function saveRuntimeConfig() {
|
||||
const statusEl = document.getElementById('rc-status');
|
||||
statusEl.textContent = 'Speichere...';
|
||||
const compactRaw = document.getElementById('rc-compact-after').value.trim();
|
||||
const patch = {
|
||||
RVS_HOST: document.getElementById('rc-rvs-host').value.trim(),
|
||||
RVS_PORT: document.getElementById('rc-rvs-port').value.trim(),
|
||||
RVS_TLS: document.getElementById('rc-rvs-tls').value,
|
||||
RVS_TOKEN: document.getElementById('rc-rvs-token').value.trim(),
|
||||
ARIA_AUTH_TOKEN: document.getElementById('rc-auth-token').value.trim(),
|
||||
compactAfterMessages: compactRaw === '' ? 140 : Math.max(0, parseInt(compactRaw, 10) || 0),
|
||||
};
|
||||
try {
|
||||
const resp = await fetch('/api/runtime-config', {
|
||||
|
||||
Reference in New Issue
Block a user