-
${node.name || 'Unknown'}
+ `;
}
diff --git a/public/nodes.js b/public/nodes.js
index ed190798..b7ee02ba 100644
--- a/public/nodes.js
+++ b/public/nodes.js
@@ -16,6 +16,7 @@
let sortBy = 'lastSeen';
let lastHeard = '';
let wsHandler = null;
+ let detailMap = null;
const ROLE_COLORS = { repeater: '#3b82f6', room: '#6b7280', companion: '#22c55e', sensor: '#f59e0b' };
const TABS = [
@@ -35,13 +36,14 @@
// Full-screen single node view
app.innerHTML = `
`;
+ document.getElementById('nodeBackBtn').addEventListener('click', () => { location.hash = '#/nodes'; });
loadFullNode(directNode);
// Escape to go back to nodes list
document.addEventListener('keydown', function nodesEsc(e) {
@@ -98,7 +100,7 @@
const statusLabel = statusAge < 3600000 ? '🟢 Active' : statusAge < 86400000 ? '🟡 Degraded' : '🔴 Silent';
body.innerHTML = `
- ${hasLoc ? `
` : ''}
+ ${hasLoc ? `
` : ''}
${escapeHtml(n.name || '(unnamed)')}
${n.role} ${statusLabel}
@@ -156,10 +158,11 @@
// Map
if (hasLoc) {
try {
- const map = L.map('nodeFullMap', { zoomControl: true, attributionControl: false }).setView([n.lat, n.lon], 13);
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map);
- L.marker([n.lat, n.lon]).addTo(map).bindPopup(n.name || n.public_key.slice(0, 12));
- setTimeout(() => map.invalidateSize(), 100);
+ if (detailMap) { detailMap.remove(); detailMap = null; }
+ detailMap = L.map('nodeFullMap', { zoomControl: true, attributionControl: false }).setView([n.lat, n.lon], 13);
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(detailMap);
+ L.marker([n.lat, n.lon]).addTo(detailMap).bindPopup(n.name || n.public_key.slice(0, 12));
+ setTimeout(() => detailMap.invalidateSize(), 100);
} catch {}
}
@@ -181,6 +184,7 @@
function destroy() {
if (wsHandler) offWS(wsHandler);
wsHandler = null;
+ if (detailMap) { detailMap.remove(); detailMap = null; }
nodes = [];
selectedKey = null;
}
@@ -239,12 +243,12 @@
- | Name |
+ Name |
Public Key |
Role |
Regions |
- Last Seen |
- Adverts |
+ Last Seen |
+ Adverts |
`;
@@ -353,7 +357,7 @@
panel.innerHTML = `
- ${hasLoc ? `
` : ''}
+ ${hasLoc ? `
` : ''}
${n.name || '(unnamed)'}
${n.role}
@@ -402,10 +406,11 @@
// Init map
if (hasLoc) {
try {
- const map = L.map('nodeMap', { zoomControl: false, attributionControl: false }).setView([n.lat, n.lon], 13);
- L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(map);
- L.marker([n.lat, n.lon]).addTo(map).bindPopup(n.name || n.public_key.slice(0, 12));
- setTimeout(() => map.invalidateSize(), 100);
+ if (detailMap) { detailMap.remove(); detailMap = null; }
+ detailMap = L.map('nodeMap', { zoomControl: false, attributionControl: false }).setView([n.lat, n.lon], 13);
+ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18 }).addTo(detailMap);
+ L.marker([n.lat, n.lon]).addTo(detailMap).bindPopup(n.name || n.public_key.slice(0, 12));
+ setTimeout(() => detailMap.invalidateSize(), 100);
} catch {}
}
diff --git a/public/style.css b/public/style.css
index 504b56af..1efdacd7 100644
--- a/public/style.css
+++ b/public/style.css
@@ -1274,3 +1274,45 @@ tr[data-hops]:hover { background: rgba(59,130,246,0.1); }
.panel-resize-handle { width: 12px !important; }
}
/* #21 — max-width applied via .ch-msg-bubble rule above */
+
+/* === Bug fixes: #16 collapsible controls, #53 detail map height === */
+.map-controls-toggle {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ z-index: 1001;
+ width: 36px;
+ height: 36px;
+ border-radius: 6px;
+ border: 1px solid var(--border, #333);
+ background: var(--bg-card, #1e1e1e);
+ color: var(--text, #fff);
+ font-size: 18px;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 2px 6px rgba(0,0,0,0.3);
+}
+.map-controls.collapsed {
+ display: none;
+}
+.node-detail-map {
+ height: 280px;
+ min-height: 200px;
+}
+@media (max-width: 640px) {
+ .node-detail-map {
+ height: 200px;
+ min-height: 160px;
+ }
+}
+.detail-back-btn {
+ background: none;
+ border: 1px solid var(--border, #333);
+ color: var(--text, #fff);
+ padding: 4px 12px;
+ border-radius: 6px;
+ cursor: pointer;
+ font-size: 16px;
+}