diff --git a/src/data_monitor.py b/src/data_monitor.py index 29f1d9d..2fd4c71 100644 --- a/src/data_monitor.py +++ b/src/data_monitor.py @@ -15,10 +15,31 @@ _MONITOR_KEY = os.getenv("MONITOR_API_KEY", "") _cache: dict[str, tuple] = {} +@router.get("/monitor-incidents") +async def get_monitor_incidents(): + """Holt Liste aller Lagen vom Monitor.""" + cache_key = "incidents" + if cache_key in _cache and time.time() - _cache[cache_key][0] < 300: + return _cache[cache_key][1] + try: + async with httpx.AsyncClient(timeout=10) as client: + r = await client.get( + f"{_MONITOR_URL}/globe-incidents", + headers={"X-API-Key": _MONITOR_KEY}, + ) + r.raise_for_status() + data = r.json() + _cache[cache_key] = (time.time(), data) + return data + except Exception as e: + logger.warning(f"Monitor incidents Fehler: {e}") + return [] + + @router.get("/monitor-feed") -async def get_monitor_feed(incident_id: int = Query(45)): +async def get_monitor_feed(incident_id: int = Query(None)): """Holt OSINT-Daten vom AegisSight Monitor.""" - cache_key = f"monitor:{incident_id}" + cache_key = f"monitor:{incident_id or 0}" if cache_key in _cache and time.time() - _cache[cache_key][0] < 120: return _cache[cache_key][1] diff --git a/static/css/globe.css b/static/css/globe.css index 9c15d06..a79d767 100644 --- a/static/css/globe.css +++ b/static/css/globe.css @@ -412,3 +412,24 @@ html, body { height: 100%; overflow: hidden; background: var(--bg-primary); colo font-size: 11px; color: var(--text-dim); } + + +/* === Lage-Selector === */ +.header-lage { display: flex; align-items: center; } +.lage-select { + background: rgba(255,255,255,0.05); + border: 1px solid var(--border); + border-radius: 4px; + color: var(--accent); + font-family: var(--font-mono); + font-size: 11px; + padding: 4px 8px; + cursor: pointer; + max-width: 300px; + outline: none; +} +.lage-select:hover { border-color: var(--accent); } +.lage-select option { + background: var(--bg-primary); + color: var(--text); +} diff --git a/static/index.html b/static/index.html index 6185aa2..606b06d 100644 --- a/static/index.html +++ b/static/index.html @@ -34,7 +34,7 @@ AegisSight Globe -
+