diff --git a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js index 9518158..138dde4 100644 --- a/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js +++ b/src/trx-client/trx-frontend/trx-frontend-http/assets/web/app.js @@ -639,6 +639,8 @@ async function refreshRigList() { displayNames[r.rig_id] = r.rig_id; } }); + serverRigs = rigs; + serverActiveRigId = data.active_rig_id || null; applyRigList(data.active_rig_id, rigIds, displayNames); } catch (e) { // Non-fatal: SSE/status path still drives main UI. @@ -1245,6 +1247,8 @@ let serverVersion = null; let serverBuildDate = null; let serverCallsign = null; let ownerCallsign = null; +let serverRigs = []; +let serverActiveRigId = null; let serverLat = null; let serverLon = null; let initialMapZoom = 10; @@ -2442,17 +2446,21 @@ function initAprsMap() { updateMapBaseLayerForTheme(currentTheme()); if (hasLocation) { - const popupText = serverCallsign ? serverCallsign : "Receiver"; aprsMapReceiverMarker = L.circleMarker([serverLat, serverLon], { radius: 8, color: "#3388ff", fillColor: "#3388ff", fillOpacity: 0.8 - }).addTo(aprsMap).bindPopup(popupText); + }).addTo(aprsMap).bindPopup(""); } - // Rebuild APRS popup content on open so age and distance are always fresh - // and draw an animated radio path from receiver to the station + // Rebuild popup content on open (keeps age/distance/rig list fresh) aprsMap.on("popupopen", function(e) { const marker = e.popup._source; if (aprsRadioPath) { aprsRadioPath.remove(); aprsRadioPath = null; } + + if (marker === aprsMapReceiverMarker) { + e.popup.setContent(buildReceiverPopupHtml()); + return; + } + if (!marker || !marker._aprsCall) return; const entry = stationMarkers.get(marker._aprsCall); if (!entry) return; @@ -2572,6 +2580,33 @@ function formatTimeAgo(tsMs) { return remMins > 0 ? `${hrs}h ${remMins}min ago` : `${hrs}h ago`; } +function buildReceiverPopupHtml() { + const call = serverCallsign || ownerCallsign || "Receiver"; + let meta = ""; + if (serverVersion) { + meta = `trx-server v${escapeMapHtml(serverVersion)}`; + if (serverBuildDate) meta += ` · ${escapeMapHtml(serverBuildDate)}`; + } + let rows = ""; + if (ownerCallsign && ownerCallsign !== serverCallsign) { + rows += `