Web: link neighbour IDs to meshcoretel.ru profile pages

renderNeighbourId in the /stats neighbours table now checks for the
"full_id" field emitted by appendJsonNeighbours().  If the value is a
valid 64-character hex string (the node's full 32-byte public key),
the short ID is wrapped in an anchor tag pointing to
https://meshcoretel.ru/<FULL_ID_UPPERCASE> (target="_blank",
rel="noopener noreferrer").  Falls back to plain short ID when
"full_id" is absent or does not match the expected pattern.
This commit is contained in:
Valentin V. Bartenev
2026-05-17 06:11:52 +03:00
förälder 88517878d6
incheckning 7378666416
+6 -1
Visa fil
@@ -1661,7 +1661,12 @@ const char kWebPanelAppHtml[] PROGMEM = R"HTML(
} }
const renderNeighbourId = (neighbour) => { const renderNeighbourId = (neighbour) => {
const shortId = escapeHtml(neighbour.id || "--"); const shortId = escapeHtml(neighbour.id || "--");
return shortId; const fullId = typeof neighbour.full_id === "string" ? neighbour.full_id.trim() : "";
if (!/^[0-9A-Fa-f]{64}$/.test(fullId)) {
return shortId;
}
const href = "https://meshcoretel.ru/" + encodeURIComponent(fullId.toUpperCase());
return `<a href="${href}" target="_blank" rel="noopener noreferrer">${shortId}</a>`;
}; };
const rows = neighbours.map((neighbour) => `<tr> const rows = neighbours.map((neighbour) => `<tr>
<td>${renderNeighbourId(neighbour)}</td> <td>${renderNeighbourId(neighbour)}</td>