Files
Illustrations/web/templates/tools/login_attempts.html
T

64 lines
2.4 KiB
HTML

{% extends "base.html" %}
{% block title %}Login Attempts (7 days){% endblock %}
{% block body_class %}themed-bg{% endblock %}
{% block content %}
<div class="container">
<h1 class="page-title">Security · Login Attempts for the last 7 Days</h1>
<div class="card" style="padding:20px; width:100%;">
<div class="table-wrap" style="overflow-x:auto;">
<table class="table" style="width:100%; border-collapse:separate; border-spacing:0 6px;">
<thead>
<tr>
<th style="padding:10px 14px; text-align:left;">Date / Time</th>
<th style="padding:10px 14px; text-align:left;">Username</th>
<th style="padding:10px 14px; text-align:left;">IP</th>
<th style="padding:10px 14px; text-align:left;">Status</th>
</tr>
</thead>
<tbody>
{% for a in attempts %}
<tr style="background:#fff; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
<td style="padding:10px 14px;">{{ a.timestamp|date:"Y-m-d H:i:s" }}</td>
<td style="padding:10px 14px;">{{ a.username }}</td>
<td style="padding:10px 14px;">
{% if a.ip_address %}
<a href="http://{{ a.ip_address }}" target="_blank"
style="display:inline-block; padding:4px 10px; border-radius:999px;
background:#e5e7eb; color:#111; text-decoration:none; font-size:0.85em;">
{{ a.ip_address }}
</a>
{% else %}
{% endif %}
</td>
<td style="padding:10px 14px;">
{% if a.success %}
<span style="display:inline-block; padding:4px 12px; border-radius:999px;
background:#22c55e; color:#fff; font-size:0.85em;">
Success
</span>
{% else %}
<span style="display:inline-block; padding:4px 12px; border-radius:999px;
background:#ef4444; color:#fff; font-size:0.85em;">
Failed
</span>
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="4" class="muted" style="padding:12px 14px;">
No login attempts in the last 7 days.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}