Add web/templates/tools/login_attempts.html

This commit is contained in:
Joshua Laymon 2025-08-31 00:27:00 +00:00
parent f1f83165f0
commit f7337aa904

View File

@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block title %}Login Attempts (7 days){% endblock %}
{% block content %}
<div class="container">
<h1 class="page-title">Security · Login Attempts (7 days)</h1>
<div class="card" style="padding:16px;">
<p class="muted" style="margin:0 0 10px;">
Showing successful and failed logins from the last 7 days. Old records are automatically pruned.
</p>
<div class="table-wrap">
<table class="table">
<thead>
<tr>
<th style="width: 180px;">Date / Time</th>
<th>Username</th>
<th>IP</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{% for a in attempts %}
<tr>
<td>{{ a.timestamp|date:"Y-m-d H:i:s" }}</td>
<td>{{ a.username }}</td>
<td>{{ a.ip_address|default:"—" }}</td>
<td>{% if a.success %}<span class="badge badge-success">Success</span>{% else %}<span class="badge badge-danger">Failed</span>{% endif %}</td>
</tr>
{% empty %}
<tr><td colspan="4" class="muted">No login attempts in the last 7 days.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}