mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 14:50:00 -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:
@@ -26,6 +26,23 @@ const Meshtastic = (function() {
|
||||
initMap();
|
||||
loadPorts();
|
||||
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>` : ''}
|
||||
${telemetryHtml}
|
||||
${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>
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user