refactor(proxy): change proxy mode from "system" to "default" across the application

- Updated the default proxy mode in `api.ts`, `ProxySettingsCard.tsx`, and `SettingsPage.tsx` to "default".
- Adjusted related translations in `catalog.json`, `en-US.json`, and `zh-CN.json`.
- Modified the `ProxyMode` enum in `settings.rs` to reflect the change from "system" to "default".
- Enhanced proxy handling in the server code to support the new default mode.
This commit is contained in:
leokun
2026-09-03 16:32:02 +08:00
parent 924b5e5926
commit 8942287a27
12 changed files with 179 additions and 38 deletions
+1 -1
View File
@@ -86,7 +86,7 @@ const harnessStatus: CursorHarnessStatus = {
let detailed = true;
let portSettings = { proxy_port: 0, service_port: 0 };
let proxySettings: ProxySettings = {
mode: "system",
mode: "default",
address: "",
auth_enabled: false,
username: "",
@@ -26,7 +26,7 @@ export function ProxySettingsCard({
onSave: () => void;
}) {
const custom = draft.mode === "custom";
const modeLabel = (mode: ProxySettingsInput["mode"]) => mode === "system" ? t("使用系统代理") : t("自定义");
const modeLabel = (mode: ProxySettingsInput["mode"]) => mode === "default" ? t("默认") : t("自定义");
const action = editing ? (
<div className={styles.actionGroup}>
<Button size="small" disabled={saving} onClick={onCancel}>{t("取消")}</Button>
@@ -43,7 +43,7 @@ export function ProxySettingsCard({
{editing ? <>
<div className={styles.row}>
<strong>{t("代理方式")}</strong>
<div className={styles.control}><Select ariaLabel={t("代理方式")} value={draft.mode} options={[{ value: "system", label: t("使用系统代理") }, { value: "custom", label: t("自定义") }]} onChange={(mode) => onDraftChange({ ...draft, mode: mode as ProxySettingsInput["mode"] })} /></div>
<div className={styles.control}><Select ariaLabel={t("代理方式")} value={draft.mode} options={[{ value: "default", label: t("默认") }, { value: "custom", label: t("自定义") }]} onChange={(mode) => onDraftChange({ ...draft, mode: mode as ProxySettingsInput["mode"] })} /></div>
</div>
{custom && <div className={styles.customFields}>
<div className={styles.row}>
@@ -31,7 +31,7 @@ export function SettingsPage() {
const [clearScope, setClearScope] = useState<StatisticsStorageScope>("details");
const [clearing, setClearing] = useState(false);
const [outboundProxy, setOutboundProxy] = useState<ProxySettings | null>(null);
const [proxyDraft, setProxyDraft] = useState<ProxySettingsInput>({ mode: "system", address: "", auth_enabled: false, username: "", password: "" });
const [proxyDraft, setProxyDraft] = useState<ProxySettingsInput>({ mode: "default", address: "", auth_enabled: false, username: "", password: "" });
const [editingProxy, setEditingProxy] = useState(false);
const [savingProxy, setSavingProxy] = useState(false);
const [tabSettings, setTabSettings] = useState<TabSettings | null>(null);
+19 -19
View File
@@ -1944,12 +1944,12 @@
{
"file": "features/settings/ProxySettingsCard.tsx",
"line": 29,
"column": 93
"column": 90
},
{
"file": "features/settings/ProxySettingsCard.tsx",
"line": 46,
"column": 169
"column": 166
},
{
"file": "features/settings/TabSettingsCard.tsx",
@@ -2956,6 +2956,23 @@
}
]
},
"844b8cc8dff7c1d8": {
"source": "默认",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "features/settings/ProxySettingsCard.tsx",
"line": 29,
"column": 80
},
{
"file": "features/settings/ProxySettingsCard.tsx",
"line": 46,
"column": 129
}
]
},
"864597982c308d72": {
"source": "已开启静默启动",
"kind": "text",
@@ -4808,23 +4825,6 @@
}
]
},
"d86fa42c3848c680": {
"source": "使用系统代理",
"kind": "text",
"placeholders": [],
"refs": [
{
"file": "features/settings/ProxySettingsCard.tsx",
"line": 29,
"column": 79
},
{
"file": "features/settings/ProxySettingsCard.tsx",
"line": 46,
"column": 128
}
]
},
"d8c47e9776cf1082": {
"source": "主菜单",
"kind": "text",
+1 -1
View File
@@ -203,6 +203,7 @@
"83fcfb4c1f2c1641": "Fetch models",
"842b9f11cdd96bda": "Launch at login",
"843ac7e15a5047a7": "Confirm legacy model configuration import",
"844b8cc8dff7c1d8": "Default",
"864597982c308d72": "Silent start enabled",
"86de7c4ee8fa7689": "Sync models",
"8716e1344b0daddb": "Cursor official",
@@ -332,7 +333,6 @@
"d6b1f203680f5496": "Leave blank to use adaptive thinking",
"d766536c18e8e990": "Plugin runtime {version} is installed and ready to use.",
"d7e266bdc8064193": "Group name",
"d86fa42c3848c680": "Use system proxy",
"d8c47e9776cf1082": "Main menu",
"d8c589c455675b46": "Prompt settings saved",
"da521d1c1cbd36af": "Authorization is required to install the certificate",
+1 -1
View File
@@ -203,6 +203,7 @@
"83fcfb4c1f2c1641": "获取模型",
"842b9f11cdd96bda": "开机启动",
"843ac7e15a5047a7": "确认导入旧版模型配置",
"844b8cc8dff7c1d8": "默认",
"864597982c308d72": "已开启静默启动",
"86de7c4ee8fa7689": "同步模型",
"8716e1344b0daddb": "Cursor 官方",
@@ -332,7 +333,6 @@
"d6b1f203680f5496": "留空使用 adaptive thinking",
"d766536c18e8e990": "插件运行时 {version} 已安装,可以开始使用插件。",
"d7e266bdc8064193": "分组名称",
"d86fa42c3848c680": "使用系统代理",
"d8c47e9776cf1082": "主菜单",
"d8c589c455675b46": "提示词设置已保存",
"da521d1c1cbd36af": "需要授权安装证书",
+1 -1
View File
@@ -120,7 +120,7 @@ export interface StatisticsStorage {
export type StatisticsStorageScope = "details" | "all";
export type ProxyMode = "system" | "custom";
export type ProxyMode = "default" | "custom";
export interface ProxySettings {
mode: ProxyMode;