File size: 4,490 Bytes
ce0719e
 
 
 
 
 
 
 
 
 
 
 
02a8414
ce0719e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
02a8414
 
ce0719e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4fb3744
ce0719e
4fb3744
ce0719e
 
 
 
 
 
 
02a8414
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ce0719e
4fb3744
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{% extends 'base.html' %}

{% block content %}
  <section class="hero-card admin-hero">
    <div>
      <p class="eyebrow">Admin Overview</p>
      <h2>{{ admin.display_name }},欢迎来到春日行动指挥台</h2>
      <p class="lead">你可以在这里维护用户、分组、活动任务和图片审核流程。</p>
    </div>
    <div class="hero-badges">
      <span class="pill">角色 {{ '超级管理员' if admin.role == 'superadmin' else '管理员' }}</span>
      <span class="pill">待审核 {{ stats.pending_count }} 项</span>
      <span class="pill">在线管理员 {{ stats.online_admin_count }}</span>
    </div>
  </section>

  <section class="stats-grid">
    <article class="glass-card stat-card">
      <span>用户总数</span>
      <strong>{{ stats.user_count }}</strong>
    </article>
    <article class="glass-card stat-card">
      <span>小组数量</span>
      <strong>{{ stats.group_count }}</strong>
    </article>
    <article class="glass-card stat-card">
      <span>活动数量</span>
      <strong>{{ stats.activity_count }}</strong>
    </article>
    <article class="glass-card stat-card">
      <span>在线用户</span>
      <strong>{{ stats.online_user_count }}</strong>
    </article>
  </section>

  <section class="two-column-layout">
    <article class="glass-card quick-panel">
      <div class="section-head">
        <div>
          <p class="eyebrow">Quick Links</p>
          <h3>常用入口</h3>
        </div>
      </div>
      <div class="action-grid">
        <a class="btn btn-secondary" href="/admin/users">录入用户</a>
        <a class="btn btn-secondary" href="/admin/groups">管理小组</a>
        <a class="btn btn-secondary" href="/admin/activities">发布活动</a>
        <a class="btn btn-primary" href="/admin/reviews">进入审核中心</a>
      </div>
    </article>

    <article class="glass-card quick-panel">
      <div class="section-head">
        <div>
          <p class="eyebrow">Recent Activities</p>
          <h3>最近创建的活动</h3>
        </div>
      </div>
      <div class="stack-list">
        {% for activity in recent_activities %}
          <div class="stack-item">
            <div>
              <strong>{{ activity.title }}</strong>
              <p class="muted">{{ activity.tasks|length }} 个任务 · {{ activity.start_at|datetime_local }}</p>
              <p class="muted">{{ '用户端可见' if activity.is_visible else '用户端隐藏' }} · {{ '排行榜可见' if activity.leaderboard_visible else '排行榜隐藏' }}</p>
            </div>
            <span class="status-badge {% if activity.is_visible %}status-approved{% else %}status-rejected{% endif %}">{{ '活动可见' if activity.is_visible else '活动隐藏' }}</span>
          </div>
        {% else %}
          <p class="muted">还没有发布活动。</p>
        {% endfor %}
      </div>
    </article>
  </section>

  {% if online_overview %}
    <section class="page-grid admin-page-grid">
      <article class="glass-card table-panel">
        <div class="section-head">
          <div>
            <p class="eyebrow">Presence</p>
            <h3>管理员在线状态</h3>
          </div>
        </div>
        <div class="stack-list">
          {% for item in online_overview.admins %}
            <div class="stack-item">
              <strong>{{ item.name }}</strong>
              <span class="status-badge {% if item.is_online %}status-approved{% else %}status-rejected{% endif %}">
                {{ '在线' if item.is_online else '离线' }} · {{ item.last_seen_at }}
              </span>
            </div>
          {% endfor %}
        </div>
      </article>

      <article class="glass-card table-panel">
        <div class="section-head">
          <div>
            <p class="eyebrow">Presence</p>
            <h3>用户在线状态</h3>
          </div>
        </div>
        <div class="stack-list">
          {% for item in online_overview.users[:18] %}
            <div class="stack-item">
              <strong>{{ item.name }}</strong>
              <span class="status-badge {% if item.is_online %}status-approved{% else %}status-rejected{% endif %}">
                {{ '在线' if item.is_online else '离线' }} · {{ item.last_seen_at }}
              </span>
            </div>
          {% else %}
            <p class="muted">暂无用户。</p>
          {% endfor %}
        </div>
      </article>
    </section>
  {% endif %}
{% endblock %}