From 35f406c225586a6536937927e0de43b8d900780e Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sat, 25 May 2024 11:48:02 +0800 Subject: [PATCH 1/2] Add Connection info to Nodes Table As requested in meshtastic/web#195 meshtastic/web#209, information about whether nodes were connected by MQTT is highly useful for users of the web interface. This patch adds a new column to the Nodes page which lists whether a connection is direct (0 hops, via lora), or how many hops away and whether the connection is via MQTT. fixes meshtastic/web#195 fixes meshtastic/web#209 --- src/pages/Nodes.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pages/Nodes.tsx b/src/pages/Nodes.tsx index 8b1c03a6..3e5db113 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,10 @@ export const NodesPage = (): JSX.Element => { {Math.min(Math.max((node.snr + 10) * 5, 0), 100)}%/ {(node.snr + 10) * 5}raw , + + {node.viaMqtt === false && node.hopsAway === 0? "Direct": node.hopsAway.toString() + " hops away"} + {node.viaMqtt === true? ", via MQTT": ""} + ])} /> From cbb3b63e5ccea79f5d5b58db82e82bb8956302e0 Mon Sep 17 00:00:00 2001 From: Tom Fifield Date: Sun, 26 May 2024 14:46:26 +0800 Subject: [PATCH 2/2] Mark never heard nodes as '-' in connection info Nodes never heard before show hop count of 0, and not via MQTT. However, reality is we've never connected to them. So, mark them as '-' in the Connection Info column in the nodes table. --- src/pages/Nodes.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Nodes.tsx b/src/pages/Nodes.tsx index 3e5db113..1ece9be5 100644 --- a/src/pages/Nodes.tsx +++ b/src/pages/Nodes.tsx @@ -57,7 +57,10 @@ export const NodesPage = (): JSX.Element => { {(node.snr + 10) * 5}raw , - {node.viaMqtt === false && node.hopsAway === 0? "Direct": node.hopsAway.toString() + " hops away"} + {node.lastHeard != 0 ? + (node.viaMqtt === false && node.hopsAway === 0 + ? "Direct": node.hopsAway.toString() + " hops away") + : "-"} {node.viaMqtt === true? ", via MQTT": ""} ])}