From 5a47a8f8e48607a47ef10ad844ec6d213ce7b987 Mon Sep 17 00:00:00 2001
From: l5y <220195275+l5yth@users.noreply.github.com>
Date: Mon, 6 Oct 2025 08:08:24 +0200
Subject: [PATCH] Reformat neighbor overlay details (#237)
---
web/views/index.erb | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/web/views/index.erb b/web/views/index.erb
index 595576f..0f167bc 100644
--- a/web/views/index.erb
+++ b/web/views/index.erb
@@ -1687,13 +1687,24 @@ var(--fg); }
function openNeighborOverlay(target, segment) {
if (!shortInfoOverlay || !shortInfoContent || !segment) return;
const nodeName = shortInfoValueOrDash(segment.sourceDisplayName || segment.sourceId || '');
- const neighborName = shortInfoValueOrDash(segment.targetDisplayName || segment.targetId || '');
const snrText = shortInfoValueOrDash(formatSnrDisplay(segment.snr));
- const sourceIdHtml = segment.sourceId ? ` ${escapeHtml(segment.sourceId)}` : '';
- const targetIdHtml = segment.targetId ? ` ${escapeHtml(segment.targetId)}` : '';
+ const sourceShortHtml = renderShortHtml(
+ segment.sourceShortName,
+ segment.sourceRole,
+ segment.sourceDisplayName
+ );
+ const targetShortHtml = renderShortHtml(
+ segment.targetShortName,
+ segment.targetRole,
+ segment.targetDisplayName
+ );
+ const sourceIdText = shortInfoValueOrDash(segment.sourceId || '');
+ const neighborFullName = shortInfoValueOrDash(segment.targetDisplayName || segment.targetId || '');
const lines = [];
- lines.push(`${escapeHtml(nodeName)}${sourceIdHtml}`);
- lines.push(`Neighbor: ${escapeHtml(neighborName)}${targetIdHtml}`);
+ lines.push(`${escapeHtml(nodeName)}`);
+ lines.push(`${sourceShortHtml} ${escapeHtml(sourceIdText)}`);
+ const neighborLine = `${targetShortHtml} [${escapeHtml(neighborFullName)}]`;
+ lines.push(neighborLine);
lines.push(`SNR: ${escapeHtml(snrText)}`);
shortInfoContent.innerHTML = lines.join('
');
shortInfoAnchor = target;
@@ -2210,6 +2221,8 @@ var(--fg); }
const snrValue = toFiniteNumber(entry.snr);
const sourceDisplayName = getNodeDisplayNameForOverlay(sourceNode);
const targetDisplayName = getNodeDisplayNameForOverlay(targetNode);
+ const sourceShortName = normalizeNodeNameValue(sourceNode.short_name ?? sourceNode.shortName);
+ const targetShortName = normalizeNodeNameValue(targetNode.short_name ?? targetNode.shortName);
neighborSegments.push({
latlngs: [[srcLat, srcLon], [tgtLat, tgtLon]],
@@ -2220,7 +2233,11 @@ var(--fg); }
targetId,
snr: snrValue,
sourceDisplayName,
- targetDisplayName
+ targetDisplayName,
+ sourceShortName,
+ sourceRole: sourceNode.role,
+ targetShortName,
+ targetRole: targetNode.role
});
}