This commit is contained in:
lichene 2025-10-23 20:48:02 +02:00
parent 8e9c0593fb
commit 8f56cbd5c8
4 changed files with 6 additions and 8 deletions

View file

@ -50,7 +50,7 @@
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script>
const OUR_COORDS = [37.7749, -122.4194];
const OUR_COORDS = [46.0660875,11.1501202];
const MAP_CENTER = [20, 0];
const MAP_ZOOM = 2;
@ -87,7 +87,7 @@
let simStartMs = 0, simEndMs = 0;
async function fetchConnections(service, start, end) {
let url = `http://localhost:8000/connections?`;
let url = `/connections?`;
if (service) url += `service=${encodeURIComponent(service)}&`;
if (start) url += `start=${new Date(start).toISOString()}&`;
if (end) url += `end=${new Date(end).toISOString()}&`;
@ -135,7 +135,7 @@
function createMarkerAndArc(conn, visibleTimeMs = 2500) {
const lat = conn.lat, lon = conn.lon;
const marker = L.circleMarker([lat, lon], { radius: 5, fillOpacity: 0.9 })
.bindPopup(`<b>IP:</b> ${conn.ip}<br><b>Service:</b> ${conn.path}<br><b>Time:</b> ${conn.timestamp}`)
.bindPopup(`<b>Service:</b> ${conn.path}<br><b>Time:</b> ${conn.timestamp}`)
.addTo(markersLayer);
const arcPoints = computeArcPoints(lat, lon, OUR_COORDS[0], OUR_COORDS[1], 48, 0.18);