Skip to content

Commit 80ed5fa

Browse files
committed
fix(dashboard): use Optional for python 3.9 compatibility
1 parent fedcc61 commit 80ed5fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deploy/dashboard/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import sys
2424
from pathlib import Path
2525

26+
from typing import Optional
2627
from fastapi import FastAPI, Request
2728
from fastapi.responses import HTMLResponse, JSONResponse
2829
from fastapi.staticfiles import StaticFiles
@@ -93,8 +94,10 @@ def _parse_log_lines(max_lines: int = 200) -> list[dict]:
9394

9495
@app.get("/api/alerts")
9596
async def get_alerts(
96-
severity: str | None = None,
97-
since_hours: float | None = None,
97+
limit: int = 50,
98+
severity: Optional[str] = None,
99+
rule_id: Optional[str] = None,
100+
since_hours: Optional[float] = None,
98101
):
99102
"""Return recent blocked actions, optionally filtered by severity and time."""
100103
import datetime

0 commit comments

Comments
 (0)