Files
Alert-Hub-System/app/templates/backoffice/audit_log.html
T
2026-09-13 19:59:54 +01:00

52 lines
2.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Audit log{% endblock %}
{% block content %}
<div class="section-head">
<div>
<span class="section-tag">// console audit log</span>
<h1>Audit log</h1>
<p class="lead">Sign-ins, configuration changes, and alert mutations. Most-recent first.</p>
</div>
<div class="log-actions">
<a href="{{ url_for('backoffice.audit_log_export') }}" class="btn btn-ghost">⬇ Export CSV</a>
<form method="post" action="{{ url_for('backoffice.audit_log_email') }}" class="log-email-form" novalidate>
{{ log_email_form.csrf_token }}
{{ log_email_form.log_recipient(placeholder="destination@example.com") }}
{{ log_email_form.submit(class_="btn btn-primary") }}
</form>
</div>
</div>
<table class="table">
<thead>
<tr><th>Timestamp (UTC)</th><th>User</th><th>Action</th><th>Details</th><th>IP</th></tr>
</thead>
<tbody>
{% for e in pagination.items %}
<tr>
<td class="mono dim" style="font-size: .82rem; white-space: nowrap;">{{ e.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}</td>
<td>{{ e.username or '—' }}</td>
<td><span class="mono" style="color: var(--accent);">{{ e.action }}</span></td>
<td class="dim">{{ e.details or '' }}</td>
<td class="mono dim">{{ e.ip_address or '' }}</td>
</tr>
{% else %}
<tr><td colspan="5" class="dim" style="text-align: center; padding: 32px;">No audit entries yet.</td></tr>
{% endfor %}
</tbody>
</table>
{% if pagination.pages > 1 %}
<div class="pagination">
{% if pagination.has_prev %}<a href="{{ url_for('backoffice.audit_log', page=pagination.prev_num) }}"> prev</a>{% endif %}
{% for p in pagination.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
{% if p %}
{% if p == pagination.page %}<span class="current">{{ p }}</span>
{% else %}<a href="{{ url_for('backoffice.audit_log', page=p) }}">{{ p }}</a>{% endif %}
{% else %}<span></span>{% endif %}
{% endfor %}
{% if pagination.has_next %}<a href="{{ url_for('backoffice.audit_log', page=pagination.next_num) }}">next </a>{% endif %}
</div>
{% endif %}
{% endblock %}