设置界面支持版本控制和github账号管理

This commit is contained in:
itpkcn@gmail.com
2026-03-21 11:33:48 +08:00
parent e801f041a0
commit 62fab2c3f2
22 changed files with 1595 additions and 4 deletions

View File

@@ -12,4 +12,7 @@ pub use conversation::{
};
pub use folder::{FolderCommandInfo, FolderDetail, FolderHistoryEntry, OpenedConversation};
pub use message::{ContentBlock, MessageRole, MessageTurn, TurnRole, TurnUsage, UnifiedMessage};
pub use system::{SystemLanguageSettings, SystemProxySettings};
pub use system::{
GitDetectResult, GitHubAccountsSettings, GitHubTokenValidation, GitSettings,
SystemLanguageSettings, SystemProxySettings,
};

View File

@@ -36,3 +36,45 @@ pub struct SystemLanguageSettings {
pub mode: LanguageMode,
pub language: AppLocale,
}
// --- Version Control ---
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GitDetectResult {
pub installed: bool,
pub version: Option<String>,
pub path: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default)]
pub struct GitSettings {
pub custom_path: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GitHubAccount {
pub id: String,
pub server_url: String,
pub username: String,
pub token: String,
pub scopes: Vec<String>,
pub avatar_url: Option<String>,
pub is_default: bool,
pub created_at: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(default)]
pub struct GitHubAccountsSettings {
pub accounts: Vec<GitHubAccount>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GitHubTokenValidation {
pub success: bool,
pub username: Option<String>,
pub scopes: Vec<String>,
pub avatar_url: Option<String>,
pub message: Option<String>,
}