mirror of
https://github.com/hansjone/netx.git
synced 2026-10-10 22:03:22 +08:00
Remove legacy OClaw alarm WSS and fix key-alert rules table layout.
Key alerts now deliver only via the DSH hub; Modal Body no longer flex-shrinks the rules rows to empty. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
f937efa0f9
commit
0a4561f385
25 changed files with 36 additions and 729 deletions
|
|
@ -12,7 +12,6 @@ from sqlalchemy.orm import Session
|
|||
from .config import settings
|
||||
from .db import get_db
|
||||
from .dsh_alarm_hub import dsh_alarm_ws_loop, hub_status
|
||||
from .oclaw_alarm_forwarder import forwarder_status
|
||||
|
||||
router = APIRouter(tags=["health"])
|
||||
|
||||
|
|
@ -79,7 +78,7 @@ def health_ready(db: Session = Depends(get_db)) -> dict[str, Any]:
|
|||
|
||||
@router.get("/v1/integrations/status")
|
||||
def integrations_status(db: Session = Depends(get_db)) -> dict:
|
||||
"""netx API + DB + oclaw bridge status."""
|
||||
"""netx API + DB + DSH alarm hub status."""
|
||||
netx_api = {"status": "up"}
|
||||
|
||||
db_status: dict = {"status": "unknown"}
|
||||
|
|
@ -90,56 +89,8 @@ def integrations_status(db: Session = Depends(get_db)) -> dict:
|
|||
except Exception as exc:
|
||||
db_status = {"status": "down", "error": str(exc)[:240]}
|
||||
|
||||
oclaw_status: dict = {"status": "unknown"}
|
||||
fwd = forwarder_status()
|
||||
if not bool(fwd.get("enabled")):
|
||||
oclaw_status = {
|
||||
"status": "unknown",
|
||||
"mode": "ws",
|
||||
"enabled": False,
|
||||
"connected": False,
|
||||
"error_kind": "disabled",
|
||||
"error": "NETX_OCLAW_ALARM_WS_ENABLED=false or missing token/url",
|
||||
"forwarder": fwd,
|
||||
}
|
||||
elif bool(fwd.get("paused")):
|
||||
oclaw_status = {
|
||||
"status": "unknown",
|
||||
"mode": "ws",
|
||||
"enabled": True,
|
||||
"connected": False,
|
||||
"error_kind": "paused",
|
||||
"error": "oclaw_alarm_forwarder runtime task paused",
|
||||
"forwarder": fwd,
|
||||
}
|
||||
elif bool(fwd.get("connected")):
|
||||
oclaw_status = {
|
||||
"status": "up",
|
||||
"mode": "ws",
|
||||
"enabled": True,
|
||||
"connected": True,
|
||||
"queue_size": int(fwd.get("queue_size") or 0),
|
||||
"published_ok": int(fwd.get("published_ok") or 0),
|
||||
"published_fail": int(fwd.get("published_fail") or 0),
|
||||
"url": str(fwd.get("url") or ""),
|
||||
"forwarder": fwd,
|
||||
}
|
||||
else:
|
||||
oclaw_status = {
|
||||
"status": "down",
|
||||
"mode": "ws",
|
||||
"enabled": True,
|
||||
"connected": False,
|
||||
"error_kind": "ws_disconnected",
|
||||
"error": "oclaw netx-bridge WebSocket not connected",
|
||||
"queue_size": int(fwd.get("queue_size") or 0),
|
||||
"url": str(fwd.get("url") or ""),
|
||||
"forwarder": fwd,
|
||||
}
|
||||
|
||||
return {
|
||||
"netx_api": netx_api,
|
||||
"db": db_status,
|
||||
"oclaw_bridge": oclaw_status,
|
||||
"dsh_alarm_hub": hub_status(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue