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 committed 2026-09-03 16:32:02 +08:00
1 parent 924b5e5926
commit 8942287a27
12 files changed
+179 -38

No files matched your search

+20 -1
View File
@@ -27,7 +27,7 @@ pub struct PortSettings {
#[serde(rename_all = "snake_case")]
pub enum ProxyMode {
#[default]
System,
Default,
Custom,
}
@@ -362,3 +362,22 @@ impl Store {
Ok(settings)
}
}
#[cfg(test)]
mod tests {
use super::ProxyMode;
#[test]
fn default_proxy_mode_uses_the_default_wire_value() {
assert_eq!(ProxyMode::default(), ProxyMode::Default);
assert_eq!(
serde_json::to_string(&ProxyMode::default()).unwrap(),
"\"default\""
);
assert_eq!(
serde_json::from_str::<ProxyMode>("\"default\"").unwrap(),
ProxyMode::Default
);
assert!(serde_json::from_str::<ProxyMode>("\"system\"").is_err());
}
}