fixed, aria reuse old session, and reload chat
This commit is contained in:
@@ -471,6 +471,7 @@
|
||||
ws.onopen = () => {
|
||||
addLog('info', 'browser', 'Verbunden mit Diagnostic Server');
|
||||
send({ action: 'get_active_session' });
|
||||
send({ action: 'load_chat_history' });
|
||||
};
|
||||
ws.onclose = () => {
|
||||
addLog('warn', 'browser', 'Verbindung zum Diagnostic Server verloren — Reconnect in 2s');
|
||||
@@ -567,6 +568,24 @@
|
||||
showDockerLogs(msg);
|
||||
return;
|
||||
}
|
||||
// Chat-History (nach F5 / Reconnect)
|
||||
if (msg.type === 'chat_history') {
|
||||
if (msg.messages && msg.messages.length > 0) {
|
||||
chatBox.innerHTML = '';
|
||||
for (const m of msg.messages) {
|
||||
const el = document.createElement('div');
|
||||
el.className = `chat-msg ${m.type}`;
|
||||
const escaped = escapeHtml(m.text);
|
||||
const linked = linkifyText(escaped);
|
||||
const time = m.ts ? new Date(m.ts).toLocaleTimeString('de-DE') : '?';
|
||||
el.innerHTML = `${linked}<div class="meta">${escapeHtml(m.meta)} — ${time}</div>`;
|
||||
chatBox.appendChild(el);
|
||||
}
|
||||
chatBox.scrollTop = chatBox.scrollHeight;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Session + Brain Viewer
|
||||
if (msg.type === 'sessions_list') { renderSessions(msg); return; }
|
||||
if (msg.type === 'session_detail') { renderSessionDetail(msg); return; }
|
||||
|
||||
Reference in New Issue
Block a user