mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-03 14:36:44 +08:00
feat(claude): add "Disable Auto-Upgrade" checkbox to provider config editor
Add a toggle for DISABLE_AUTOUPDATER env var in CommonConfigEditor, following the same pattern as the existing Teammates mode toggle.
This commit is contained in:
@@ -82,6 +82,9 @@ export function CommonConfigEditor({
|
||||
config?.env?.ENABLE_TOOL_SEARCH === "true" ||
|
||||
config?.env?.ENABLE_TOOL_SEARCH === "1",
|
||||
effortHigh: config?.effortLevel === "high",
|
||||
disableAutoUpgrade:
|
||||
config?.env?.DISABLE_AUTOUPDATER === "1" ||
|
||||
config?.env?.DISABLE_AUTOUPDATER === 1,
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
@@ -89,6 +92,7 @@ export function CommonConfigEditor({
|
||||
teammates: false,
|
||||
enableToolSearch: false,
|
||||
effortHigh: false,
|
||||
disableAutoUpgrade: false,
|
||||
};
|
||||
}
|
||||
}, [localValue]);
|
||||
@@ -131,6 +135,15 @@ export function CommonConfigEditor({
|
||||
delete config.effortLevel;
|
||||
}
|
||||
break;
|
||||
case "disableAutoUpgrade":
|
||||
if (!config.env) config.env = {};
|
||||
if (checked) {
|
||||
config.env.DISABLE_AUTOUPDATER = "1";
|
||||
} else {
|
||||
delete config.env.DISABLE_AUTOUPDATER;
|
||||
if (Object.keys(config.env).length === 0) delete config.env;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
handleLocalChange(JSON.stringify(config, null, 2));
|
||||
@@ -220,6 +233,17 @@ export function CommonConfigEditor({
|
||||
/>
|
||||
<span>{t("claudeConfig.effortHigh")}</span>
|
||||
</label>
|
||||
<label className="inline-flex items-center gap-2 text-sm text-muted-foreground cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={toggleStates.disableAutoUpgrade}
|
||||
onChange={(e) =>
|
||||
handleToggle("disableAutoUpgrade", e.target.checked)
|
||||
}
|
||||
className="w-4 h-4 text-blue-500 bg-white dark:bg-gray-800 border-border-default rounded focus:ring-blue-500 dark:focus:ring-blue-400 focus:ring-2"
|
||||
/>
|
||||
<span>{t("claudeConfig.disableAutoUpgrade")}</span>
|
||||
</label>
|
||||
</div>
|
||||
<JsonEditor
|
||||
value={localValue}
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
"hideAttribution": "Hide AI Attribution",
|
||||
"enableTeammates": "Teammates Mode",
|
||||
"enableToolSearch": "Enable Tool Search",
|
||||
"effortHigh": "High Effort Thinking"
|
||||
"effortHigh": "High Effort Thinking",
|
||||
"disableAutoUpgrade": "Disable Auto-Upgrade"
|
||||
},
|
||||
"header": {
|
||||
"viewOnGithub": "View on GitHub",
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
"hideAttribution": "AI署名を非表示",
|
||||
"enableTeammates": "Teammates モード",
|
||||
"enableToolSearch": "Tool Search を有効化",
|
||||
"effortHigh": "高強度思考"
|
||||
"effortHigh": "高強度思考",
|
||||
"disableAutoUpgrade": "自動アップグレードを無効化"
|
||||
},
|
||||
"header": {
|
||||
"viewOnGithub": "GitHub で見る",
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
"hideAttribution": "隐藏 AI 署名",
|
||||
"enableTeammates": "Teammates 模式",
|
||||
"enableToolSearch": "启用 Tool Search",
|
||||
"effortHigh": "高强度思考"
|
||||
"effortHigh": "高强度思考",
|
||||
"disableAutoUpgrade": "禁用自动升级"
|
||||
},
|
||||
"header": {
|
||||
"viewOnGithub": "在 GitHub 上查看",
|
||||
|
||||
Reference in New Issue
Block a user