Add short name and node id to tooltip.

This commit is contained in:
Jason Michalski
2024-05-24 22:51:38 -07:00
parent 9079bbbcb4
commit f2c7e155d5
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -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}}<br/><a href="/packet_list/{{n.node_id}}">{{n.name}} {{n.node_id | node_id_to_hex}}</a>');
m.bindPopup('SNR: {{n.snr}}<br/><a href="/packet_list/{{n.node_id}}">[{{n.short_name}}] {{n.long_name}} {{n.node_id | node_id_to_hex}}</a>');
m.addTo(map);
L.polyline([trace[0], {{n.location | tojson}}], {color: 'red'}).addTo(map);
{% endfor %}
+2 -1
View File
@@ -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]