From 6b195a493de3528144981363bcec07d92134b09b Mon Sep 17 00:00:00 2001 From: Stream Date: Sun, 19 Apr 2026 18:50:01 +0300 Subject: [PATCH] auto-sync: 2026-04-19 18:50:01 --- tasks/flightradar24/frontend/main.py | 30 ++++ .../flightradar24/frontend/static/index.html | 3 + .../frontend/static/monitoring.html | 169 ++++++++++++++++++ tasks/flightradar24/monitoring/main.py | 52 ++++++ 4 files changed, 254 insertions(+) create mode 100644 tasks/flightradar24/frontend/static/monitoring.html diff --git a/tasks/flightradar24/frontend/main.py b/tasks/flightradar24/frontend/main.py index 21edc95..d421ac9 100644 --- a/tasks/flightradar24/frontend/main.py +++ b/tasks/flightradar24/frontend/main.py @@ -330,6 +330,36 @@ def aircraft_detail(icao24: str): return err(str(e)) +@app.get("/monitoring") +def monitoring_page(): + return send_from_directory("/app/static", "monitoring.html") + + +@app.get("/api/monitoring/status") +def monitoring_status(): + """Return latest monitoring metrics + last 20 rows history.""" + try: + latest = query_one( + """ + SELECT id, collected_at, disk_pct, db_size_mb, capture_lag_sec, throughput_5min + FROM fr24.monitoring_metrics + ORDER BY id DESC + LIMIT 1 + """ + ) + history = query( + """ + SELECT id, collected_at, disk_pct, db_size_mb, capture_lag_sec, throughput_5min + FROM fr24.monitoring_metrics + ORDER BY id DESC + LIMIT 20 + """ + ) + return ok({"latest": latest, "history": history}) + except Exception as e: + return err(str(e)) + + @app.get("/api/tracks") def tracks(): """Track points as GeoJSON LineStrings, filtered by time and optional bbox.""" diff --git a/tasks/flightradar24/frontend/static/index.html b/tasks/flightradar24/frontend/static/index.html index 17c67b5..461bdb7 100644 --- a/tasks/flightradar24/frontend/static/index.html +++ b/tasks/flightradar24/frontend/static/index.html @@ -17,6 +17,8 @@ #hud h2 { font-size: 13px; color: #58a6ff; margin-bottom: 6px; } #hud .stat { font-size: 12px; color: #8b949e; } #hud .stat span { color: #c9d1d9; } + #hud a { font-size: 12px; color: #58a6ff; text-decoration: none; display: block; margin-top: 8px; } + #hud a:hover { text-decoration: underline; } #popup-box { position: fixed; bottom: 20px; right: 20px; z-index: 1000; background: rgba(13,17,23,0.92); border: 1px solid #30363d; @@ -38,6 +40,7 @@
Aircraft:
Updated:
+ 📊 Monitoring