| 1 |
{% extends "base.html" %} |
| 2 |
|
| 3 |
{% block title %}Admin: Scan Audit Log - Makenot.work{% endblock %} |
| 4 |
{% block body_attrs %} class="padded-page admin-page"{% endblock %} |
| 5 |
|
| 6 |
{% block content %} |
| 7 |
{% include "partials/site_header.html" %} |
| 8 |
|
| 9 |
<div class="container"> |
| 10 |
{% include "partials/admin_nav.html" %} |
| 11 |
|
| 12 |
<div class="admin-section-header"> |
| 13 |
<h1 class="page-title">Scan Audit Log</h1> |
| 14 |
<a href="/admin/uploads" class="text-sm">← Back to dashboard</a> |
| 15 |
</div> |
| 16 |
<p class="dimmed">Every admin action against the scan pipeline. Newest first.</p> |
| 17 |
|
| 18 |
<form method="get" action="/admin/uploads/audit" class="audit-filter-form"> |
| 19 |
<label> |
| 20 |
<span class="text-xs dimmed">Action</span> |
| 21 |
<select name="action"> |
| 22 |
<option value=""{% if filter_action.is_empty() %} selected{% endif %}>Any</option> |
| 23 |
<option value="promote"{% if filter_action == "promote" %} selected{% endif %}>promote</option> |
| 24 |
<option value="quarantine"{% if filter_action == "quarantine" %} selected{% endif %}>quarantine</option> |
| 25 |
<option value="rescan"{% if filter_action == "rescan" %} selected{% endif %}>rescan</option> |
| 26 |
<option value="bulk_promote"{% if filter_action == "bulk_promote" %} selected{% endif %}>bulk_promote</option> |
| 27 |
<option value="bulk_rescan"{% if filter_action == "bulk_rescan" %} selected{% endif %}>bulk_rescan</option> |
| 28 |
</select> |
| 29 |
</label> |
| 30 |
<label> |
| 31 |
<span class="text-xs dimmed">Admin</span> |
| 32 |
<input type="text" name="admin" value="{{ filter_admin }}" placeholder="username"> |
| 33 |
</label> |
| 34 |
<label> |
| 35 |
<span class="text-xs dimmed">Within</span> |
| 36 |
<select name="since_days"> |
| 37 |
<option value=""{% if filter_since_days.is_empty() %} selected{% endif %}>All time</option> |
| 38 |
<option value="1"{% if filter_since_days == "1" %} selected{% endif %}>last 24h</option> |
| 39 |
<option value="7"{% if filter_since_days == "7" %} selected{% endif %}>last 7d</option> |
| 40 |
<option value="30"{% if filter_since_days == "30" %} selected{% endif %}>last 30d</option> |
| 41 |
<option value="90"{% if filter_since_days == "90" %} selected{% endif %}>last 90d</option> |
| 42 |
</select> |
| 43 |
</label> |
| 44 |
<button type="submit" class="btn-secondary small">Filter</button> |
| 45 |
{% if !filter_action.is_empty() || !filter_admin.is_empty() || !filter_since_days.is_empty() %} |
| 46 |
<a href="/admin/uploads/audit" class="text-sm dimmed">Reset</a> |
| 47 |
{% endif %} |
| 48 |
</form> |
| 49 |
|
| 50 |
{% if entries.is_empty() %} |
| 51 |
<div class="text-center dimmed empty-state">No audit entries yet.</div> |
| 52 |
{% else %} |
| 53 |
<div class="scroll-x"> |
| 54 |
<table class="compact-table minw-700" aria-label="Scan audit log"> |
| 55 |
<thead> |
| 56 |
<tr> |
| 57 |
<th>When</th> |
| 58 |
<th>Admin</th> |
| 59 |
<th>Action</th> |
| 60 |
<th>Target</th> |
| 61 |
<th>Status</th> |
| 62 |
<th>Note</th> |
| 63 |
</tr> |
| 64 |
</thead> |
| 65 |
<tbody> |
| 66 |
{% for entry in entries %} |
| 67 |
<tr> |
| 68 |
<td class="text-sm nowrap">{{ entry.when }}</td> |
| 69 |
<td>{{ entry.admin_username }}</td> |
| 70 |
<td class="text-sm">{{ entry.action }}</td> |
| 71 |
<td class="text-xs"> |
| 72 |
<span class="dimmed">{{ entry.target_kind }}</span> |
| 73 |
<code>{{ entry.target_id }}</code> |
| 74 |
</td> |
| 75 |
<td class="text-sm"> |
| 76 |
{% if let Some(p) = entry.prev_status %}{{ p }}{% else %}—{% endif %} |
| 77 |
to |
| 78 |
{% if let Some(n) = entry.new_status %}{{ n }}{% else %}—{% endif %} |
| 79 |
</td> |
| 80 |
<td class="text-sm"> |
| 81 |
{% if let Some(note) = entry.note %}{{ note }}{% else %}<span class="dimmed">—</span>{% endif %} |
| 82 |
</td> |
| 83 |
</tr> |
| 84 |
{% endfor %} |
| 85 |
</tbody> |
| 86 |
</table> |
| 87 |
</div> |
| 88 |
{% endif %} |
| 89 |
</div> |
| 90 |
{% endblock %} |
| 91 |
|