From 289b6d5f59836f4b88d328af05830da4741f7dcf Mon Sep 17 00:00:00 2001 From: Roby Date: Mon, 27 Apr 2026 01:04:26 +0200 Subject: [PATCH] fix: resolve blue TX line freeze and add smart hang-time --- templates/index.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 0011d75..197fbba 100644 --- a/templates/index.html +++ b/templates/index.html @@ -794,7 +794,16 @@ if (isOnline) { cardDiv.classList.add('online'); statusDiv.classList.remove('status-offline'); cardDiv.style.opacity = "1"; cardDiv.style.filter = "none"; - cardDiv.style.setProperty('border-top-color', (!isTx && isIdle) ? "var(--border-color)" : activeModeColor, 'important'); + + // --- INIZIO LOGICA SMART HANG-TIME --- + if (isTx) cardDiv.dataset.lastTx = Date.now(); // Memorizza quando è avvenuto l'ultimo TX + let timeSinceTx = Date.now() - (parseInt(cardDiv.dataset.lastTx) || 0); + + // Accendi se in TX, OPPURE se in Hang Time (ma spegni a forza dopo 30 secondi di inattività) + let showActiveColor = isTx || (!isIdle && timeSinceTx < 30000); + + cardDiv.style.setProperty('border-top-color', showActiveColor ? activeModeColor : "var(--border-color)", 'important'); + // --- FINE LOGICA --- if(isTx) { let shadowRGB = '59, 130, 246'; if (activeModeColor === '#10b981') shadowRGB = '16, 185, 129';