use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct SystemProxySettings { pub enabled: bool, pub proxy_url: Option, } #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)] #[serde(rename_all = "snake_case")] pub enum AppLocale { #[default] En, ZhCn, ZhTw, Ja, Ko, Es, De, Fr, Pt, Ar, } #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)] #[serde(rename_all = "snake_case")] pub enum LanguageMode { #[default] System, Manual, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] #[serde(default)] pub struct SystemLanguageSettings { pub mode: LanguageMode, pub language: AppLocale, } // --- Version Control --- /// Explicit credentials for a single git remote operation. #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GitCredentials { pub username: String, pub password: String, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GitDetectResult { pub installed: bool, pub version: Option, pub path: Option, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] #[serde(default)] pub struct GitSettings { pub custom_path: Option, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GitHubAccount { pub id: String, pub server_url: String, pub username: String, pub scopes: Vec, pub avatar_url: Option, pub is_default: bool, pub created_at: String, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] #[serde(default)] pub struct GitHubAccountsSettings { pub accounts: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct GitHubTokenValidation { pub success: bool, pub username: Option, pub scopes: Vec, pub avatar_url: Option, pub message: Option, }