Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- templates/admin/index.html +43 -39
templates/admin/index.html
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{% extends "base.html" %}
|
| 2 |
-
{% from "components/alerts.html" import api_key_status, error_alert %}
|
| 3 |
{% from "components/account_table.html" import account_table %}
|
| 4 |
|
| 5 |
{% block title %}系统管理 - Gemini Business API{% endblock %}
|
|
@@ -36,43 +36,45 @@
|
|
| 36 |
<!-- Tab 1: 账户管理 -->
|
| 37 |
<div id="tab-accounts" class="tab-content active">
|
| 38 |
{{ api_key_status(has_api_key) }}
|
| 39 |
-
{{ error_alert(error_count) }}
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
<div class="alert alert-primary">
|
| 42 |
<div class="alert-icon">🔗</div>
|
| 43 |
<div class="alert-content">
|
| 44 |
-
<strong>API 接口
|
| 45 |
-
<div style="margin-top:
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
<
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
<
|
| 53 |
-
</div>
|
| 54 |
-
<div style="margin-bottom: 12px;">
|
| 55 |
-
<div style="color: #86868b; font-size: 11px; margin-bottom: 4px;">完整聊天接口(直接调用)</div>
|
| 56 |
-
<code style="font-size: 11px; background: rgba(0,0,0,0.05); padding: 4px 8px; border-radius: 4px; display: inline-block; word-break: break-all;">{{ api_endpoint }}</code>
|
| 57 |
</div>
|
| 58 |
-
<div
|
| 59 |
-
<
|
| 60 |
-
<
|
|
|
|
|
|
|
|
|
|
| 61 |
</div>
|
| 62 |
-
<div
|
| 63 |
-
<
|
| 64 |
-
<div style="display: flex;
|
| 65 |
-
<
|
| 66 |
-
<
|
| 67 |
-
<span style="background: #f0f0f2; color: #1d1d1f; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;">gemini-2.5-pro</span>
|
| 68 |
-
<span style="background: #f0f0f2; color: #1d1d1f; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;">gemini-3-flash-preview</span>
|
| 69 |
-
<span style="background: #f0f0f2; color: #1d1d1f; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;">gemini-3-pro-preview</span>
|
| 70 |
</div>
|
| 71 |
</div>
|
| 72 |
-
<div
|
| 73 |
-
<
|
| 74 |
-
<div
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
| 76 |
</div>
|
| 77 |
</div>
|
| 78 |
</div>
|
|
@@ -267,10 +269,17 @@
|
|
| 267 |
<!-- Tab 4: 系统设置 -->
|
| 268 |
<div id="tab-settings" class="tab-content">
|
| 269 |
<div class="section">
|
| 270 |
-
<div
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
</div>
|
| 275 |
|
| 276 |
<div class="grid-env">
|
|
@@ -380,11 +389,6 @@
|
|
| 380 |
</div>
|
| 381 |
</div>
|
| 382 |
</div>
|
| 383 |
-
|
| 384 |
-
<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: flex-end;">
|
| 385 |
-
<button class="btn btn-secondary" onclick="loadSettings()">重置</button>
|
| 386 |
-
<button class="btn btn-primary" onclick="saveSettings()">保存设置</button>
|
| 387 |
-
</div>
|
| 388 |
</div>
|
| 389 |
</div>
|
| 390 |
</div>
|
|
|
|
| 1 |
{% extends "base.html" %}
|
| 2 |
+
{% from "components/alerts.html" import api_key_status, error_alert, no_accounts_alert %}
|
| 3 |
{% from "components/account_table.html" import account_table %}
|
| 4 |
|
| 5 |
{% block title %}系统管理 - Gemini Business API{% endblock %}
|
|
|
|
| 36 |
<!-- Tab 1: 账户管理 -->
|
| 37 |
<div id="tab-accounts" class="tab-content active">
|
| 38 |
{{ api_key_status(has_api_key) }}
|
| 39 |
+
{{ error_alert(error_count, admin_path_segment) }}
|
| 40 |
+
{% if multi_account_mgr.accounts|length == 0 %}
|
| 41 |
+
{{ no_accounts_alert() }}
|
| 42 |
+
{% endif %}
|
| 43 |
|
| 44 |
<div class="alert alert-primary">
|
| 45 |
<div class="alert-icon">🔗</div>
|
| 46 |
<div class="alert-content">
|
| 47 |
+
<strong>API 接口</strong>
|
| 48 |
+
<div style="margin-top: 6px; color: #86868b; font-size: 11px;">根据客户端选择对应接口</div>
|
| 49 |
+
<div style="margin-top: 10px; display: grid; gap: 10px;">
|
| 50 |
+
<div class="api-item">
|
| 51 |
+
<span class="api-item-label">基础端点</span>
|
| 52 |
+
<div class="api-item-content" style="display: flex; gap: 8px; flex: 1;">
|
| 53 |
+
<code class="api-item-code">{{ api_base_url }}</code>
|
| 54 |
+
<button class="btn-copy" onclick="navigator.clipboard.writeText('{{ api_base_url }}').then(() => { this.innerHTML = '✅'; setTimeout(() => this.innerHTML = '📋', 2000); })">📋</button>
|
| 55 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
</div>
|
| 57 |
+
<div class="api-item">
|
| 58 |
+
<span class="api-item-label">SDK 接口</span>
|
| 59 |
+
<div class="api-item-content" style="display: flex; gap: 8px; flex: 1;">
|
| 60 |
+
<code class="api-item-code">{{ api_base_v1 }}</code>
|
| 61 |
+
<button class="btn-copy" onclick="navigator.clipboard.writeText('{{ api_base_v1 }}').then(() => { this.innerHTML = '✅'; setTimeout(() => this.innerHTML = '📋', 2000); })">📋</button>
|
| 62 |
+
</div>
|
| 63 |
</div>
|
| 64 |
+
<div class="api-item">
|
| 65 |
+
<span class="api-item-label">完整接口</span>
|
| 66 |
+
<div class="api-item-content" style="display: flex; gap: 8px; flex: 1;">
|
| 67 |
+
<code class="api-item-code">{{ api_endpoint }}</code>
|
| 68 |
+
<button class="btn-copy" onclick="navigator.clipboard.writeText('{{ api_endpoint }}').then(() => { this.innerHTML = '✅'; setTimeout(() => this.innerHTML = '📋', 2000); })">📋</button>
|
|
|
|
|
|
|
|
|
|
| 69 |
</div>
|
| 70 |
</div>
|
| 71 |
+
<div class="api-item">
|
| 72 |
+
<span class="api-item-label">API 密钥</span>
|
| 73 |
+
<div class="api-item-content" style="display: flex; gap: 8px; flex: 1;">
|
| 74 |
+
<code class="api-item-code">{% if main.API_KEY %}{{ main.API_KEY }}{% else %}<span style="color: #ff9500;">未设置</span>{% endif %}</code>
|
| 75 |
+
{% if main.API_KEY %}
|
| 76 |
+
<button class="btn-copy" onclick="navigator.clipboard.writeText('{{ main.API_KEY }}').then(() => { this.innerHTML = '✅'; setTimeout(() => this.innerHTML = '📋', 2000); })">📋</button>
|
| 77 |
+
{% endif %}
|
| 78 |
</div>
|
| 79 |
</div>
|
| 80 |
</div>
|
|
|
|
| 269 |
<!-- Tab 4: 系统设置 -->
|
| 270 |
<div id="tab-settings" class="tab-content">
|
| 271 |
<div class="section">
|
| 272 |
+
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 16px; flex-wrap: wrap;">
|
| 273 |
+
<div style="flex: 1; min-width: 200px;">
|
| 274 |
+
<div class="section-title" style="margin-bottom: 4px;">系统设置</div>
|
| 275 |
+
<div style="color: #6b6b6b; font-size: 11px; padding-left: 4px;">
|
| 276 |
+
✅ 配置修改后立即生效,无需重启 • 📋 优先级:YAML > 环境变量 > 默认值
|
| 277 |
+
</div>
|
| 278 |
+
</div>
|
| 279 |
+
<div style="display: flex; gap: 10px; flex-shrink: 0;">
|
| 280 |
+
<button class="btn" onclick="loadSettings()">重置</button>
|
| 281 |
+
<button class="btn" onclick="saveSettings()">保存设置</button>
|
| 282 |
+
</div>
|
| 283 |
</div>
|
| 284 |
|
| 285 |
<div class="grid-env">
|
|
|
|
| 389 |
</div>
|
| 390 |
</div>
|
| 391 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
</div>
|
| 393 |
</div>
|
| 394 |
</div>
|