Reconnect yhdellä rivillä: ei floodata terminaalia
Sama rivi päivittyy laskurilla: '↻ Yhdistetään uudelleen... (3)' Rivi poistetaan kun yhteys palautuu. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1691,6 +1691,9 @@
|
||||
const hubLabel = document.getElementById('agent-hub-label');
|
||||
const hubStatus = document.getElementById('agent-hub-status');
|
||||
if (hubDot) hubDot.style.background = '#3fb950';
|
||||
// Poistetaan reconnect-rivi
|
||||
const reconnLine = document.getElementById('agent-terminal')?.querySelector('.term-reconnect');
|
||||
if (reconnLine) reconnLine.remove();
|
||||
if (hubLabel) { hubLabel.textContent = 'Yhdistetty'; hubLabel.style.color = '#3fb950'; }
|
||||
if (hubStatus) hubStatus.title = 'Yhdistetty Kipinä Hubiin — tehtävien jakelu ja solmujen koordinointi aktiivinen';
|
||||
|
||||
@@ -1758,9 +1761,22 @@
|
||||
}
|
||||
// Automaattinen reconnect 3s kuluttua
|
||||
if (!wsReconnectTimer) {
|
||||
// Päivitetään samaa riviä eikä floodata uusia
|
||||
let reconnLine = termPanel?.querySelector('.term-reconnect');
|
||||
let reconnCount = 0;
|
||||
if (!reconnLine) {
|
||||
reconnLine = document.createElement('div');
|
||||
reconnLine.className = 'terminal-line term-reconnect';
|
||||
termPanel?.appendChild(reconnLine);
|
||||
} else {
|
||||
reconnCount = parseInt(reconnLine.dataset.count || '0');
|
||||
}
|
||||
wsReconnectTimer = setTimeout(() => {
|
||||
wsReconnectTimer = null;
|
||||
termLog(' <span style="color:#d29922">↻ Yhdistetään uudelleen...</span>');
|
||||
reconnCount++;
|
||||
reconnLine.dataset.count = reconnCount;
|
||||
reconnLine.innerHTML = ` <span style="color:#d29922">↻ Yhdistetään uudelleen...${reconnCount > 1 ? ' (' + reconnCount + ')' : ''}</span>`;
|
||||
termPanel.scrollTop = termPanel.scrollHeight;
|
||||
connectHub();
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user