diff --git a/src/components/providers/forms/hooks/useCodexCommonConfig.ts b/src/components/providers/forms/hooks/useCodexCommonConfig.ts index 23b2498c..926902a8 100644 --- a/src/components/providers/forms/hooks/useCodexCommonConfig.ts +++ b/src/components/providers/forms/hooks/useCodexCommonConfig.ts @@ -119,11 +119,7 @@ export function useCodexCommonConfig({ const hasCommon = initialEnabled ?? inferredHasCommon; setUseCommonConfig(hasCommon); - if ( - hasCommon && - !inferredHasCommon && - !hasInitializedEditMode.current - ) { + if (hasCommon && !inferredHasCommon && !hasInitializedEditMode.current) { hasInitializedEditMode.current = true; const { updatedConfig, error } = updateTomlCommonConfigSnippet( codexConfig, diff --git a/src/components/providers/forms/hooks/useCommonConfigSnippet.ts b/src/components/providers/forms/hooks/useCommonConfigSnippet.ts index d8fa0456..4b8fbed7 100644 --- a/src/components/providers/forms/hooks/useCommonConfigSnippet.ts +++ b/src/components/providers/forms/hooks/useCommonConfigSnippet.ts @@ -127,11 +127,7 @@ export function useCommonConfigSnippet({ const hasCommon = initialEnabled ?? inferredHasCommon; setUseCommonConfig(hasCommon); - if ( - hasCommon && - !inferredHasCommon && - !hasInitializedEditMode.current - ) { + if (hasCommon && !inferredHasCommon && !hasInitializedEditMode.current) { hasInitializedEditMode.current = true; const { updatedConfig, error } = updateCommonConfigSnippet( settingsConfig, diff --git a/src/config/claudeProviderPresets.ts b/src/config/claudeProviderPresets.ts index d385f068..2f57c56b 100644 --- a/src/config/claudeProviderPresets.ts +++ b/src/config/claudeProviderPresets.ts @@ -552,6 +552,26 @@ export const providerPresets: ProviderPreset[] = [ icon: "sssaicode", iconColor: "#000000", }, + { + name: "Ucloud", + websiteUrl: "https://www.compshare.cn", + apiKeyUrl: "https://api.modelverse.cn", + settingsConfig: { + env: { + ANTHROPIC_BASE_URL: "https://api.modelverse.cn", + ANTHROPIC_AUTH_TOKEN: "", + ANTHROPIC_MODEL: "zai-org/glm-5", + ANTHROPIC_DEFAULT_HAIKU_MODEL: "zai-org/glm-5", + ANTHROPIC_DEFAULT_SONNET_MODEL: "zai-org/glm-5", + ANTHROPIC_DEFAULT_OPUS_MODEL: "zai-org/glm-5", + }, + }, + category: "aggregator", + isPartner: true, // 合作伙伴 + partnerPromotionKey: "ucloud", // 促销信息 i18n key + icon: "ucloud", + iconColor: "#000000", + }, { name: "OpenRouter", websiteUrl: "https://openrouter.ai", diff --git a/src/config/codexProviderPresets.ts b/src/config/codexProviderPresets.ts index 141f9827..0c2d103a 100644 --- a/src/config/codexProviderPresets.ts +++ b/src/config/codexProviderPresets.ts @@ -280,6 +280,23 @@ requires_openai_auth = true`, icon: "sssaicode", iconColor: "#000000", }, + { + name: "Ucloud", + websiteUrl: "https://www.compshare.cn", + apiKeyUrl: "https://api.modelverse.cn/v1", + auth: generateThirdPartyAuth(""), + config: generateThirdPartyConfig( + "ucloud", + "https://api.modelverse.cn/v1", + "zai-org/glm-5", + ), + endpointCandidates: ["https://api.modelverse.cn/v1"], + category: "aggregator", + isPartner: true, // 合作伙伴 + partnerPromotionKey: "ucloud", // 促销信息 i18n key + icon: "ucloud", + iconColor: "#000000", + }, { name: "OpenRouter", websiteUrl: "https://openrouter.ai", diff --git a/src/config/openclawProviderPresets.ts b/src/config/openclawProviderPresets.ts index a13b264c..3807d0b8 100644 --- a/src/config/openclawProviderPresets.ts +++ b/src/config/openclawProviderPresets.ts @@ -1225,6 +1225,33 @@ export const openclawProviderPresets: OpenClawProviderPreset[] = [ }, }, }, + { + name: "Ucloud", + websiteUrl: "https://www.compshare.cn", + apiKeyUrl: "https://api.modelverse.cn/v1", + settingsConfig: { + baseUrl: "https://api.modelverse.cn/v1", + apiKey: "", + api: "anthropic-messages", + models: [ + { + id: "zai-org/glm-5", + name: "GLM-5", + contextWindow: 200000, + }, + { + id: "MiniMax-M2.5", + name: "MiniMax-M2.5", + contextWindow: 200000, + }, + ], + }, + category: "aggregator", + isPartner: true, // 合作伙伴 + partnerPromotionKey: "ucloud", // 促销信息 i18n key + icon: "ucloud", + iconColor: "#000000", + }, // ========== Cloud Providers ========== { name: "AWS Bedrock", diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 37b3a972..7e591daa 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -705,7 +705,8 @@ "aicoding": "AI Coding offers an exclusive discount for CC Switch users — 10% off your first top-up!", "crazyrouter": "CrazyRouter offers an exclusive bonus for CC Switch users — 30% extra credit on your first top-up!", "sssaicode": "SSAI Code offers an exclusive bonus for CC Switch users — $10 extra credit on every top-up!", - "siliconflow": "SiliconFlow is an official partner of CC Switch" + "siliconflow": "SiliconFlow is an official partner of CC Switch", + "ucloud": "UCloud offers an exclusive bonus for CC Switch users — register via this link to get ¥5 platform trial credit!" }, "parameterConfig": "Parameter Config - {{name}} *", "mainModel": "Main Model (optional)", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index 536c6614..0f372b82 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -705,7 +705,8 @@ "aicoding": "AI Coding は CC Switch ユーザー向けに特別割引を提供しています。初回チャージが 10% オフ!", "crazyrouter": "CrazyRouter は CC Switch ユーザー向けに特別ボーナスを提供しています。初回チャージで 30% の追加クレジットがもらえます!", "sssaicode": "SSAI Code は CC Switch ユーザー向けに特別ボーナスを提供しています。チャージごとに $10 の追加クレジットがもらえます!", - "siliconflow": "SiliconFlow は CC Switch の公式パートナーです" + "siliconflow": "SiliconFlow は CC Switch の公式パートナーです", + "ucloud": "UCloud は CC Switch ユーザー向けに特別ボーナスを提供しています。このリンクから登録すると、5元のプラットフォーム体験クレジットがもらえます!" }, "parameterConfig": "パラメーター設定 - {{name}} *", "mainModel": "メインモデル(任意)", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 215e05f0..46ab7550 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -705,7 +705,8 @@ "aicoding": "AI Coding 为 CC Switch 的用户提供了特殊优惠,首次充值可以享受 9 折优惠!", "crazyrouter": "CrazyRouter 为 CC Switch 的用户提供了特殊优惠,首次充值赠予 30% 额外额度!", "sssaicode": "SSAI Code 为 CC Switch 的用户提供了特殊优惠,每次充值赠予额外 $10 额度!", - "siliconflow": "硅基流动是 CC Switch 的官方合作伙伴" + "siliconflow": "硅基流动是 CC Switch 的官方合作伙伴", + "ucloud": "优云智算为CC Switch 的用户提供了特殊优惠,通过此链接注册,可以获得五元平台体验金!" }, "parameterConfig": "参数配置 - {{name}} *", "mainModel": "主模型 (可选)", diff --git a/src/icons/extracted/index.ts b/src/icons/extracted/index.ts index 1e2fba31..f6a92a23 100644 --- a/src/icons/extracted/index.ts +++ b/src/icons/extracted/index.ts @@ -60,6 +60,7 @@ export const icons: Record = { aihubmix: `AiHubMix`, opencode: `OpenCode`, siliconflow: `SiliconCloud`, + ucloud: `UCloud`, sssaicode: `SSAI Code1001 11010110 101110 110SSSSAiCode`, catcoder: `KwaiKAT`, mcp: `ModelContextProtocol`, diff --git a/src/icons/extracted/ucloud.svg b/src/icons/extracted/ucloud.svg new file mode 100644 index 00000000..9a4b8d47 --- /dev/null +++ b/src/icons/extracted/ucloud.svg @@ -0,0 +1 @@ +资源 13 \ No newline at end of file