Deploy grok2api (jiujiu532) to HF Space: port 7860, bucket persistence at /app/data
48d895c verified | <html lang="zh-CN"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title data-i18n="login.adminPageTitle">Grok2API - Admin</title> | |
| <link rel="icon" href="/favicon.ico?v={{APP_VERSION}}"> | |
| <link href="https://cdn.jsdelivr.net/npm/geist@1.0.0/dist/fonts/geist-sans/style.css" rel="stylesheet"> | |
| <link href="/static/css/app.css?v={{APP_VERSION}}" rel="stylesheet"> | |
| </head> | |
| <body class="login-body"> | |
| <div class="login-bg"></div> | |
| <div class="login-shell"> | |
| <div class="login-card"> | |
| <div class="login-brand"> | |
| <a href="https://github.com/chenyme/grok2api" target="_blank" rel="noopener" class="flex items-center gap-2" style="color:inherit"> | |
| <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.58 2 12.26c0 4.5 2.87 8.32 6.84 9.67.5.1.68-.22.68-.48 0-.24-.01-.86-.01-1.69-2.78.62-3.37-1.37-3.37-1.37-.45-1.17-1.11-1.48-1.11-1.48-.91-.64.07-.63.07-.63 1.01.07 1.54 1.06 1.54 1.06.9 1.58 2.36 1.12 2.94.86.09-.67.35-1.12.63-1.38-2.22-.26-4.56-1.14-4.56-5.07 0-1.12.39-2.04 1.03-2.76-.1-.26-.45-1.3.1-2.71 0 0 .84-.27 2.75 1.05A9.3 9.3 0 0 1 12 6.79c.85 0 1.7.12 2.5.36 1.9-1.32 2.74-1.05 2.74-1.05.55 1.41.2 2.45.1 2.71.64.72 1.03 1.64 1.03 2.76 0 3.94-2.34 4.81-4.58 5.06.36.32.68.95.68 1.92 0 1.38-.01 2.49-.01 2.83 0 .26.18.58.69.48A10.05 10.05 0 0 0 22 12.26C22 6.58 17.52 2 12 2Z"/></svg> | |
| <span>Grok2API</span> | |
| </a> | |
| </div> | |
| <div class="login-title" data-i18n="login.adminTitle">管理后台</div> | |
| <div class="login-subtitle" data-i18n="login.adminSubtitle">请输入后台密码以继续</div> | |
| <div class="login-form"> | |
| <input type="password" id="key" placeholder="后台密码" data-i18n-placeholder="login.adminPlaceholder" class="input" style="height:32px;font-size:12px"> | |
| <button onclick="login()" class="btn btn-primary w-full" style="font-size:12px" data-i18n="login.continue">继续</button> | |
| </div> | |
| </div> | |
| </div> | |
| <script src="/static/js/i18n.js?v={{APP_VERSION}}"></script> | |
| <script src="/static/js/auth.js?v={{APP_VERSION}}"></script> | |
| <script src="/static/js/toast.js?v={{APP_VERSION}}"></script> | |
| <script src="/static/js/footer.js?v={{APP_VERSION}}"></script> | |
| <script> | |
| const el = document.getElementById('key'); | |
| el.addEventListener('keypress', e => { if (e.key === 'Enter') login(); }); | |
| async function login() { | |
| const key = el.value.trim(); | |
| if (!key) return; | |
| try { | |
| if (await verifyKey(ADMIN_API+'/verify', key)) { await adminKey.set(key); location.href='/admin/account'; } | |
| else showToast(t('common.invalidKey'), 'error'); | |
| } catch { showToast(t('common.connectionFailed'), 'error'); } | |
| } | |
| (async () => { | |
| const key = await adminKey.get(); | |
| if (key) try { if (await verifyKey(ADMIN_API+'/verify', key)) location.href='/admin/account'; } catch {} | |
| await renderSiteFooter?.(); | |
| })(); | |
| </script> | |
| </body> | |
| </html> | |