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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="zh-CN">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>登录</title>
|
| 7 |
+
<style>
|
| 8 |
+
* {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
box-sizing: border-box;
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
body {
|
| 15 |
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
| 16 |
+
background: #fafaf9;
|
| 17 |
+
min-height: 100vh;
|
| 18 |
+
display: flex;
|
| 19 |
+
align-items: center;
|
| 20 |
+
justify-content: center;
|
| 21 |
+
padding: 20px;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
.container {
|
| 25 |
+
background: #fff;
|
| 26 |
+
border: 1px solid #e5e5e5;
|
| 27 |
+
border-radius: 12px;
|
| 28 |
+
width: 100%;
|
| 29 |
+
max-width: 380px;
|
| 30 |
+
padding: 40px 32px;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.header {
|
| 34 |
+
text-align: center;
|
| 35 |
+
margin-bottom: 32px;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
h1 {
|
| 39 |
+
font-size: 22px;
|
| 40 |
+
font-weight: 600;
|
| 41 |
+
color: #1d1d1f;
|
| 42 |
+
margin-bottom: 6px;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.subtitle {
|
| 46 |
+
font-size: 14px;
|
| 47 |
+
color: #86868b;
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.error-box {
|
| 51 |
+
padding: 12px 14px;
|
| 52 |
+
background: #fff5f5;
|
| 53 |
+
border: 1px solid #fecaca;
|
| 54 |
+
border-radius: 8px;
|
| 55 |
+
color: #dc2626;
|
| 56 |
+
font-size: 14px;
|
| 57 |
+
margin-bottom: 20px;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
label {
|
| 61 |
+
display: block;
|
| 62 |
+
font-size: 14px;
|
| 63 |
+
font-weight: 500;
|
| 64 |
+
color: #1d1d1f;
|
| 65 |
+
margin-bottom: 8px;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
input[type="password"] {
|
| 69 |
+
width: 100%;
|
| 70 |
+
padding: 12px 14px;
|
| 71 |
+
border: 1px solid #d4d4d4;
|
| 72 |
+
border-radius: 8px;
|
| 73 |
+
font-size: 15px;
|
| 74 |
+
color: #1d1d1f;
|
| 75 |
+
background: #fff;
|
| 76 |
+
transition: border-color 0.15s;
|
| 77 |
+
outline: none;
|
| 78 |
+
margin-bottom: 20px;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
input[type="password"]:focus {
|
| 82 |
+
border-color: #0071e3;
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
input[type="password"]::placeholder {
|
| 86 |
+
color: #c7c7cc;
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
button {
|
| 90 |
+
width: 100%;
|
| 91 |
+
padding: 12px;
|
| 92 |
+
background: #0071e3;
|
| 93 |
+
color: #fff;
|
| 94 |
+
border: none;
|
| 95 |
+
border-radius: 8px;
|
| 96 |
+
font-size: 15px;
|
| 97 |
+
font-weight: 500;
|
| 98 |
+
cursor: pointer;
|
| 99 |
+
transition: background 0.15s;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
button:hover {
|
| 103 |
+
background: #0077ed;
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
button:active {
|
| 107 |
+
background: #006dd1;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
.hint {
|
| 111 |
+
margin-top: 20px;
|
| 112 |
+
padding: 12px;
|
| 113 |
+
background: #f6f6f8;
|
| 114 |
+
border-radius: 8px;
|
| 115 |
+
font-size: 13px;
|
| 116 |
+
color: #86868b;
|
| 117 |
+
line-height: 1.5;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
.iframe-hint {
|
| 121 |
+
margin-top: 16px;
|
| 122 |
+
padding: 12px 14px;
|
| 123 |
+
background: #fff4e6;
|
| 124 |
+
border: 1px solid #ffd666;
|
| 125 |
+
border-radius: 8px;
|
| 126 |
+
font-size: 13px;
|
| 127 |
+
color: #d46b08;
|
| 128 |
+
line-height: 1.5;
|
| 129 |
+
display: none;
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
.iframe-hint a {
|
| 133 |
+
color: #0071e3;
|
| 134 |
+
text-decoration: none;
|
| 135 |
+
font-weight: 600;
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
.iframe-hint a:hover {
|
| 139 |
+
text-decoration: underline;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
@media (max-width: 480px) {
|
| 143 |
+
.container {
|
| 144 |
+
padding: 32px 24px;
|
| 145 |
+
}
|
| 146 |
+
}
|
| 147 |
+
</style>
|
| 148 |
+
<script>
|
| 149 |
+
// 检测是否在 iframe 内
|
| 150 |
+
if (window.self !== window.top) {
|
| 151 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 152 |
+
const hint = document.getElementById('iframe-hint');
|
| 153 |
+
if (hint) {
|
| 154 |
+
hint.style.display = 'block';
|
| 155 |
+
// 获取当前完整 URL(去掉 iframe 参数)
|
| 156 |
+
const currentUrl = window.location.href.replace(/[?&]__theme=.*?(&|$)/, '');
|
| 157 |
+
const link = document.getElementById('direct-link');
|
| 158 |
+
if (link) {
|
| 159 |
+
link.href = currentUrl;
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
});
|
| 163 |
+
}
|
| 164 |
+
</script>
|
| 165 |
+
</head>
|
| 166 |
+
<body>
|
| 167 |
+
<div class="container">
|
| 168 |
+
<div class="header">
|
| 169 |
+
<h1>管理员登录</h1>
|
| 170 |
+
<p class="subtitle">Gemini Business API</p>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
{% if error %}
|
| 174 |
+
<div class="error-box">
|
| 175 |
+
⚠️ {{ error }}
|
| 176 |
+
</div>
|
| 177 |
+
{% endif %}
|
| 178 |
+
|
| 179 |
+
<form method="POST" action="{{ request.url.path }}">
|
| 180 |
+
<label for="admin_key">密钥</label>
|
| 181 |
+
<input
|
| 182 |
+
type="password"
|
| 183 |
+
id="admin_key"
|
| 184 |
+
name="admin_key"
|
| 185 |
+
placeholder="输入 ADMIN_KEY"
|
| 186 |
+
required
|
| 187 |
+
autofocus
|
| 188 |
+
>
|
| 189 |
+
<button type="submit">登录</button>
|
| 190 |
+
</form>
|
| 191 |
+
|
| 192 |
+
<div class="hint">
|
| 193 |
+
会话保持 24 小时
|
| 194 |
+
</div>
|
| 195 |
+
|
| 196 |
+
<div id="iframe-hint" class="iframe-hint">
|
| 197 |
+
⚠️ HuggingFace 内部无法登录,<a id="direct-link" href="#" target="_blank">点我跳转</a>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
</body>
|
| 201 |
+
</html>
|