diff --git a/static/js/app.js b/static/js/app.js index 440e404..68eab4c 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -619,12 +619,13 @@ async function initUI() { const miniGrid = document.getElementById('home-mini-nodes'); if (miniGrid) { miniGrid.innerHTML = clients.map(c => ` -
-
+
+
${esc(c.name)}
ID: ${c.id.toUpperCase()}
+
-
OFFLINE
+
OFFLINE
`).join(''); } @@ -1029,6 +1030,7 @@ async function refreshStates() { const miniStatus = document.getElementById(`mini-status-${c.id}`); const miniName = document.getElementById(`mini-name-${c.id}`); const miniId = document.getElementById(`mini-id-${c.id}`); + const miniCaller = document.getElementById(`mini-caller-${c.id}`); if (miniCard && miniStatus) { if (genObj && isOnline) { @@ -1040,6 +1042,28 @@ async function refreshStates() { miniCard.style.opacity = "1"; miniCard.style.filter = "none"; + if (miniCaller) { + let activeCaller = ""; + if (isTx) { + let rawStr = (telemetryObj.alt && telemetryObj.alt !== "") ? telemetryObj.alt : ((String(telemetryObj.ts1 ?? '').includes("🎙️") || String(telemetryObj.ts1 ?? '').includes("TX")) ? String(telemetryObj.ts1) : String(telemetryObj.ts2 ?? '')); + // Rimuove emoji, prefissi come "D-Star:", "YSF:" e pulisce + let cleaned = rawStr.replace(/[^\x00-\x7F]/g, '') + .replace(/(TX)?\s*(D-STAR|YSF|NXDN|P25|DMR|FM|M17)\s*:/ig, '') + .replace(/TX/ig, '') + .trim(); + if (cleaned) activeCaller = cleaned.split(' ')[0]; + } + + if (isTx && activeCaller) { + miniCaller.innerText = activeCaller; + miniCaller.style.display = "block"; + miniCaller.style.color = activeModeColor; + } else { + miniCaller.style.display = "none"; + miniCaller.innerText = ""; + } + } + if (warns.length > 0 && !isTx && !isHold) { miniCard.style.borderColor = "var(--accent)"; miniStatus.innerText = "(!) ALERT";