From 8f7423f011a980043f8e1124c1ebff87fa5e857e Mon Sep 17 00:00:00 2001 From: Dex Miller Date: Mon, 12 Jan 2026 15:57:45 +0800 Subject: [PATCH] Feat/deeplink multi endpoints (#597) * feat(deeplink): support comma-separated multiple endpoints in URL Allow importing multiple API endpoints via single endpoint parameter. First URL becomes primary endpoint, rest are added as custom endpoints. * feat(deeplink): add usage query fields to deeplink generator Add form fields for usage query configuration in deeplink HTML generator: - usageEnabled, usageBaseUrl, usageApiKey - usageScript, usageAutoInterval - usageAccessToken, usageUserId * fix(deeplink): auto-infer homepage and improve multi-endpoint display - Auto-infer homepage from primary endpoint when not provided - Display multiple endpoints as list in import dialog (primary marked) - Update deeplink parser in deplink.html to show multi-endpoint info - Add test for homepage inference from endpoint - Minor log format fix in live.rs * fix(deeplink): use primary endpoint for usage script base_url - Fix usage_script.base_url getting comma-separated string when multiple endpoints - Add i18n support for primary endpoint label in DeepLinkImportDialog --- deplink.html | 1015 ++++++----------------- src-tauri/src/deeplink/mod.rs | 2 +- src-tauri/src/deeplink/parser.rs | 8 +- src-tauri/src/deeplink/provider.rs | 82 +- src-tauri/src/deeplink/tests.rs | 54 ++ src-tauri/src/services/provider/live.rs | 2 +- src/components/DeepLinkImportDialog.tsx | 23 +- src/i18n/locales/en.json | 1 + src/i18n/locales/ja.json | 1 + src/i18n/locales/zh.json | 1 + 10 files changed, 385 insertions(+), 804 deletions(-) diff --git a/deplink.html b/deplink.html index eab057c34..a02d8d66c 100644 --- a/deplink.html +++ b/deplink.html @@ -328,361 +328,6 @@
- -
-

Claude Code 供应商

- - - - - - - - - - -
- - -
-

Codex 供应商

- - - - - - - - -
- - -
-

Gemini 供应商

- - - - - - - - -
@@ -848,303 +493,12 @@
- - - - -
-

✨ 配置文件导入新特性 (v3.8+)

- -
- - - -
-

🏢 供应商导入 v3.8+

- - - - - -

🔌 MCP Servers 导入 v3.8+

- - - - - -
- - - - @@ -1336,77 +636,6 @@

填写参数信息,自动生成深链接并导入到 CC Switch

- - -
-

🏢 供应商导入生成器

- -
- - -
- -
- - -
- -
- - - 您的 API 密钥 -
- -
- - - 完整的 API 端点 URL -
- -
- - -
- -
- - - 可选,留空使用系统默认 -
- -
- - -
- -
- - -
- - - - -
-

🔌 MCP Servers 导入生成器

@@ -1702,6 +931,17 @@
+ + 主 API 端点地址 + +
+ +
+ + + + 多个备用端点用逗号分隔,导入后自动添加为自定义端点 +
@@ -1820,6 +1060,79 @@
+ +
+

+ 📊 用量查询配置(v3.9+,可选) +

+

+ 配置用量查询脚本,可自动查询 API 余额 +

+ +
+ + +
+ +
+ + + + 用量查询接口的基础地址,必须与脚本中的请求 URL 同源 + +
+ +
+ + +
+ +
+ + + + 支持模板变量:{{baseUrl}}、{{apiKey}}、{{accessToken}}、{{userId}} + +
+ +
+ + + + 0 表示禁用自动查询 + +
+ +
+ + +
+ +
+ + +
+
+