{% extends 'base.html' %}
{% block title %}登录历史{% endblock %}
{% block content %}
<h3 class="mb-3">最近登录历史</h3>
<table class="table table-striped">
  <thead><tr><th>时间</th><th>IP</th><th>User-Agent</th></tr></thead>
  <tbody>
    {% for r in records %}
    <tr>
      <td>{{ r.created_at }}</td>
      <td>{{ r.ip_address|default:"-" }}</td>
      <td>{{ r.user_agent }}</td>
    </tr>
    {% empty %}
    <tr><td colspan="3" class="text-muted">暂无记录</td></tr>
    {% endfor %}
  </tbody>
</table>
<a class="btn btn-outline-secondary" href="{% url 'accounts:profile' %}">返回用户中心</a>
{% endblock %}