xiaoyukkkk commited on
Commit
6e23603
·
verified ·
1 Parent(s): f5307f3

Upload 2 files

Browse files
Files changed (1) hide show
  1. 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 接口信息</strong>
45
- <div style="margin-top: 10px;">
46
- <div style="margin-bottom: 12px;">
47
- <div style="color: #86868b; font-size: 11px; margin-bottom: 4px;">基础端点(部分客户端)</div>
48
- <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_base_url }}</code>
49
- </div>
50
- <div style="margin-bottom: 12px;">
51
- <div style="color: #86868b; font-size: 11px; margin-bottom: 4px;">API Base(OpenAI SDK 等)</div>
52
- <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_base_v1 }}</code>
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 style="margin-bottom: 12px;">
59
- <div style="color: #86868b; font-size: 11px; margin-bottom: 4px;">API 密钥</div>
60
- <code style="font-size: 11px; background: rgba(0,0,0,0.05); padding: 4px 8px; border-radius: 4px; display: inline-block;">{% if main.API_KEY %}{{ main.API_KEY }}{% else %}<span style="color: #ff9500;">未设置(公开访问)</span>{% endif %}</code>
 
 
 
61
  </div>
62
- <div style="margin-bottom: 12px;">
63
- <div style="color: #86868b; font-size: 11px; margin-bottom: 6px;">支持的模型</div>
64
- <div style="display: flex; flex-wrap: wrap; gap: 6px;">
65
- <span style="background: #f0f0f2; color: #1d1d1f; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: 'SF Mono', SFMono-Regular, Consolas, monospace;">gemini-auto</span>
66
- <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-flash</span>
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 style="background: rgba(0,0,0,0.03); padding: 10px; border-radius: 6px;">
73
- <div style="font-size: 11px; color: #1d1d1f; margin-bottom: 4px; font-weight: 600;">📸 图片生成</div>
74
- <div style="font-size: 11px; color: #86868b; line-height: 1.6;">
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 class="section-title">系统设置</div>
271
- <div style="color: #6b6b6b; font-size: 12px; margin-bottom: 16px; padding-left: 4px;">
272
- ✅ 所有配置修改后<strong>立即生效</strong>,无需重启服务。配保存在 <code>data/settings.yaml</code><br>
273
- 📋 配置优先级:<strong>YAML > 环境变量 > 默认值</strong>(安全配置除外,仅从环境变量读取)
 
 
 
 
 
 
 
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>