From 4b1252a3e3047c74159da3632529c76c64b25f31 Mon Sep 17 00:00:00 2001 From: Stanislaw Grams Date: Thu, 12 Feb 2026 23:24:11 +0100 Subject: [PATCH] [fix](trx-frontend-http): update WSPR slot countdown timer Wire the WSPR period label to a live 120-second slot countdown so it no longer stays at the placeholder value. Co-authored-by: Codex Signed-off-by: Stanislaw Grams --- .../trx-frontend-http/assets/web/plugins/wspr.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/wspr.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/wspr.js index 12ac648..893ca63 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/wspr.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/plugins/wspr.js @@ -1,13 +1,27 @@ // --- WSPR Decoder Plugin (server-side decode) --- const wsprStatus = document.getElementById("wspr-status"); +const wsprPeriodEl = document.getElementById("wspr-period"); const wsprMessagesEl = document.getElementById("wspr-messages"); const WSPR_MAX_MESSAGES = 200; +const WSPR_PERIOD_SECONDS = 120; function fmtWsprTime(tsMs) { if (!tsMs) return "--:--:--"; return new Date(tsMs).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit" }); } +function updateWsprPeriodTimer() { + if (!wsprPeriodEl) return; + const nowSec = Math.floor(Date.now() / 1000); + const remaining = WSPR_PERIOD_SECONDS - (nowSec % WSPR_PERIOD_SECONDS); + const mm = String(Math.floor(remaining / 60)).padStart(2, "0"); + const ss = String(remaining % 60).padStart(2, "0"); + wsprPeriodEl.textContent = `Next slot ${mm}:${ss}`; +} + +updateWsprPeriodTimer(); +setInterval(updateWsprPeriodTimer, 500); + function renderWsprRow(msg) { const row = document.createElement("div"); row.className = "ft8-row";