{% extends 'base/layout.html' %}

{% block title %}UniFi Sync Audit Log{% endblock %}

{% block content %}
<div class="card">
  <div class="card-header"><strong>Audit Log</strong></div>
  <div class="table-responsive">
    <table class="table table-hover mb-0">
      <thead>
        <tr><th>Timestamp</th><th>Action</th><th>Status</th><th>Actor</th><th>Target</th><th>Message</th></tr>
      </thead>
      <tbody>
      {% for e in events %}
        <tr>
          <td>{{ e.created }}</td>
          <td>{{ e.action }}</td>
          <td>{{ e.status }}</td>
          <td>{{ e.actor|default:'system' }}</td>
          <td>{{ e.target|default:'-' }}</td>
          <td>{{ e.message }}</td>
        </tr>
      {% empty %}
        <tr><td colspan="6" class="text-muted">No events yet.</td></tr>
      {% endfor %}
      </tbody>
    </table>
  </div>
</div>
{% endblock %}
