From 4150953b96aad35d44f19dea6b40e0f3ba601714 Mon Sep 17 00:00:00 2001 From: Pablo Revilla Date: Mon, 24 Nov 2025 09:09:51 -0800 Subject: [PATCH] Remamed new_node to node. shorter and descriptive. --- meshview/templates/chat.html | 2 +- meshview/templates/firehose.html | 4 ++-- meshview/templates/map.html | 2 +- meshview/templates/new_packet.html | 8 ++++---- meshview/templates/{new_node.html => node.html} | 2 +- meshview/templates/nodelist.html | 2 +- meshview/templates/top.html | 4 ++-- meshview/web.py | 16 ++++++++++++++-- 8 files changed, 26 insertions(+), 14 deletions(-) rename meshview/templates/{new_node.html => node.html} (99%) diff --git a/meshview/templates/chat.html b/meshview/templates/chat.html index 6c3a57b..e5c5a80 100644 --- a/meshview/templates/chat.html +++ b/meshview/templates/chat.html @@ -134,7 +134,7 @@ document.addEventListener("DOMContentLoaded", async () => { ${escapeHtml(packet.channel || "")} - + ${escapeHtml((packet.long_name || "").trim() || `Node ${packet.from_node_id}`)} diff --git a/meshview/templates/firehose.html b/meshview/templates/firehose.html index 946bd69..1b0667e 100644 --- a/meshview/templates/firehose.html +++ b/meshview/templates/firehose.html @@ -229,13 +229,13 @@ async function fetchUpdates() { for (const pkt of packets.reverse()) { const from = pkt.from_node_id === 4294967295 ? `All` - : `${nodeMap[pkt.from_node_id] || pkt.from_node_id}`; + : `${nodeMap[pkt.from_node_id] || pkt.from_node_id}`; const to = pkt.to_node_id === 1 ? `direct to MQTT` : pkt.to_node_id === 4294967295 ? `All` - : `${nodeMap[pkt.to_node_id] || pkt.to_node_id}`; + : `${nodeMap[pkt.to_node_id] || pkt.to_node_id}`; // Inline link next to port tag let inlineLinks = ""; diff --git a/meshview/templates/map.html b/meshview/templates/map.html index 1497093..1c7d3d3 100644 --- a/meshview/templates/map.html +++ b/meshview/templates/map.html @@ -205,7 +205,7 @@ function renderNodesOnMap(){ marker.nodeId = node.key; marker.originalColor = color; markerById[node.key] = marker; - const popup = `${node.long_name} (${node.short_name})
+ const popup = `${node.long_name} (${node.short_name})
Channel: ${node.channel}
Model: ${node.hw_model}
Role: ${node.role}
diff --git a/meshview/templates/new_packet.html b/meshview/templates/new_packet.html index 63a5971..3954428 100644 --- a/meshview/templates/new_packet.html +++ b/meshview/templates/new_packet.html @@ -219,13 +219,13 @@ document.addEventListener("DOMContentLoaded", async () => {
From Node
-
${fromNodeLabel}
+
${fromNodeLabel}
To Node
${ p.to_node_id == 4294967295 ? `All` - : `${toNodeLabel}` + : `${toNodeLabel}` }
@@ -409,7 +409,7 @@ document.addEventListener("DOMContentLoaded", async () => { marker.bindPopup(`
${node?.long_name || s.node_id}
- Node ID: ${s.node_id}
+ Node ID: ${s.node_id}
HW: ${node?.hw_model ?? "—"}
Channel: ${s.channel ?? "—"}

Signal
@@ -428,7 +428,7 @@ document.addEventListener("DOMContentLoaded", async () => { return ` - ${label} + ${label} ${s.rx_rssi ?? "—"} ${s.rx_snr ?? "—"} ${s.hop_start ?? "—"} → ${s.hop_limit ?? "—"} diff --git a/meshview/templates/new_node.html b/meshview/templates/node.html similarity index 99% rename from meshview/templates/new_node.html rename to meshview/templates/node.html index a122ab8..95f3311 100644 --- a/meshview/templates/new_node.html +++ b/meshview/templates/node.html @@ -323,7 +323,7 @@ async function loadNodeInfo(){ function nodeLink(id){ if (id === 4294967295) return `All`; if (id === 1) return `Direct to MQTT`; - return `${nodeMap[id] || id}`; + return `${nodeMap[id] || id}`; } function portLabel(p){ const names = { diff --git a/meshview/templates/nodelist.html b/meshview/templates/nodelist.html index bc81a09..65195d3 100644 --- a/meshview/templates/nodelist.html +++ b/meshview/templates/nodelist.html @@ -362,7 +362,7 @@ document.addEventListener("DOMContentLoaded", async function() { const row = document.createElement("tr"); row.innerHTML = ` ${node.short_name || "N/A"} - ${node.long_name || "N/A"} + ${node.long_name || "N/A"} ${node.hw_model || "N/A"} ${node.firmware || "N/A"} ${node.role || "N/A"} diff --git a/meshview/templates/top.html b/meshview/templates/top.html index 0a2d976..9531503 100644 --- a/meshview/templates/top.html +++ b/meshview/templates/top.html @@ -197,12 +197,12 @@ async function renderTable() { const rowRefs = filtered.map(n => { const tr = document.createElement("tr"); tr.addEventListener("click", () => { - window.location.href = `/new_node/${n.node_id}`; + window.location.href = `/node/${n.node_id}`; }); const tdLong = document.createElement("td"); const a = document.createElement("a"); - a.href = `/new_node/${n.node_id}`; + a.href = `/node/${n.node_id}`; a.textContent = n.long_name || n.node_id; a.className = "node-link"; a.addEventListener("click", e => e.stopPropagation()); diff --git a/meshview/web.py b/meshview/web.py index 6cd61c7..8e0bc09 100644 --- a/meshview/web.py +++ b/meshview/web.py @@ -193,6 +193,18 @@ async def index(request): starting_url = CONFIG["site"].get("starting", "/map") # default to /map if not set raise web.HTTPFound(location=starting_url) +# redirect for backwards compatibility +@routes.get("/packet_list/{packet_id}") +async def redirect_packet_list(request): + packet_id = request.match_info["packet_id"] + raise web.HTTPFound(location=f"/new_node/{packet_id}") + + +# redirect for backwards compatibility +@routes.get("/packet/{packet_id}") +async def redirect_packet_list(request): + packet_id = request.match_info["packet_id"] + raise web.HTTPFound(location=f"/new_packet/{packet_id}") @routes.get("/net") async def net(request): @@ -243,9 +255,9 @@ async def new_packet(request): ) -@routes.get("/new_node/{from_node_id}") +@routes.get("/node/{from_node_id}") async def firehose_node(request): - template = env.get_template("new_node.html") + template = env.get_template("node.html") return web.Response( text=template.render(), content_type="text/html",