feat(newapi): enhance NEWAPI service management with channel configuration

- Added channel_type, channel_base_url, and channel_models fields to the NewapiService model.
- Updated CRUD operations to handle new fields for creating and updating NEWAPI services.
- Modified upload functions to accept channel configuration parameters.
- Enhanced front-end forms and tables to display and manage channel settings for NEWAPI services.
- Improved error handling and user feedback in the UI for service management.
This commit is contained in:
Jay Hsueh
2026-03-25 15:18:05 +08:00
parent ab353f0429
commit 9c6e0d6036
9 changed files with 121 additions and 15 deletions

View File

@@ -294,13 +294,16 @@
<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="5" style="text-align:center;color:var(--text-muted);padding:20px;">加载中...</td></tr>
<tr><td colspan="8" style="text-align:center;color:var(--text-muted);padding:20px;">加载中...</td></tr>
</tbody>
</table>
</div>
@@ -470,6 +473,20 @@
<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>