refactor(claude-desktop): align provider form UI with Claude Code

- Rename field labels: "Gateway Base URL" → "API Endpoint", "Bearer Token" → "API Key"
- Change layout from 2-column grid to vertical sections matching Claude Code
- Reuse shared EndpointField component with format-aware amber hint box
- Replace native <datalist> with vendor-grouped ModelDropdown (OpenCode pattern)
- Move Fetch/Add buttons to section headers with compact sm styling
- Extract ModelDropdown to shared module, deduplicate from OpenCodeFormFields
- Extract renderActionButtons helper to eliminate proxy/direct button duplication
- Remove dead i18n keys (gatewayBaseUrl, bearerToken) from all 3 locales
This commit is contained in:
Jason
2026-05-08 16:02:58 +08:00
parent 34698723e3
commit 2deee1097b
7 changed files with 215 additions and 222 deletions
-2
View File
@@ -177,8 +177,6 @@
"mode": "Model handling",
"modeDirect": "Direct",
"modeProxy": "Model mapping",
"gatewayBaseUrl": "Gateway Base URL",
"bearerToken": "Bearer Token",
"modelMappingToggle": "Needs model mapping",
"modelMappingOffHint": "Use this when the provider already exposes and accepts claude-* / anthropic/claude-* model IDs through Anthropic Messages. Claude Desktop connects to the provider directly.",
"modelMappingOnHint": "Claude Desktop only sees claude-* route names. CC Switch local routing maps them to the real upstream models, so local routing must stay running.",
-2
View File
@@ -177,8 +177,6 @@
"mode": "モデル処理方式",
"modeDirect": "直結",
"modeProxy": "モデルマッピング",
"gatewayBaseUrl": "Gateway Base URL",
"bearerToken": "Bearer Token",
"modelMappingToggle": "モデルマッピングが必要",
"modelMappingOffHint": "プロバイダーが Anthropic Messages で claude-* / anthropic/claude-* のモデル ID を公開し、そのまま受け付ける場合に使います。Claude Desktop はプロバイダーへ直接接続します。",
"modelMappingOnHint": "Claude Desktop には claude-* のルート名だけを見せ、CC Switch のローカルルーティングが実際の上流モデルへマッピングします。ローカルルーティングを起動したままにしてください。",
-2
View File
@@ -177,8 +177,6 @@
"mode": "模型处理方式",
"modeDirect": "直连",
"modeProxy": "模型映射",
"gatewayBaseUrl": "Gateway Base URL",
"bearerToken": "Bearer Token",
"modelMappingToggle": "需要模型映射",
"modelMappingOffHint": "适合供应商已经暴露并接受 claude-* / anthropic/claude-* 模型名的 Anthropic Messages API;请求会由 Claude Desktop 直连供应商。",
"modelMappingOnHint": "Claude Desktop 只看到 claude-* 路由名,CC Switch 本地路由会映射到真实上游模型;需要保持本地路由运行。",