Add basic traceroute display
This patch adds basic traceroute display functionality on the Messages page for an individual node.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import {
|
||||
WaypointsIcon,
|
||||
ArrowRightLeft,
|
||||
} from "lucide-react";
|
||||
|
||||
export interface TraceRouteProps {
|
||||
from?: Protobuf.Mesh.NodeInfo;
|
||||
to?: Protobuf.Mesh.NodeInfo;
|
||||
route?: Protobuf.Mesh.RouteDiscovery;
|
||||
}
|
||||
|
||||
export const TraceRoute = ({
|
||||
from,
|
||||
to,
|
||||
route,
|
||||
}: TraceRouteProps): JSX.Element => {
|
||||
return route.length == 0 ? (
|
||||
<div className="ml-5 flex">
|
||||
<span className="ml-4 border-l-2 border-l-backgroundPrimary pl-2 text-textPrimary">
|
||||
{from?.user?.longName}↔{to?.user?.longName}
|
||||
</span>
|
||||
</div>
|
||||
) : (
|
||||
<div className="ml-5 flex">
|
||||
<span className="ml-4 border-l-2 border-l-backgroundPrimary pl-2 text-textPrimary">
|
||||
{route}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user