From f2c7e155d587f6440c3a6d9554491ba69c44867c Mon Sep 17 00:00:00 2001 From: Jason Michalski Date: Fri, 24 May 2024 22:51:38 -0700 Subject: [PATCH] Add short name and node id to tooltip. --- meshview/templates/node.html | 2 +- meshview/web.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/meshview/templates/node.html b/meshview/templates/node.html index a90d7de..2cf9e9c 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -90,7 +90,7 @@ L.marker(trace[0]).addTo(map); {% for n in neighbors %} var m = L.circleMarker({{n.location | tojson}}); - m.bindPopup('SNR: {{n.snr}}
{{n.name}} {{n.node_id | node_id_to_hex}}'); + m.bindPopup('SNR: {{n.snr}}
[{{n.short_name}}] {{n.long_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 428c6f9..89229d2 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -56,7 +56,8 @@ async def build_neighbors(node_id): for node_id, node in neighbors: node = await node if node and node.last_lat and node.last_long: - results[node_id]['name'] = node.long_name + results[node_id]['short_name'] = node.short_name + results[node_id]['long_name'] = node.long_name results[node_id]['location'] = (node.last_lat * 1e-7, node.last_long * 1e-7) else: del results[node_id]