From e6c41f72b5b020b79386d40bdd9c332dfce8d11a Mon Sep 17 00:00:00 2001 From: Pablo Revilla Date: Mon, 10 Mar 2025 13:54:15 -0700 Subject: [PATCH] Added coordinates customization to the config.ini file and map. Added search capabilities to the mesh graphs. --- .idea/{meshview 4.iml => meshview.iml} | 0 .idea/modules.xml | 2 +- meshview/templates/map.html | 4 +- meshview/templates/nodegraph.html | 127 +++++++++++++++++++------ meshview/templates/nodelist.html | 12 ++- meshview/web.py | 1 - sample.config.ini | 20 ---- 7 files changed, 112 insertions(+), 54 deletions(-) rename .idea/{meshview 4.iml => meshview.iml} (100%) delete mode 100644 sample.config.ini diff --git a/.idea/meshview 4.iml b/.idea/meshview.iml similarity index 100% rename from .idea/meshview 4.iml rename to .idea/meshview.iml diff --git a/.idea/modules.xml b/.idea/modules.xml index c25156b..cbc1975 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/meshview/templates/map.html b/meshview/templates/map.html index a460cc9..c214036 100644 --- a/meshview/templates/map.html +++ b/meshview/templates/map.html @@ -128,8 +128,8 @@ }); var bayAreaBounds = [ - [37.0, -123.2], - [38.5, -121.5] + [{{ site_config["site"]["map_top_left_lat"] }}, {{ site_config["site"]["map_top_left_lon"] }}], + [{{ site_config["site"]["map_bottom_right_lat"] }}, {{ site_config["site"]["map_bottom_right_lon"] }}] ]; map.fitBounds(bayAreaBounds); diff --git a/meshview/templates/nodegraph.html b/meshview/templates/nodegraph.html index b088685..8451a6d 100644 --- a/meshview/templates/nodegraph.html +++ b/meshview/templates/nodegraph.html @@ -43,6 +43,15 @@ {% endblock %} {% block body %} +
+ + +
+
@@ -59,48 +68,49 @@ Hardware Model: -< {% endblock %} diff --git a/meshview/templates/nodelist.html b/meshview/templates/nodelist.html index 00dc104..98b50be 100644 --- a/meshview/templates/nodelist.html +++ b/meshview/templates/nodelist.html @@ -2,11 +2,14 @@ {% block css %} table { - width: 100%; + width: 80%; border-collapse: collapse; margin-top: 1em; + margin-left: auto; + margin-right: auto; } + th, td { padding: 10px; border: 1px solid #333; @@ -31,6 +34,9 @@ tr:nth-child(odd) { display: flex; gap: 10px; margin-bottom: 10px; + width: 80%; + margin-left: auto; + margin-right: auto; } .search, .filter-role, .filter-channel, .filter-hw_model, .export-btn { @@ -58,6 +64,10 @@ tr:nth-child(odd) { margin-bottom: 10px; font-weight: bold; color: white; + width: 80%; + margin-left: auto; + margin-right: auto; + } {% endblock %} diff --git a/meshview/web.py b/meshview/web.py index be8fbf5..1882883 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -131,7 +131,6 @@ async def build_trace(node_id): trace.append((p.raw_payload.latitude_i * 1e-7, p.raw_payload.longitude_i * 1e-7)) break - gc.collect() # Force garbage collection return trace diff --git a/sample.config.ini b/sample.config.ini deleted file mode 100644 index bd6bdf3..0000000 --- a/sample.config.ini +++ /dev/null @@ -1,20 +0,0 @@ -[server] -bind = * -port = 8081 -tls_cert = -acme_challenge = - -[site] -domain = http://meshview.bayme.sh -title = Bay Area Mesh -message = - -[mqtt] -server = mqtt.bayme.sh -topics = ["msh/US/bayarea/#", "msh/US/CA/mrymesh/#"] -port = 1883 -username = meshdev -password = large4cats - -[database] -connection_string = sqlite+aiosqlite:///packets.db \ No newline at end of file