Update web/templates/tools/login_attempts.html

This commit is contained in:
Joshua Laymon 2025-08-31 00:31:04 +00:00
parent fa5533faa6
commit 02e27760e9

View File

@ -1,38 +1,48 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}Login Attempts (7 days){% endblock %} {% block title %}Login Attempts (7 days){% endblock %}
{% block body_class %}themed-bg{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<h1 class="page-title">Security · Login Attempts (7 days)</h1> <h1 class="page-title">Security · Login Attempts (7 days)</h1>
<div class="card" style="padding:16px;"> <div class="card" style="padding:20px; width:100%;">
<p class="muted" style="margin:0 0 10px;">
Showing successful and failed logins from the last 7 days. Old records are automatically pruned. <p class="muted" style="margin:0 0 16px;">
Showing successful and failed logins from the last week. Records older than 7 days are automatically removed.
</p> </p>
<div class="table-wrap"> <div class="table-wrap" style="overflow-x:auto;">
<table class="table"> <table class="table" style="width:100%; border-collapse:separate; border-spacing:0 6px;">
<thead> <thead>
<tr> <tr>
<th style="width: 180px;">Date / Time</th> <th style="padding:10px 14px; text-align:left;">Date / Time</th>
<th>Username</th> <th style="padding:10px 14px; text-align:left;">Username</th>
<th>IP</th> <th style="padding:10px 14px; text-align:left;">IP</th>
<th>Status</th> <th style="padding:10px 14px; text-align:left;">Status</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for a in attempts %} {% for a in attempts %}
<tr> <tr style="background:#fff; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
<td>{{ a.timestamp|date:"Y-m-d H:i:s" }}</td> <td style="padding:10px 14px;">{{ a.timestamp|date:"Y-m-d H:i:s" }}</td>
<td>{{ a.username }}</td> <td style="padding:10px 14px;">{{ a.username }}</td>
<td>{{ a.ip_address|default:"—" }}</td> <td style="padding:10px 14px;">{{ 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> <td style="padding:10px 14px;">
{% if a.success %}
<span class="badge badge-success">Success</span>
{% else %}
<span class="badge badge-danger">Failed</span>
{% endif %}
</td>
</tr> </tr>
{% empty %} {% empty %}
<tr><td colspan="4" class="muted">No login attempts in the last 7 days.</td></tr> <tr><td colspan="4" class="muted" style="padding:12px 14px;">No login attempts in the last 7 days.</td></tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}