mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-08-08 09:52:44 +02:00
Remamed new_node to node. shorter and descriptive.
This commit is contained in:
@@ -134,7 +134,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
${escapeHtml(packet.channel || "")}
|
||||
</span>
|
||||
<span class="col-3 nodename">
|
||||
<a href="/new_node/${packet.from_node_id}">
|
||||
<a href="/node/${packet.from_node_id}">
|
||||
${escapeHtml((packet.long_name || "").trim() || `Node ${packet.from_node_id}`)}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -229,13 +229,13 @@ async function fetchUpdates() {
|
||||
for (const pkt of packets.reverse()) {
|
||||
const from = pkt.from_node_id === 4294967295
|
||||
? `<span class="to-mqtt">All</span>`
|
||||
: `<a href="/new_node/${pkt.from_node_id}" style="text-decoration:underline; color:inherit;">${nodeMap[pkt.from_node_id] || pkt.from_node_id}</a>`;
|
||||
: `<a href="/node/${pkt.from_node_id}" style="text-decoration:underline; color:inherit;">${nodeMap[pkt.from_node_id] || pkt.from_node_id}</a>`;
|
||||
|
||||
const to = pkt.to_node_id === 1
|
||||
? `<span class="to-mqtt">direct to MQTT</span>`
|
||||
: pkt.to_node_id === 4294967295
|
||||
? `<span class="to-mqtt">All</span>`
|
||||
: `<a href="/new_node/${pkt.to_node_id}" style="text-decoration:underline; color:inherit;">${nodeMap[pkt.to_node_id] || pkt.to_node_id}</a>`;
|
||||
: `<a href="/node/${pkt.to_node_id}" style="text-decoration:underline; color:inherit;">${nodeMap[pkt.to_node_id] || pkt.to_node_id}</a>`;
|
||||
|
||||
// Inline link next to port tag
|
||||
let inlineLinks = "";
|
||||
|
||||
@@ -205,7 +205,7 @@ function renderNodesOnMap(){
|
||||
marker.nodeId = node.key;
|
||||
marker.originalColor = color;
|
||||
markerById[node.key] = marker;
|
||||
const popup = `<b><a href="/new_node/${node.node_id}">${node.long_name}</a> (${node.short_name})</b><br>
|
||||
const popup = `<b><a href="/node/${node.node_id}">${node.long_name}</a> (${node.short_name})</b><br>
|
||||
<b>Channel:</b> ${node.channel}<br>
|
||||
<b>Model:</b> ${node.hw_model}<br>
|
||||
<b>Role:</b> ${node.role}<br>
|
||||
|
||||
@@ -219,13 +219,13 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
<div class="card-body">
|
||||
<dl>
|
||||
<dt>From Node</dt>
|
||||
<dd><a href="/new_node/${p.from_node_id}">${fromNodeLabel}</a></dd>
|
||||
<dd><a href="/node/${p.from_node_id}">${fromNodeLabel}</a></dd>
|
||||
|
||||
<dt>To Node</dt>
|
||||
<dd>${
|
||||
p.to_node_id == 4294967295
|
||||
? `<i>All</i>`
|
||||
: `<a href="/new_node/${p.to_node_id}">${toNodeLabel}</a>`
|
||||
: `<a href="/node/${p.to_node_id}">${toNodeLabel}</a>`
|
||||
}
|
||||
</dd>
|
||||
|
||||
@@ -409,7 +409,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
marker.bindPopup(`
|
||||
<div style="font-size:0.9em">
|
||||
<b>${node?.long_name || s.node_id}</b><br>
|
||||
Node ID: <a href="/new_node/${s.node_id}">${s.node_id}</a><br>
|
||||
Node ID: <a href="/node/${s.node_id}">${s.node_id}</a><br>
|
||||
HW: ${node?.hw_model ?? "—"}<br>
|
||||
Channel: ${s.channel ?? "—"}<br><br>
|
||||
<b>Signal</b><br>
|
||||
@@ -428,7 +428,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
|
||||
return `
|
||||
<tr>
|
||||
<td><a href="/new_node/${s.node_id}">${label}</a></td>
|
||||
<td><a href="/node/${s.node_id}">${label}</a></td>
|
||||
<td>${s.rx_rssi ?? "—"}</td>
|
||||
<td>${s.rx_snr ?? "—"}</td>
|
||||
<td>${s.hop_start ?? "—"} → ${s.hop_limit ?? "—"}</td>
|
||||
|
||||
@@ -323,7 +323,7 @@ async function loadNodeInfo(){
|
||||
function nodeLink(id){
|
||||
if (id === 4294967295) return `<span class="to-mqtt">All</span>`;
|
||||
if (id === 1) return `<span class="to-mqtt">Direct to MQTT</span>`;
|
||||
return `<a href="/new_node/${id}" style="text-decoration:underline; color:inherit;">${nodeMap[id] || id}</a>`;
|
||||
return `<a href="/node/${id}" style="text-decoration:underline; color:inherit;">${nodeMap[id] || id}</a>`;
|
||||
}
|
||||
function portLabel(p){
|
||||
const names = {
|
||||
@@ -362,7 +362,7 @@ document.addEventListener("DOMContentLoaded", async function() {
|
||||
const row = document.createElement("tr");
|
||||
row.innerHTML = `
|
||||
<td>${node.short_name || "N/A"}</td>
|
||||
<td><a href="/new_node/${node.node_id}">${node.long_name || "N/A"}</a></td>
|
||||
<td><a href="/node/${node.node_id}">${node.long_name || "N/A"}</a></td>
|
||||
<td>${node.hw_model || "N/A"}</td>
|
||||
<td>${node.firmware || "N/A"}</td>
|
||||
<td>${node.role || "N/A"}</td>
|
||||
|
||||
@@ -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());
|
||||
|
||||
+14
-2
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user