feat: F1 — panel admin web (FastAPI, solo 127.0.0.1, X-Admin-Token, SSH tunnel)
This commit is contained in:
50
admin/templates/audit.html
Normal file
50
admin/templates/audit.html
Normal file
@@ -0,0 +1,50 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %} — Audit log{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Audit log ({{ total }} registros)</h1>
|
||||
|
||||
<form class="filter-bar" method="get" action="/audit">
|
||||
<input type="text" name="chat_id" value="{{ chat_id_filter }}" placeholder="Filtrar por chat_id">
|
||||
<button type="submit" class="btn btn-primary">Filtrar</button>
|
||||
{% if chat_id_filter %}<a href="/audit" class="btn">Limpiar</a>{% endif %}
|
||||
</form>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Timestamp (UTC)</th>
|
||||
<th>chat_id</th>
|
||||
<th>Evento</th>
|
||||
<th>Resultado</th>
|
||||
<th>Detalle</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in logs %}
|
||||
<tr>
|
||||
<td style="white-space:nowrap">{{ (entry.timestamp or "")[:19] }}</td>
|
||||
<td>
|
||||
{% if entry.chat_id %}
|
||||
<a href="/tenants/{{ entry.chat_id }}">{{ entry.chat_id }}</a>
|
||||
{% else %}—{% endif %}
|
||||
</td>
|
||||
<td><code>{{ entry.evento }}</code></td>
|
||||
<td>{{ entry.resultado or "—" }}</td>
|
||||
<td style="max-width:350px;word-break:break-all"><code>{{ entry.detalle_str }}</code></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr><td colspan="5" style="text-align:center;color:#999">Sin registros</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="pagination">
|
||||
{% if page > 1 %}
|
||||
<a href="/audit?chat_id={{ chat_id_filter }}&page={{ page - 1 }}" class="btn">← Más recientes</a>
|
||||
{% endif %}
|
||||
<span>Página {{ page }}</span>
|
||||
{% if has_more %}
|
||||
<a href="/audit?chat_id={{ chat_id_filter }}&page={{ page + 1 }}" class="btn">Más antiguos →</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user