mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 08:44:41 +08:00
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
This commit is contained in:
@@ -389,12 +389,27 @@ export function DeepLinkImportDialog() {
|
||||
</div>
|
||||
|
||||
{/* API Endpoint */}
|
||||
<div className="grid grid-cols-3 items-center gap-4">
|
||||
<div className="font-medium text-sm text-muted-foreground">
|
||||
<div className="grid grid-cols-3 items-start gap-4">
|
||||
<div className="font-medium text-sm text-muted-foreground pt-0.5">
|
||||
{t("deeplink.endpoint")}
|
||||
</div>
|
||||
<div className="col-span-2 text-sm break-all">
|
||||
{request.endpoint}
|
||||
<div className="col-span-2 text-sm break-all space-y-1">
|
||||
{request.endpoint?.split(",").map((ep, idx) => (
|
||||
<div
|
||||
key={idx}
|
||||
className={
|
||||
idx === 0 ? "font-medium" : "text-muted-foreground"
|
||||
}
|
||||
>
|
||||
{idx === 0 ? "🔹 " : "└ "}
|
||||
{ep.trim()}
|
||||
{idx === 0 && request.endpoint?.includes(",") && (
|
||||
<span className="text-xs text-muted-foreground ml-2">
|
||||
({t("deeplink.primaryEndpoint")})
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -958,6 +958,7 @@
|
||||
"configDetails": "Config Details",
|
||||
"configUrl": "Config File URL",
|
||||
"configMergeError": "Failed to merge configuration file",
|
||||
"primaryEndpoint": "Primary",
|
||||
"mcp": {
|
||||
"title": "Batch Import MCP Servers",
|
||||
"targetApps": "Target Apps",
|
||||
|
||||
@@ -958,6 +958,7 @@
|
||||
"configDetails": "設定の詳細",
|
||||
"configUrl": "設定ファイル URL",
|
||||
"configMergeError": "設定ファイルのマージに失敗しました",
|
||||
"primaryEndpoint": "メイン",
|
||||
"mcp": {
|
||||
"title": "MCP サーバーを一括インポート",
|
||||
"targetApps": "ターゲットアプリ",
|
||||
|
||||
@@ -958,6 +958,7 @@
|
||||
"configDetails": "配置详情",
|
||||
"configUrl": "配置文件 URL",
|
||||
"configMergeError": "合并配置文件失败",
|
||||
"primaryEndpoint": "主",
|
||||
"mcp": {
|
||||
"title": "批量导入 MCP Servers",
|
||||
"targetApps": "目标应用",
|
||||
|
||||
Reference in New Issue
Block a user