2026-02-17 13:09:01 +01:00
|
|
|
{# Recent Suspicious Activity - server-rendered on page load #}
|
|
|
|
|
<div class="table-container alert-section">
|
|
|
|
|
<h2>Recent Suspicious Activity</h2>
|
|
|
|
|
<table>
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>IP Address</th>
|
|
|
|
|
<th>Path</th>
|
|
|
|
|
<th>User-Agent</th>
|
|
|
|
|
<th>Time</th>
|
2026-02-28 18:04:26 +01:00
|
|
|
<th style="width: 40px;"></th>
|
2026-02-17 13:09:01 +01:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% for activity in suspicious_activities %}
|
|
|
|
|
<tr class="ip-row" data-ip="{{ activity.ip | e }}">
|
|
|
|
|
<td class="ip-clickable"
|
|
|
|
|
hx-get="{{ dashboard_path }}/htmx/ip-detail/{{ activity.ip | e }}"
|
|
|
|
|
hx-target="next .ip-stats-row .ip-stats-dropdown"
|
|
|
|
|
hx-swap="innerHTML"
|
|
|
|
|
@click="toggleIpDetail($event)">
|
|
|
|
|
{{ activity.ip | e }}
|
|
|
|
|
</td>
|
|
|
|
|
<td>{{ activity.path | e }}</td>
|
|
|
|
|
<td style="word-break: break-all;">{{ (activity.user_agent | default(''))[:80] | e }}</td>
|
|
|
|
|
<td>{{ activity.timestamp | format_ts(time_only=True) }}</td>
|
2026-02-28 17:43:50 +01:00
|
|
|
<td>
|
|
|
|
|
<button class="inspect-btn" @click="openIpInsight('{{ activity.ip | e }}')" title="Inspect IP">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z"/></svg>
|
|
|
|
|
</button>
|
|
|
|
|
</td>
|
2026-02-17 13:09:01 +01:00
|
|
|
</tr>
|
|
|
|
|
<tr class="ip-stats-row" style="display: none;">
|
2026-02-28 17:43:50 +01:00
|
|
|
<td colspan="5" class="ip-stats-cell">
|
2026-02-17 13:09:01 +01:00
|
|
|
<div class="ip-stats-dropdown">
|
|
|
|
|
<div class="loading">Loading stats...</div>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
{% else %}
|
2026-02-28 18:43:09 +01:00
|
|
|
<tr><td colspan="4" class="empty-state">No suspicious activity detected</td></tr>
|
2026-02-17 13:09:01 +01:00
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|