feat: Add IP filtering to attack types pagination and detail views

This commit is contained in:
Lorenzo Venerandi
2026-03-01 18:01:19 +01:00
parent 6ec4e49d10
commit ed4fe0dcfb
4 changed files with 35 additions and 8 deletions

View File

@@ -241,10 +241,12 @@ async def htmx_attacks(
page: int = Query(1),
sort_by: str = Query("timestamp"),
sort_order: str = Query("desc"),
ip_filter: str = Query(None),
):
db = get_db()
result = db.get_attack_types_paginated(
page=max(1, page), page_size=5, sort_by=sort_by, sort_order=sort_order
page=max(1, page), page_size=5, sort_by=sort_by, sort_order=sort_order,
ip_filter=ip_filter,
)
# Transform attack data for template (join attack_types list, map id to log_id)
@@ -271,6 +273,7 @@ async def htmx_attacks(
"pagination": result["pagination"],
"sort_by": sort_by,
"sort_order": sort_order,
"ip_filter": ip_filter or "",
},
)