Files
Echo-Tavern/templates/admin.html
T
leeexinandClaude Opus 4.6 ae478755be feat(auth,admin): add LinuxDO OAuth login and admin settings
Implement LinuxDO OAuth authorization-code login flow with state validation and local account binding, and add admin APIs/UI to manage OAuth runtime settings with URL validation and secret masking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 13:14:46 +08:00

76 lines
3.0 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>后台管理 - Echo Tavern</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}" />
</head>
<body class="admin-page" data-user='{{ user | tojson | safe if user else "null" }}' data-theme="{{ user.theme if user else 'dopamine' }}">
<header class="lobby-topbar">
<div class="brand-block">
<h1>后台管理</h1>
<p>管理员控制台:用户权限、房间状态、游戏卡治理</p>
</div>
<div class="top-actions">
<span class="user-badge {% if user.avatar_url %}has-avatar{% endif %}" style="--avatar-color: {{ user.avatar_color }}; --avatar-url: url('{{ user.avatar_url }}')">
<i></i>{{ user.username }}(管理员)
</span>
<a class="link-btn" href="{{ url_for('index') }}">返回大厅</a>
</div>
</header>
<main class="admin-grid">
<section class="card admin-panel">
<h2>Linux DO OAuth 配置</h2>
<form id="linuxdo-oauth-form">
<label for="linuxdo-enabled">启用 OAuth</label>
<select id="linuxdo-enabled" name="enabled">
<option value="false">关闭</option>
<option value="true">开启</option>
</select>
<label for="linuxdo-client-id">Client ID</label>
<input id="linuxdo-client-id" name="client_id" placeholder="请输入 client_id" />
<label for="linuxdo-client-secret">Client Secret</label>
<input id="linuxdo-client-secret" name="client_secret" type="password" placeholder="留空则保持不变" />
<label for="linuxdo-authorize-url">Authorize URL</label>
<input id="linuxdo-authorize-url" name="authorize_url" placeholder="https://connect.linux.do/oauth2/authorize" />
<label for="linuxdo-token-url">Token URL</label>
<input id="linuxdo-token-url" name="token_url" placeholder="https://connect.linux.do/oauth2/token" />
<label for="linuxdo-userinfo-url">Userinfo URL</label>
<input id="linuxdo-userinfo-url" name="userinfo_url" placeholder="https://connect.linux.do/api/user" />
<label for="linuxdo-scope">Scope</label>
<input id="linuxdo-scope" name="scope" placeholder="read" />
<button id="linuxdo-save" type="submit" class="secondary-btn">保存 OAuth 配置</button>
</form>
</section>
<section class="card admin-panel">
<h2>用户权限管理</h2>
<div id="users-table" class="table-wrap"></div>
</section>
<section class="card admin-panel">
<h2>房间与游戏监控</h2>
<div id="rooms-table" class="table-wrap"></div>
</section>
<section class="card admin-panel">
<h2>游戏卡治理</h2>
<div id="cards-table" class="table-wrap"></div>
</section>
</main>
<section id="status" class="status-banner"></section>
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
<script src="{{ url_for('static', filename='js/admin.js') }}"></script>
</body>
</html>