mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-07-06 23:01:42 +08:00
Merge branch 'master' into copilot/codex-auth-f4d0327
This commit is contained in:
@@ -136,6 +136,7 @@
|
||||
<a href="#" class="dropdown-item" id="batch-upload-cpa-item">☁️ 上传到 CPA</a>
|
||||
<a href="#" class="dropdown-item" id="batch-upload-sub2api-item">🔗 上传到 Sub2API</a>
|
||||
<a href="#" class="dropdown-item" id="batch-upload-tm-item">🚀 上传到 Team Manager</a>
|
||||
<a href="#" class="dropdown-item" id="batch-upload-newapi-item">🧩 上传到 NEWAPI</a>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-danger" id="batch-delete-btn" disabled>
|
||||
@@ -174,6 +175,7 @@
|
||||
<th style="width: 120px;">邮箱服务</th>
|
||||
<th style="width: 80px;">状态</th>
|
||||
<th style="width: 80px;">CPA</th>
|
||||
<th style="width: 80px;">NEWAPI</th>
|
||||
<th style="width: 80px;">订阅</th>
|
||||
<th style="width: 140px;">最后刷新</th>
|
||||
<th style="width: 160px;">操作</th>
|
||||
@@ -298,6 +300,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- NEWAPI 服务选择模态框 -->
|
||||
<div class="modal" id="newapi-service-modal">
|
||||
<div class="modal-content" style="max-width: 480px;">
|
||||
<div class="modal-header">
|
||||
<h3>🧩 选择 NEWAPI 服务</h3>
|
||||
<button class="modal-close" id="close-newapi-modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p style="color: var(--text-muted); margin-bottom: 12px; font-size: 0.9rem;">选择要上传到的 NEWAPI 服务,或自动选择第一个启用的服务。</p>
|
||||
<div id="newapi-service-list" style="display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto;">
|
||||
<div style="text-align: center; color: var(--text-muted);">加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer" style="padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end;">
|
||||
<button class="btn btn-secondary" id="newapi-use-auto-btn">自动选择</button>
|
||||
<button class="btn btn-secondary" id="cancel-newapi-modal-btn">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/utils.js?v={{ static_version }}"></script>
|
||||
<script src="/static/js/accounts.js?v={{ static_version }}"></script>
|
||||
|
||||
@@ -301,6 +301,15 @@
|
||||
<div id="tm-service-select-group" style="display:none; margin-top: 6px; padding-left: 4px;">
|
||||
<div class="multi-select-dropdown" id="tm-service-select"></div>
|
||||
</div>
|
||||
|
||||
<!-- NEWAPI -->
|
||||
<label style="display: flex; align-items: center; gap: var(--spacing-sm); cursor: pointer; margin-top: 6px;">
|
||||
<input type="checkbox" id="auto-upload-newapi">
|
||||
<span>上传到 NEWAPI</span>
|
||||
</label>
|
||||
<div id="newapi-service-select-group" style="display:none; margin-top: 6px; padding-left: 4px;">
|
||||
<div class="multi-select-dropdown" id="newapi-service-select"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions" style="flex-direction: column;">
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上传服务设置(CPA + Sub2API + Team Manager) -->
|
||||
<!-- 上传服务设置(CPA + Sub2API + Team Manager + NEWAPI) -->
|
||||
<div class="tab-content" id="upload-tab">
|
||||
<!-- CPA 服务管理 -->
|
||||
<div class="card" style="margin-top: var(--spacing-lg);">
|
||||
@@ -281,6 +281,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-top: var(--spacing-lg);">
|
||||
<div class="card-header">
|
||||
<h3>🧩 NEWAPI 服务</h3>
|
||||
<button class="btn btn-primary btn-sm" id="add-newapi-service-btn">+ 添加服务</button>
|
||||
</div>
|
||||
<div class="card-body" style="padding: 0;">
|
||||
<div class="table-container">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:150px;">名称</th>
|
||||
<th>API URL</th>
|
||||
<th style="width:90px;text-align:center;">Type</th>
|
||||
<th style="width:150px;">Base URL</th>
|
||||
<th>Models</th>
|
||||
<th style="width:80px;">状态</th>
|
||||
<th style="width:60px;text-align:center;">优先级</th>
|
||||
<th style="width:220px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="newapi-services-table">
|
||||
<tr><td colspan="8" style="text-align:center;color:var(--text-muted);padding:20px;">加载中...</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Team Manager 服务编辑模态框 -->
|
||||
@@ -423,6 +451,64 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal" id="newapi-service-edit-modal">
|
||||
<div class="modal-content" style="max-width: 500px;">
|
||||
<div class="modal-header">
|
||||
<h3 id="newapi-service-modal-title">添加 NEWAPI 服务</h3>
|
||||
<button class="modal-close" id="close-newapi-service-modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="newapi-service-form">
|
||||
<input type="hidden" id="newapi-service-id">
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-name">名称 *</label>
|
||||
<input type="text" id="newapi-service-name" placeholder="例如: 自建 New API" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-url">API URL *</label>
|
||||
<input type="text" id="newapi-service-url" placeholder="https://newapi.example.com" required>
|
||||
<p class="hint">填写 New API 根地址;连接测试为 <code>GET /api/user/login</code>,请求头 <code>Authorization: Bearer</code>(与<a href="https://docs.newapi.pro/zh/docs/api/management/auth" target="_blank" rel="noopener">鉴权说明</a>一致,Token 来自系统访问令牌)</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-key">Root Token / API Key *</label>
|
||||
<input type="password" id="newapi-service-key" placeholder="编辑时留空则保持原值" autocomplete="new-password">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-channel-type">渠道 Type</label>
|
||||
<input type="number" id="newapi-service-channel-type" value="57" min="1">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-channel-base-url">渠道 Base URL</label>
|
||||
<input type="text" id="newapi-service-channel-base-url" placeholder="留空使用默认">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-channel-models">渠道 Models</label>
|
||||
<input type="text" id="newapi-service-channel-models" placeholder="逗号分隔模型列表">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="newapi-service-priority">优先级</label>
|
||||
<input type="number" id="newapi-service-priority" value="0" min="0">
|
||||
<p class="hint">数字越小优先级越高</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<label style="margin-top:10px;display:flex;align-items:center;gap:8px;">
|
||||
<input type="checkbox" id="newapi-service-enabled" checked> 启用
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">💾 保存</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancel-newapi-service-btn">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Outlook 配置 -->
|
||||
<div class="tab-content" id="outlook-tab">
|
||||
<div class="card">
|
||||
|
||||
Reference in New Issue
Block a user