mirror of
https://github.com/smittix/intercept.git
synced 2026-07-26 01:38:10 -07:00
fix: Meshtastic traceroute button and dark mode maps
- Fix traceroute button in Meshtastic popups using event delegation instead of inline onclick handlers (more reliable with Leaflet) - Update all maps to use dark CARTO tiles for consistency: - ADS-B dashboard radar map - AIS dashboard vessel map - Satellite dashboard ground map - APRS map - Satellite ground track map in main UI - Change settings manager default tile provider to cartodb_dark Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ const Settings = {
|
|||||||
'offline.enabled': false,
|
'offline.enabled': false,
|
||||||
'offline.assets_source': 'cdn',
|
'offline.assets_source': 'cdn',
|
||||||
'offline.fonts_source': 'cdn',
|
'offline.fonts_source': 'cdn',
|
||||||
'offline.tile_provider': 'openstreetmap',
|
'offline.tile_provider': 'cartodb_dark',
|
||||||
'offline.tile_server_url': ''
|
'offline.tile_server_url': ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,23 @@ const Meshtastic = (function() {
|
|||||||
initMap();
|
initMap();
|
||||||
loadPorts();
|
loadPorts();
|
||||||
checkStatus();
|
checkStatus();
|
||||||
|
setupEventDelegation();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setup event delegation for dynamically created elements
|
||||||
|
*/
|
||||||
|
function setupEventDelegation() {
|
||||||
|
// Handle traceroute button clicks in Leaflet popups
|
||||||
|
document.addEventListener('click', function(e) {
|
||||||
|
const tracerouteBtn = e.target.closest('.mesh-traceroute-btn');
|
||||||
|
if (tracerouteBtn) {
|
||||||
|
const nodeId = tracerouteBtn.dataset.nodeId;
|
||||||
|
if (nodeId) {
|
||||||
|
sendTraceroute(nodeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -636,7 +653,7 @@ const Meshtastic = (function() {
|
|||||||
${node.last_heard ? `<span style="color: var(--text-dim);">Last heard:</span> ${new Date(node.last_heard).toLocaleTimeString()}<br>` : ''}
|
${node.last_heard ? `<span style="color: var(--text-dim);">Last heard:</span> ${new Date(node.last_heard).toLocaleTimeString()}<br>` : ''}
|
||||||
${telemetryHtml}
|
${telemetryHtml}
|
||||||
${envHtml}
|
${envHtml}
|
||||||
${!isLocal ? `<button class="mesh-traceroute-btn" onclick="Meshtastic.sendTraceroute('${nodeId}')">Traceroute</button>` : ''}
|
${!isLocal ? `<button class="mesh-traceroute-btn" data-node-id="${nodeId}">Traceroute</button>` : ''}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -2340,8 +2340,9 @@ sudo make install</code>
|
|||||||
maxZoom: 15
|
maxZoom: 15
|
||||||
});
|
});
|
||||||
|
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
|
||||||
attribution: '© OpenStreetMap contributors'
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||||
|
maxZoom: 19
|
||||||
}).addTo(radarMap);
|
}).addTo(radarMap);
|
||||||
|
|
||||||
// Draw range rings after map is ready
|
// Draw range rings after map is ready
|
||||||
|
|||||||
@@ -390,9 +390,9 @@
|
|||||||
zoomControl: true
|
zoomControl: true
|
||||||
});
|
});
|
||||||
|
|
||||||
// OpenStreetMap tile layer
|
// Dark themed map tiles
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
|
||||||
attribution: '© OpenStreetMap contributors',
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
}).addTo(vesselMap);
|
}).addTo(vesselMap);
|
||||||
|
|
||||||
|
|||||||
@@ -7591,9 +7591,9 @@
|
|||||||
|
|
||||||
aprsMap = L.map('aprsMap').setView([initialLat, initialLon], initialZoom);
|
aprsMap = L.map('aprsMap').setView([initialLat, initialLon], initialZoom);
|
||||||
|
|
||||||
// OpenStreetMap with roads - better for APRS station tracking
|
// Dark themed map tiles
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
|
||||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
}).addTo(aprsMap);
|
}).addTo(aprsMap);
|
||||||
|
|
||||||
@@ -8495,9 +8495,9 @@
|
|||||||
attributionControl: false
|
attributionControl: false
|
||||||
});
|
});
|
||||||
|
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
|
||||||
maxZoom: 19,
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||||
attribution: '© OpenStreetMap contributors'
|
maxZoom: 19
|
||||||
}).addTo(groundTrackMap);
|
}).addTo(groundTrackMap);
|
||||||
|
|
||||||
// Add observer marker
|
// Add observer marker
|
||||||
|
|||||||
@@ -416,8 +416,9 @@
|
|||||||
worldCopyJump: true
|
worldCopyJump: true
|
||||||
});
|
});
|
||||||
|
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png', {
|
||||||
attribution: '© OpenStreetMap contributors'
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OSM</a> © <a href="https://carto.com/">CARTO</a>',
|
||||||
|
maxZoom: 19
|
||||||
}).addTo(groundMap);
|
}).addTo(groundMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user