~cytrogen/srht-deploy

srht-deploy/meta-custom/templates/security.html -rw-r--r-- 2.4 KiB
6b7b1351 — Cytrogen 修复 README 里的 Markdown 格式错误 9 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{% 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 %}