From 30e81875db188e8f8eae62c6c1a6421a38d3d067 Mon Sep 17 00:00:00 2001 From: jaakko Date: Tue, 7 Apr 2026 07:18:13 +0300 Subject: [PATCH] =?UTF-8?q?Reconnect=20yhdell=C3=A4=20rivill=C3=A4:=20ei?= =?UTF-8?q?=20floodata=20terminaalia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sama rivi päivittyy laskurilla: '↻ Yhdistetään uudelleen... (3)' Rivi poistetaan kun yhteys palautuu. Co-Authored-By: Claude Opus 4.6 (1M context) --- network-poc/static/index.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/network-poc/static/index.html b/network-poc/static/index.html index f4b8a1a..e6d2cf2 100644 --- a/network-poc/static/index.html +++ b/network-poc/static/index.html @@ -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(' ↻ Yhdistetään uudelleen...'); + reconnCount++; + reconnLine.dataset.count = reconnCount; + reconnLine.innerHTML = ` ↻ Yhdistetään uudelleen...${reconnCount > 1 ? ' (' + reconnCount + ')' : ''}`; + termPanel.scrollTop = termPanel.scrollHeight; connectHub(); }, 3000); }