mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-01 04:02:02 +08:00
feat(common-config): add extract from current provider functionality
- Add backend command to extract common config snippet from current provider - Automatically extract common config on first run after importing default provider - Auto-enable common config checkbox in new provider mode when snippet exists - Refactor Gemini common config to operate on .env instead of config.json - Add "Extract from Current" button to all three common config modals - Update i18n translations for new extraction feature
This commit is contained in:
@@ -47,3 +47,18 @@ export async function setCommonConfigSnippet(
|
||||
): Promise<void> {
|
||||
return invoke("set_common_config_snippet", { appType, snippet });
|
||||
}
|
||||
|
||||
/**
|
||||
* 从当前供应商提取通用配置片段
|
||||
*
|
||||
* 读取当前激活供应商的配置,自动排除差异化字段(API Key、模型配置、端点等),
|
||||
* 返回可复用的通用配置片段。
|
||||
*
|
||||
* @param appType - 应用类型(claude/codex/gemini)
|
||||
* @returns 提取的通用配置片段(JSON/TOML 字符串)
|
||||
*/
|
||||
export async function extractCommonConfigSnippet(
|
||||
appType: AppType,
|
||||
): Promise<string> {
|
||||
return invoke<string>("extract_common_config_snippet", { appType });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user