From daeed58042c7077b2a79e4dcb5d0c95387ca26ef Mon Sep 17 00:00:00 2001 From: pablorevilla-meshtastic Date: Mon, 26 Oct 2026 15:17:14 -0700 Subject: [PATCH] latest updates --- README.md | 2 ++ docs/API_Documentation.md | 7 ++++++- meshview/static/api.html | 3 ++- meshview/templates/base.html | 4 +++- meshview/templates/node.html | 6 +++--- meshview/web_api/api.py | 1 + sample.config.ini | 2 ++ 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3db8e49..03ebb86 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,8 @@ stats = True net = True map = True top = True +# Show the API documentation link in the navigation bar (default: True). +api = True # Map boundaries (used for the map view). # Defaults will show the San Francisco Bay Area diff --git a/docs/API_Documentation.md b/docs/API_Documentation.md index 579beda..f97cdb5 100644 --- a/docs/API_Documentation.md +++ b/docs/API_Documentation.md @@ -380,7 +380,11 @@ fields shown here are exposed; credentials and the database connection string ar not returned. Feature flags and cleanup booleans are lowercase strings (`"true"` / `"false"`), not JSON booleans. Cleanup scheduling values are strings; map bounds are numbers and refresh intervals are integers. The removed `starting` option is not -returned: `/` always serves the dashboard. Handler failures return HTTP 500. +returned: `/` always serves the dashboard. `site.api` controls visibility of the API +documentation link in the navigation bar, defaults to `"true"`, and can be disabled +with `api = False` in `[site]`. This setting does not disable documentation or API +routes. Restart the web server and reload the page after changing it. Handler +failures return HTTP 500. Restart the web server and reload the map after changing these settings. Omitting the section uses generated colors for every channel. @@ -401,6 +405,7 @@ Response Example "net": "true", "map": "true", "top": "true", + "api": "true", "map_top_left_lat": 39.0, "map_top_left_lon": -123.0, "map_bottom_right_lat": 36.0, diff --git a/meshview/static/api.html b/meshview/static/api.html index fc137a3..54bec4b 100644 --- a/meshview/static/api.html +++ b/meshview/static/api.html @@ -223,7 +223,7 @@ curl 'http://localhost:8081/api/coverage/1234?mode=perimeter&radius_km=2
[map_channel_colors]
 LongFast = #4363d8
 LocalChat = #18aa18
-

No query parameters are supported. Only the site, MQTT server/topics, and cleanup fields shown here are exposed; credentials and the database connection string are not returned. Feature flags and cleanup booleans are lowercase strings ("true" / "false"), not JSON booleans. Cleanup scheduling values are strings; map bounds are numbers and refresh intervals are integers. The removed starting option is not returned: / always serves the dashboard. Handler failures return HTTP 500.

+

No query parameters are supported. Only the site, MQTT server/topics, and cleanup fields shown here are exposed; credentials and the database connection string are not returned. Feature flags and cleanup booleans are lowercase strings ("true" / "false"), not JSON booleans. Cleanup scheduling values are strings; map bounds are numbers and refresh intervals are integers. The removed starting option is not returned: / always serves the dashboard. site.api controls visibility of the API documentation link in the navigation bar, defaults to "true", and can be disabled with api = False in [site]. This setting does not disable documentation or API routes. Restart the web server and reload the page after changing it. Handler failures return HTTP 500.

Restart the web server and reload the map after changing these settings. Omitting the section uses generated colors for every channel.

Response Example

{
@@ -240,6 +240,7 @@ LocalChat = #18aa18
"net": "true", "map": "true", "top": "true", + "api": "true", "map_top_left_lat": 39.0, "map_top_left_lon": -123.0, "map_bottom_right_lat": 36.0, diff --git a/meshview/templates/base.html b/meshview/templates/base.html index 23ce482..9f17f78 100644 --- a/meshview/templates/base.html +++ b/meshview/templates/base.html @@ -301,7 +301,9 @@ async function initializePage() { items.push(`${escapeHtml(dict[key] || (key === "everything" ? "Live Traffic" : key))}`); } } - items.push('API'); + if (site.api !== "false" && site.api !== false) { + items.push('API'); + } items.push('MeshviewWorld'); menu.innerHTML = items.join(""); diff --git a/meshview/templates/node.html b/meshview/templates/node.html index 776390c..5022c01 100644 --- a/meshview/templates/node.html +++ b/meshview/templates/node.html @@ -157,7 +157,7 @@ - + @@ -1415,7 +1415,7 @@ document.addEventListener("DOMContentLoaded", async () => { await drawNeighbors(fromNodeId, neighborIds); } - await loadPackets(); + await reloadPackets(); initPacketPortFilter(); await loadTelemetryCharts(); await loadNeighborTimeSeries(); @@ -1485,7 +1485,7 @@ async function loadNodeStats(nodeId) { filters.portnum = portSel; } - loadPackets(filters); + return loadPackets(filters); } function exportPacketsCSV() { diff --git a/meshview/web_api/api.py b/meshview/web_api/api.py index 25ba384..62d5454 100644 --- a/meshview/web_api/api.py +++ b/meshview/web_api/api.py @@ -738,6 +738,7 @@ async def api_config(request): "net": get_bool(site, "net", True), "map": get_bool(site, "map", True), "top": get_bool(site, "top", True), + "api": get_bool(site, "api", True), "map_top_left_lat": get_float(site, "map_top_left_lat", 39.0), "map_top_left_lon": get_float(site, "map_top_left_lon", -123.0), "map_bottom_right_lat": get_float(site, "map_bottom_right_lat", 36.0), diff --git a/sample.config.ini b/sample.config.ini index eaab647..bf6b763 100644 --- a/sample.config.ini +++ b/sample.config.ini @@ -40,6 +40,8 @@ stats = True net = True map = True top = True +# Show the API documentation link in the navigation bar (default: True). +api = True # Map boundaries (used for the map view). map_top_left_lat = 39