added first version of single ip page breakdiwn

This commit is contained in:
carnivuth
2026-02-22 21:53:18 +01:00
committed by Lorenzo Venerandi
parent 75722051d6
commit f7416518fe
3 changed files with 20 additions and 17 deletions

View File

@@ -40,6 +40,7 @@ async def dashboard_page(request: Request):
},
)
@router.get("/ip/{ip_address:path}")
async def ip_page(ip_address: str, request: Request):
db = get_db()
@@ -57,7 +58,7 @@ async def ip_page(ip_address: str, request: Request):
"request": request,
"dashboard_path": dashboard_path,
"stats": stats,
"ip_address": ip_address
"ip_address": ip_address,
},
)
else:
@@ -67,4 +68,3 @@ async def ip_page(ip_address: str, request: Request):
except Exception as e:
get_app_logger().error(f"Error fetching IP stats: {e}")
return JSONResponse(content={"error": str(e)})

View File

@@ -180,7 +180,7 @@ async def htmx_access_logs_by_ip(
):
db = get_db()
result = db.get_access_logs_paginated(
page=max(1, page),page_size=25, ip_filter=ip_filter
page=max(1, page), page_size=25, ip_filter=ip_filter
)
# Normalize pagination key (DB returns total_attackers, template expects total)