feat: update suspicious activity display to show last 10 requests and improve database filtering
This commit is contained in:
@@ -1767,7 +1767,11 @@ class DatabaseManager:
|
|||||||
|
|
||||||
# Filter out local/private IPs and server IP, then sort
|
# Filter out local/private IPs and server IP, then sort
|
||||||
filtered = [
|
filtered = [
|
||||||
{"ip": row.ip, "count": row.count, "category": row.category or "unknown"}
|
{
|
||||||
|
"ip": row.ip,
|
||||||
|
"count": row.count,
|
||||||
|
"category": row.category or "unknown",
|
||||||
|
}
|
||||||
for row in results
|
for row in results
|
||||||
if is_valid_public_ip(row.ip, server_ip)
|
if is_valid_public_ip(row.ip, server_ip)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ async def dashboard_page(request: Request):
|
|||||||
|
|
||||||
# Get initial data for server-rendered sections
|
# Get initial data for server-rendered sections
|
||||||
stats = db.get_dashboard_counts()
|
stats = db.get_dashboard_counts()
|
||||||
suspicious = db.get_recent_suspicious(limit=20)
|
suspicious = db.get_recent_suspicious(limit=10)
|
||||||
|
|
||||||
# Get credential count for the stats card
|
# Get credential count for the stats card
|
||||||
cred_result = db.get_credentials_paginated(page=1, page_size=1)
|
cred_result = db.get_credentials_paginated(page=1, page_size=1)
|
||||||
|
|||||||
@@ -46,6 +46,9 @@
|
|||||||
{# Map section #}
|
{# Map section #}
|
||||||
{% include "dashboard/partials/map_section.html" %}
|
{% include "dashboard/partials/map_section.html" %}
|
||||||
|
|
||||||
|
{# Suspicious Activity - server-rendered (last 10 requests) #}
|
||||||
|
{% include "dashboard/partials/suspicious_table.html" %}
|
||||||
|
|
||||||
{# Top IPs + Top User-Agents side by side #}
|
{# Top IPs + Top User-Agents side by side #}
|
||||||
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
||||||
<div class="table-container" style="flex: 1; min-width: 300px;">
|
<div class="table-container" style="flex: 1; min-width: 300px;">
|
||||||
@@ -78,9 +81,6 @@
|
|||||||
<div class="htmx-indicator">Loading...</div>
|
<div class="htmx-indicator">Loading...</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# Suspicious Activity - server-rendered #}
|
|
||||||
{% include "dashboard/partials/suspicious_table.html" %}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# ==================== ATTACKS TAB ==================== #}
|
{# ==================== ATTACKS TAB ==================== #}
|
||||||
|
|||||||
Reference in New Issue
Block a user