diff --git a/src/components/PageComponents/Messages/ChannelChat.tsx b/src/components/PageComponents/Messages/ChannelChat.tsx index d1945832..650ee678 100644 --- a/src/components/PageComponents/Messages/ChannelChat.tsx +++ b/src/components/PageComponents/Messages/ChannelChat.tsx @@ -3,14 +3,14 @@ import { MessageWithState, useDevice } from "@app/core/stores/deviceStore.js"; import { Message } from "@components/PageComponents/Messages/Message.js"; import { TraceRoute } from "@components/PageComponents/Messages/TraceRoute.js"; import { MessageInput } from "@components/PageComponents/Messages/MessageInput.js"; -import type { Types } from "@meshtastic/js"; +import type { Protobuf, Types } from "@meshtastic/js"; import { InboxIcon } from "lucide-react"; export interface ChannelChatProps { messages?: MessageWithState[]; channel: Types.ChannelNumber; to: Types.Destination; - traceroutes?: Types.PacketMetadata[]; + traceroutes?: Types.PacketMetadata[]; } export const ChannelChat = ({ diff --git a/src/components/PageComponents/Messages/TraceRoute.tsx b/src/components/PageComponents/Messages/TraceRoute.tsx index 9911e6cd..26f08bd4 100644 --- a/src/components/PageComponents/Messages/TraceRoute.tsx +++ b/src/components/PageComponents/Messages/TraceRoute.tsx @@ -2,9 +2,9 @@ import { useDevice } from "@app/core/stores/deviceStore.js"; import type { Protobuf } from "@meshtastic/js"; export interface TraceRouteProps { - from?: Protobuf.Mesh.NodeInfo; - to?: Protobuf.Mesh.NodeInfo; - route?: Protobuf.Mesh.RouteDiscovery; + from: Protobuf.Mesh.NodeInfo; + to: Protobuf.Mesh.NodeInfo; + route: Array; } diff --git a/src/core/stores/deviceStore.ts b/src/core/stores/deviceStore.ts index dc82e1cb..ecd1f7f0 100644 --- a/src/core/stores/deviceStore.ts +++ b/src/core/stores/deviceStore.ts @@ -41,6 +41,7 @@ export interface Device { direct: Map; broadcast: Map; }; + traceroutes: Map[]>; connection?: Types.ConnectionType; activePage: Page; activeNode: number; @@ -73,7 +74,7 @@ export interface Device { addPosition: (position: Types.PacketMetadata) => void; addConnection: (connection: Types.ConnectionType) => void; addMessage: (message: MessageWithState) => void; - addTraceRoute: (traceroute: Protobuf.Mesh.RouteDiscovery) => void; + addTraceRoute: (traceroute: Types.PacketMetadata) => void; addMetadata: (from: number, metadata: Protobuf.Mesh.DeviceMetadata) => void; setMessageState: ( type: "direct" | "broadcast", diff --git a/src/pages/Nodes.tsx b/src/pages/Nodes.tsx index 8b1c03a6..1ece9be5 100644 --- a/src/pages/Nodes.tsx +++ b/src/pages/Nodes.tsx @@ -26,6 +26,7 @@ export const NodesPage = (): JSX.Element => { { title: "MAC Address", type: "normal", sortable: true }, { title: "Last Heard", type: "normal", sortable: true }, { title: "SNR", type: "normal", sortable: true }, + { title: "Connection", type: "normal", sortable: true }, ]} rows={filteredNodes.map((node) => [ , @@ -55,6 +56,13 @@ export const NodesPage = (): JSX.Element => { {Math.min(Math.max((node.snr + 10) * 5, 0), 100)}%/ {(node.snr + 10) * 5}raw , + + {node.lastHeard != 0 ? + (node.viaMqtt === false && node.hopsAway === 0 + ? "Direct": node.hopsAway.toString() + " hops away") + : "-"} + {node.viaMqtt === true? ", via MQTT": ""} + ])} />