Files
IT_Ticket_System/app/templates/admin/activity_logs.html
T
2026-03-25 11:37:46 -04:00

68 lines
3.0 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 %}Activity Logs{% endblock %}
{% block page_title %}Activity Logs{% endblock %}
{% block content %}
<div class="card">
<div class="card-header"><i class="bi bi-list-ul me-2"></i>System Activity Log</div>
<div class="card-body p-0">
<table class="table mb-0">
<thead>
<tr>
<th>Timestamp</th>
<th>Action</th>
<th>User</th>
<th>Entity</th>
<th>Details</th>
<th>IP Address</th>
</tr>
</thead>
<tbody>
{% for log in logs.items %}
<tr>
<td style="font-size:11px;color:var(--muted);font-family:'Space Mono',monospace;white-space:nowrap;">
{{ log.created_at.strftime('%Y-%m-%d %H:%M:%S') }}
</td>
<td>
<span class="mono" style="font-size:11px;
color:{% if 'create' in log.action %}var(--success){% elif 'delete' in log.action or 'deactivate' in log.action %}var(--danger){% elif 'update' in log.action or 'edit' in log.action or 'change' in log.action %}var(--warning){% elif 'login' in log.action %}var(--accent3){% else %}var(--muted){% endif %};">
{{ log.action }}
</span>
</td>
<td style="font-size:13px;">
{% if log.user %}{{ log.user.full_name }}<br><span style="font-size:11px;color:var(--muted);">{{ log.user.email }}</span>{% else %}<span style="color:var(--muted);">System</span>{% endif %}
</td>
<td style="font-size:12px;color:var(--muted);">
{{ log.entity_type or '—' }}{% if log.entity_id %} <span class="mono">#{{ log.entity_id }}</span>{% endif %}
</td>
<td style="font-size:12px;color:var(--muted);max-width:250px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
{{ log.details or '—' }}
</td>
<td style="font-size:11px;color:var(--muted);font-family:'Space Mono',monospace;">
{{ log.ip_address or '—' }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if logs.pages > 1 %}
<div class="d-flex justify-content-center py-3">
<nav><ul class="pagination mb-0">
{% if logs.has_prev %}
<li class="page-item"><a class="page-link" href="{{ url_for('admin.activity_logs', page=logs.prev_num) }}"> Prev</a></li>
{% endif %}
{% for p in logs.iter_pages(left_edge=1, right_edge=1, left_current=2, right_current=2) %}
{% if p %}<li class="page-item {% if p==logs.page %}active{% endif %}"><a class="page-link" href="{{ url_for('admin.activity_logs', page=p) }}">{{ p }}</a></li>
{% else %}<li class="page-item disabled"><span class="page-link"></span></li>{% endif %}
{% endfor %}
{% if logs.has_next %}
<li class="page-item"><a class="page-link" href="{{ url_for('admin.activity_logs', page=logs.next_num) }}">Next </a></li>
{% endif %}
</ul></nav>
</div>
{% endif %}
</div>
</div>
{% endblock %}