{% extends "base.html" %} {% load static %} {% block title %}Token管理 - AgomTradePro{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
入口说明: 管理控制台是管理员统一入口;当前页面只负责 Token 与 MCP 开关。审批、系统参数、日志与文档管理请回管理控制台切换。
{% if new_token_payload %}
Token 明文 - 用户: {{ new_token_payload.username }} - 名称: {{ new_token_payload.token_name }} - 级别: {{ new_token_payload.access_level_label }}
{{ new_token_payload.token }}
该展示受系统配置控制;管理员关闭后,后续不会再显示完整 Token。
{% endif %} {% if messages %} {% for message in messages %}
{{ message }}
{% endfor %} {% endif %}
系统默认 MCP/SDK:{% if system_settings.default_mcp_enabled %}开启{% else %}关闭{% endif %} ,Token 明文查看:{% if system_settings.allow_token_plaintext_view %}允许{% else %}关闭{% endif %}
{{ total_users }}
用户数
{{ with_token_count }}
已配置Token用户
{{ without_token_count }}
无Token用户
{{ total_token_count }}
有效Token总数
重置
{% for row in rows %} {% empty %} {% endfor %}
用户 邮箱 状态 MCP 有效 Token 创建新 Token
{{ row.user.username }} {% if row.user.is_superuser %} 管理员 {% endif %} {{ row.user.email|default:"-" }} {% if row.user.is_active %} 已激活 {% else %} 未激活 {% endif %}
{% if row.profile and row.profile.mcp_enabled %} 已开启 {% else %} 已关闭 {% endif %}
{% csrf_token %}
{% if row.tokens %}
{% for token in row.tokens %}
{{ token.name }}
{{ token.preview }} {{ token.get_access_level_display }} {{ token.created_at|date:"Y-m-d H:i" }} {% if token.created_by %}创建人: {{ token.created_by.username }}{% endif %}
{% csrf_token %}
{% endfor %}
{% csrf_token %}
{% else %} 暂无 {% endif %}
{% csrf_token %}
暂无用户数据
{% endblock %}