{% extends "meta.html" %}
{% block title %}
<title>安全设置 - {{cfg("sr.ht", "site-name")}} meta</title>
{% endblock %}
{% block content %}
<div class="row">
<div class="col-md-12 event-list">
<div class="event">
<h3>两步验证</h3>
<p>
两步验证通过在登录时要求额外的验证步骤来增强账户安全性。
强烈建议启用此功能。
</p>
<h4>TOTP</h4>
{% if totp %}
<div>
<strong>已启用</strong>,启用时间:{{totp.created | date}}。
<form method="POST" action="/security/totp/disable" class="d-inline">
{{csrf_token()}}
<button class="btn btn-link" type="submit">
禁用 {{icon('caret-right')}}
</button>
</form>
</div>
{% else %}
<p>
<strong>未启用</strong>。启用后,每次登录时需要输入 TOTP 验证码。
</p>
<p>
<a href="/security/totp/enable">
<button class="btn btn-primary" type="submit">
启用 TOTP
{{icon('caret-right')}}
</button>
</a>
</p>
{% endif %}
</div>
<div class="event">
<h3>修改密码</h3>
<p>重置链接将发送到你的账户邮箱({{current_user.email}})。</p>
{% if allow_password_reset() %}
<form method="POST" action="/forgot">
{{csrf_token()}}
<input type="hidden" name="email" value="{{current_user.email}}" />
<button class="btn btn-default" type="submit">
发送重置链接 {{icon('caret-right')}}
</button>
</form>
{% else %}
无法重置密码,因为 {{cfg("sr.ht", "site-name")}} 的认证由其他服务管理。
{% endif %}
</div>
</div>
<section class="col-md-12">
<h3>账户活动日志</h3>
<table class="table">
<thead>
<tr>
<th>IP 地址</th>
<th>详情</th>
<th>时间</th>
</tr>
</thead>
<tbody>
{% for log in audit_log %}
<tr>
<td>{{log.ip_address}}</td>
<td>{{log.details or log.event_type}}</td>
<td>{{log.created|date}}</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="/security/audit/log" class="btn btn-default pull-right">
查看完整日志 {{icon("caret-right")}}
</a>
</section>
</div>
{% endblock %}