feat(map): self-hosted MapLibre GL + PMTiles vector map
Replace Leaflet + OSM raster tiles with MapLibre GL JS + PMTiles: - Full continental US vector tiles (8GB PMTiles, zoom 0-14 with overzoom) - Dark theme via @protomaps/basemaps (official supported path) - Clustered device markers with status colors (green/yellow/red) - Popup cards show CPU, memory, wireless client count + avg signal - Font glyphs proxied through nginx, sprites served locally - Zero third-party requests from the browser - Fleet summary SQL now includes wireless client count and avg signal via LEFT JOIN LATERAL on wireless_links Also removes alert toast spam and fixes map container height. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -360,9 +360,16 @@ _FLEET_SUMMARY_SQL = """
|
||||
d.id, d.hostname, d.ip_address, d.status, d.model, d.last_seen,
|
||||
d.uptime_seconds, d.last_cpu_load, d.last_memory_used_pct,
|
||||
d.latitude, d.longitude,
|
||||
d.tenant_id, t.name AS tenant_name
|
||||
d.tenant_id, t.name AS tenant_name,
|
||||
wl.client_count, wl.avg_signal
|
||||
FROM devices d
|
||||
JOIN tenants t ON d.tenant_id = t.id
|
||||
LEFT JOIN LATERAL (
|
||||
SELECT count(*)::int AS client_count,
|
||||
avg(signal_strength)::int AS avg_signal
|
||||
FROM wireless_links
|
||||
WHERE ap_device_id = d.id AND state IN ('active', 'discovered')
|
||||
) wl ON true
|
||||
ORDER BY d.hostname
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user