4 Commits

Author SHA1 Message Date
pablorevilla-meshtastic 0d52dfeac1 fixed pop up 2026-05-12 15:58:13 -07:00
pablorevilla-meshtastic 31744aace9 Merge branch 'master' of github.com:pablorevilla-meshtastic/meshview 2026-05-12 15:51:13 -07:00
pablorevilla-meshtastic a3ce0640ab update 2026-05-12 15:51:10 -07:00
Pablo Revilla 1ba64f8908 Merge branch 3.0.6 into master (#145)
* add world meshview tag

* small map change

* Add relay_node field to PacketSeen model and update template for display

* Add migration script to introduce relay_node column in packet_seen table

* Adapt PR 102 relay node display to packet page

* Added DB configuration and snapshot for basic detaisl

* update schemma

* fix ingestion error

* fixed the db and added more reporting

* 1

* Fix MQTT store bug.

* changes to reports

* more changes to report

* update latest list of instances

* Update protobuf

* remove file

* add channel to firehouse

* Add filter to firehose

* filter at chat.html

* remove duplicates from nodes in net.html

* add note bottom of page

* fixed issue reported on issue #143

---------

Co-authored-by: Paul Picazo <paul@picazo.com>
2026-05-08 16:20:56 -07:00
2 changed files with 19 additions and 29 deletions
View File
+19 -29
View File
@@ -235,6 +235,7 @@ function labelFor(key, fallback){
function buildNodePopup(node){ function buildNodePopup(node){
const labels = { const labels = {
channel: labelFor("channel_label", "Channel"), channel: labelFor("channel_label", "Channel"),
nodeId: labelFor("node_id", "Node ID"),
model: labelFor("model_label", "Model"), model: labelFor("model_label", "Model"),
role: labelFor("role_label", "Role"), role: labelFor("role_label", "Role"),
mqtt: labelFor("mqtt_gateway", "MQTT Gateway"), mqtt: labelFor("mqtt_gateway", "MQTT Gateway"),
@@ -243,13 +244,16 @@ function buildNodePopup(node){
yes: mapTranslations.yes || "Yes", yes: mapTranslations.yes || "Yes",
no: mapTranslations.no || "No" no: mapTranslations.no || "No"
}; };
const displayName = node.long_name || node.short_name || `Node ${node.node_id}`;
const shortName = node.short_name ? ` (${escapeHtml(node.short_name)})` : "";
return ` return `
<b><a href="/node/${node.node_id}">${node.long_name}</a> (${node.short_name})</b><br> <b><a href="/node/${node.node_id}">${escapeHtml(displayName)}</a>${shortName}</b><br>
<b>${labels.channel}</b> ${node.channel}<br> <b>${labels.nodeId}</b> ${node.node_id}<br>
<b>${labels.model}</b> ${node.hw_model}<br> <b>${labels.channel}</b> ${escapeHtml(node.channel || "N/A")}<br>
<b>${labels.role}</b> ${node.role}<br> <b>${labels.model}</b> ${escapeHtml(node.hw_model || "N/A")}<br>
<b>${labels.role}</b> ${escapeHtml(node.role || "N/A")}<br>
<b>${labels.mqtt}</b> ${node.is_mqtt_gateway ? labels.yes : labels.no}<br> <b>${labels.mqtt}</b> ${node.is_mqtt_gateway ? labels.yes : labels.no}<br>
${ ${
@@ -260,7 +264,7 @@ function buildNodePopup(node){
${ ${
node.firmware node.firmware
? `<b>${labels.firmware}</b> ${node.firmware}<br>` ? `<b>${labels.firmware}</b> ${escapeHtml(node.firmware)}<br>`
: "" : ""
} }
`; `;
@@ -468,34 +472,18 @@ function renderNodesOnMap(){
marker.nodeId = node.key; marker.nodeId = node.key;
marker.originalColor = color; marker.originalColor = color;
markerById[node.key] = marker; markerById[node.key] = marker;
marker.bindPopup(buildNodePopup(node), {
autoPan: true,
closeButton: true
});
const popup = ` marker.on('click', e => {
<a href="/node/${node.node_id}">${node.long_name}</a> (${node.short_name})<br> if(e.originalEvent){
L.DomEvent.stopPropagation(e.originalEvent);
<span data-translate-lang="channel_label"></span> ${node.channel}<br>
<span data-translate-lang="model_label"></span> ${node.hw_model}<br>
<span data-translate-lang="role_label"></span> ${node.role}<br>
<span data-translate-lang="mqtt_gateway"></span> ${
node.is_mqtt_gateway ? (mapTranslations.yes || "Yes") : (mapTranslations.no || "No")
}<br>
${
node.last_seen_us
? `<span data-translate-lang="last_seen"></span> ${timeAgoFromUs(node.last_seen_us)}<br>`
: ""
} }
${
node.firmware
? `<span data-translate-lang="firmware"></span> ${node.firmware}<br>`
: ""
}
`;
marker.on('click', () => {
onNodeClick(node);
marker.setPopupContent(buildNodePopup(node)); marker.setPopupContent(buildNodePopup(node));
marker.openPopup(); marker.openPopup();
onNodeClick(node);
}); });
}); });
@@ -615,6 +603,8 @@ async function onNodeClick(node){
} }
map.on('click', e=>{ map.on('click', e=>{
if(e.originalEvent.defaultPrevented) return;
if(!e.originalEvent.target.classList.contains('leaflet-interactive')){ if(!e.originalEvent.target.classList.contains('leaflet-interactive')){
edgeLayer.clearLayers(); edgeLayer.clearLayers();
selectedNodeId=null; selectedNodeId=null;