mirror of
https://github.com/meshtastic/web.git
synced 2026-04-23 07:17:22 -04:00
Fix node mapping and unknown node display in traceroute dialogs (#728)
Corrects the mapping of 'from' and 'to' nodes in TracerouteResponseDialog to reflect the actual origin and destination of traceroute packets. Also updates TraceRoute to display a localized unknown name for node ID 4294967295 (0xffffff), improving clarity for unknown nodes.
This commit is contained in:
@@ -30,7 +30,7 @@ export const TracerouteResponseDialog = ({
|
||||
const routeBack: number[] = traceroute?.data.routeBack ?? [];
|
||||
const snrTowards = (traceroute?.data.snrTowards ?? []).map((snr) => snr / 4);
|
||||
const snrBack = (traceroute?.data.snrBack ?? []).map((snr) => snr / 4);
|
||||
const from = getNode(traceroute?.from ?? 0);
|
||||
const from = getNode(traceroute?.to ?? 0); // The origin of the traceroute = the "to" node of the mesh packet
|
||||
const fromLongName =
|
||||
from?.user?.longName ??
|
||||
(from ? `!${numberToHexUnpadded(from?.num)}` : t("unknown.shortName"));
|
||||
@@ -40,7 +40,7 @@ export const TracerouteResponseDialog = ({
|
||||
? `${numberToHexUnpadded(from?.num).substring(0, 4)}`
|
||||
: t("unknown.shortName"));
|
||||
|
||||
const toUser = getNode(traceroute?.to ?? 0);
|
||||
const toUser = getNode(traceroute?.from ?? 0); // The destination of the traceroute = the "from" node of the mesh packet
|
||||
|
||||
if (!toUser || !from) {
|
||||
return null;
|
||||
|
||||
@@ -41,7 +41,7 @@ const RoutePath = ({ title, from, to, path, snr }: RoutePathProps) => {
|
||||
<span key={getNode(hop)?.num ?? hop}>
|
||||
<p>
|
||||
{getNode(hop)?.user?.longName ??
|
||||
`${t("traceRoute.nodeUnknownPrefix")}${numberToHexUnpadded(hop)}`}
|
||||
`${t("unknown.longName")} (!${numberToHexUnpadded(hop)})`}
|
||||
</p>
|
||||
<p>
|
||||
↓ {snr?.[i + 1] ?? t("unknown.num")}
|
||||
|
||||
Reference in New Issue
Block a user