[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 <codex@openai.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user