mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-05-22 16:50:41 +08:00
feat(cpa): 支持多cpa服务
This commit is contained in:
@@ -213,6 +213,26 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CPA 服务选择模态框 -->
|
||||
<div class="modal" id="cpa-service-modal">
|
||||
<div class="modal-content" style="max-width: 480px;">
|
||||
<div class="modal-header">
|
||||
<h3>☁️ 选择 CPA 服务</h3>
|
||||
<button class="modal-close" id="close-cpa-modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p style="color: var(--text-muted); margin-bottom: 12px; font-size: 0.9rem;">选择要上传到的 CPA 服务,或使用全局配置。</p>
|
||||
<div id="cpa-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="cpa-use-global-btn">使用全局配置</button>
|
||||
<button class="btn btn-secondary" id="cancel-cpa-modal-btn">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/utils.js"></script>
|
||||
<script src="/static/js/accounts.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -228,6 +228,12 @@
|
||||
<input type="checkbox" id="auto-upload-cpa">
|
||||
<span>上传到 CPA</span>
|
||||
</label>
|
||||
<div id="cpa-service-select-group" style="display:none; margin-top: 8px; padding-left: 4px;">
|
||||
<label style="font-size:0.85rem; color:var(--text-muted); margin-bottom:4px; display:block;">选择 CPA 服务</label>
|
||||
<select id="cpa-service-select" style="width:100%; padding:6px 10px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text-primary); font-size:0.9rem;">
|
||||
<option value="">使用全局配置</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions" style="flex-direction: column;">
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3>CPA 上传配置</h3>
|
||||
<span class="hint">配置 Codex Protocol API 上传功能</span>
|
||||
<span class="hint">配置 CliProxyApi 上传功能</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="cpa-form">
|
||||
@@ -292,6 +292,77 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CPA 服务管理 -->
|
||||
<div class="card" style="margin-top: 16px;">
|
||||
<div class="card-header">
|
||||
<h3>CPA 服务管理</h3>
|
||||
<button class="btn btn-primary btn-sm" id="add-cpa-service-btn">+ 添加服务</button>
|
||||
</div>
|
||||
<div class="card-body" style="padding: 0;">
|
||||
<div class="table-container">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th>API URL</th>
|
||||
<th style="width:80px;">状态</th>
|
||||
<th style="width:60px;">优先级</th>
|
||||
<th style="width:160px;">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="cpa-services-table">
|
||||
<tr><td colspan="5" style="text-align:center;color:var(--text-muted);padding:20px;">加载中...</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CPA 服务编辑模态框 -->
|
||||
<div class="modal" id="cpa-service-edit-modal">
|
||||
<div class="modal-content" style="max-width: 500px;">
|
||||
<div class="modal-header">
|
||||
<h3 id="cpa-service-modal-title">添加 CPA 服务</h3>
|
||||
<button class="modal-close" id="close-cpa-service-modal">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="cpa-service-form">
|
||||
<input type="hidden" id="cpa-service-id">
|
||||
<div class="form-group">
|
||||
<label for="cpa-service-name">名称 *</label>
|
||||
<input type="text" id="cpa-service-name" placeholder="例如: 主服务" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cpa-service-url">API URL *</label>
|
||||
<input type="text" id="cpa-service-url" placeholder="https://cpa.example.com" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cpa-service-token">API Token</label>
|
||||
<input type="password" id="cpa-service-token" placeholder="编辑时留空则保持原值" autocomplete="new-password">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="cpa-service-priority">优先级</label>
|
||||
<input type="number" id="cpa-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="cpa-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="test-cpa-service-btn">🔌 测试连接</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancel-cpa-service-btn">取消</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Team Manager 设置 -->
|
||||
|
||||
Reference in New Issue
Block a user