modified: web/blueprints/auth.py
modified: web/blueprints/group_admin.py modified: web/blueprints/site_admin.py modified: web/config.py modified: web/panel_db.py modified: web/templates/admin/audit_log.html
This commit is contained in:
@@ -4,7 +4,22 @@
|
||||
{% block content %}
|
||||
<div class="d-flex align-items-center justify-content-between mb-3">
|
||||
<h4 class="mb-0"><i class="bi bi-journal-text me-2"></i>Audit Log</h4>
|
||||
<span class="text-muted small">{{ total }} event{{ 's' if total != 1 }}</span>
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<span class="text-muted small">{{ total }} event{{ 's' if total != 1 }}</span>
|
||||
{% if retention_days > 0 %}
|
||||
<span class="badge bg-secondary" title="Entries older than {{ retention_days }} days are deleted automatically on startup">
|
||||
<i class="bi bi-clock-history me-1"></i>Retention: {{ retention_days }}d
|
||||
</span>
|
||||
{% endif %}
|
||||
<form method="post" action="{{ url_for('site_admin.audit_purge') }}"
|
||||
onsubmit="return confirm('Delete all audit entries older than {{ retention_days }} days?')">
|
||||
<input type="hidden" name="csrf_token" value="{{ session.get('csrf_token', '') }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-danger"
|
||||
{% if retention_days <= 0 %}disabled title="Retention disabled (AUDIT_LOG_RETENTION_DAYS=0)"{% endif %}>
|
||||
<i class="bi bi-trash3 me-1"></i>Purge now
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Filters -->
|
||||
@@ -75,25 +90,33 @@
|
||||
</td>
|
||||
<td>
|
||||
{% set action_class = {
|
||||
'user.login': 'badge bg-success',
|
||||
'user.login_failed': 'badge bg-danger',
|
||||
'admin.login': 'badge bg-warning text-dark',
|
||||
'admin.login_failed': 'badge bg-danger',
|
||||
'invite.created': 'badge bg-primary',
|
||||
'invite.accepted': 'badge bg-success',
|
||||
'invite.revoked': 'badge bg-secondary',
|
||||
'invite.resent': 'badge bg-info text-dark',
|
||||
'member.added': 'badge bg-primary',
|
||||
'member.removed': 'badge bg-danger',
|
||||
'member.role_changed': 'badge bg-warning text-dark',
|
||||
'member.updated': 'badge bg-warning text-dark',
|
||||
'group.created': 'badge bg-success',
|
||||
'group.updated': 'badge bg-secondary',
|
||||
'group.deleted': 'badge bg-danger',
|
||||
'user.updated': 'badge bg-secondary',
|
||||
'user.deleted': 'badge bg-danger',
|
||||
'mail.settings_saved': 'badge bg-info text-dark',
|
||||
'mail.settings_deleted':'badge bg-danger',
|
||||
'user.login': 'badge bg-success',
|
||||
'user.login_failed': 'badge bg-danger',
|
||||
'user.password_changed': 'badge bg-warning text-dark',
|
||||
'session.logout': 'badge bg-secondary',
|
||||
'admin.login': 'badge bg-warning text-dark',
|
||||
'admin.login_failed': 'badge bg-danger',
|
||||
'admin.view_users': 'badge bg-dark border border-secondary',
|
||||
'admin.view_group': 'badge bg-dark border border-secondary',
|
||||
'admin.view_group_members': 'badge bg-dark border border-secondary',
|
||||
'invite.created': 'badge bg-primary',
|
||||
'invite.accepted': 'badge bg-success',
|
||||
'invite.revoked': 'badge bg-secondary',
|
||||
'invite.resent': 'badge bg-info text-dark',
|
||||
'member.added': 'badge bg-primary',
|
||||
'member.removed': 'badge bg-danger',
|
||||
'member.role_changed': 'badge bg-warning text-dark',
|
||||
'member.updated': 'badge bg-warning text-dark',
|
||||
'group.created': 'badge bg-success',
|
||||
'group.updated': 'badge bg-secondary',
|
||||
'group.deleted': 'badge bg-danger',
|
||||
'db.credentials_changed': 'badge bg-warning text-dark',
|
||||
'db.credentials_deleted': 'badge bg-danger',
|
||||
'user.updated': 'badge bg-secondary',
|
||||
'user.deleted': 'badge bg-danger',
|
||||
'mail.settings_saved': 'badge bg-info text-dark',
|
||||
'mail.settings_deleted': 'badge bg-danger',
|
||||
'audit.purged': 'badge bg-danger',
|
||||
} %}
|
||||
<span class="{{ action_class.get(row.action, 'badge bg-secondary') }} font-monospace" style="font-size:.75em">
|
||||
{{ row.action }}
|
||||
|
||||
Reference in New Issue
Block a user