From 6afa5af608998a6efb0ab283ae635b7b53e0b272 Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Mon, 20 May 2024 21:08:55 -0700 Subject: [PATCH] Add long name to neighbors tooltip. --- meshview/templates/node.html | 2 +- meshview/web.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meshview/templates/node.html b/meshview/templates/node.html index 1166118..00947dc 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -79,7 +79,7 @@ L.marker(trace[0]).addTo(map); {% for n in neighbors %} var m = L.circleMarker({{n.location | tojson}}); - m.bindPopup('SNR: {{n.snr}}
{{n.node_id | node_id_to_hex}}'); + m.bindPopup('SNR: {{n.snr}}
{{n.name}} {{n.node_id | node_id_to_hex}}'); m.addTo(map); L.polyline([trace[0], {{n.location | tojson}}], {color: 'red'}).addTo(map); {% endfor %} diff --git a/meshview/web.py b/meshview/web.py index 57b20f2..243e781 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -52,6 +52,7 @@ async def build_neighbors(node_id): for node in [n.result() for n in neighbors]: if node.last_lat and node.last_long: + results[node.node_id]['name'] = node.long_name results[node.node_id]['location'] = (node.last_lat * 1e-7, node.last_long * 1e-7) else: del results[node.node_id]