Přidáno:

nová stránka /portal/incidents s title CSBot Services Portal - Incidenty
menu Provoz -> Incidenty
aktivní incidenty a historie posledních 100 incidentů
barevné stavy: open červeně, resolved zeleně
karta Aktivní incidenty a seznam Poslední incidenty na přehledu
realtime napojení přes existující operations-live.js a snapshot
sekce Incidenty služby v detailu služby, posledních 20 incidentů
DB helpery pro service_incidents
migrace/indexy pro lokální prostředí, kde tabulka ještě neexistuje
This commit is contained in:
JiriUhlir
2026-06-01 13:38:06 +02:00
parent 994171be1a
commit 6aa5e69ee4
9 changed files with 374 additions and 9 deletions
+9
View File
@@ -1,5 +1,6 @@
from app.db.database import get_connection
from app.db.health import get_health_summary, get_problem_service_health
from app.db.incidents import count_open_incidents, get_open_incidents, get_recent_incidents
from app.db.migrations import run_migrations
from app.db.workers import is_worker_online
@@ -200,6 +201,9 @@ def get_operations_snapshot():
).fetchone()["count"]
health_summary = get_health_summary()
health_problems = get_problem_service_health()
open_incidents_count = count_open_incidents()
open_incidents = get_open_incidents(limit=10)
recent_incidents = get_recent_incidents(limit=10)
jobs_summary = con.execute(
"""
@@ -305,6 +309,11 @@ def get_operations_snapshot():
"unreachable": health_summary["unreachable"],
"problems": health_problems,
},
"incidents": {
"open": open_incidents_count,
"active": open_incidents,
"recent": recent_incidents,
},
"workers": {
"online": workers_online,
"offline": max(0, total_workers - workers_online),