mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 22:00:31 +00:00
Add i18n support, PyPI proxy, and UI improvements
- Add Russian/English language switcher with cookie persistence - Add PyPI proxy support with caching (like npm) - Add height limits to Activity Log and Mount Points tables - Change Cargo icon to delivery truck - Replace graphical logo with styled text "NORA" - Bump version to 0.2.11
This commit is contained in:
@@ -11,6 +11,8 @@ pub struct Config {
|
||||
#[serde(default)]
|
||||
pub npm: NpmConfig,
|
||||
#[serde(default)]
|
||||
pub pypi: PypiConfig,
|
||||
#[serde(default)]
|
||||
pub auth: AuthConfig,
|
||||
}
|
||||
|
||||
@@ -68,6 +70,14 @@ pub struct NpmConfig {
|
||||
pub proxy_timeout: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PypiConfig {
|
||||
#[serde(default)]
|
||||
pub proxy: Option<String>,
|
||||
#[serde(default = "default_timeout")]
|
||||
pub proxy_timeout: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct AuthConfig {
|
||||
#[serde(default)]
|
||||
@@ -108,6 +118,15 @@ impl Default for NpmConfig {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PypiConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
proxy: Some("https://pypi.org/simple/".to_string()),
|
||||
proxy_timeout: 30,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AuthConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
@@ -190,6 +209,16 @@ impl Config {
|
||||
}
|
||||
}
|
||||
|
||||
// PyPI config
|
||||
if let Ok(val) = env::var("NORA_PYPI_PROXY") {
|
||||
self.pypi.proxy = if val.is_empty() { None } else { Some(val) };
|
||||
}
|
||||
if let Ok(val) = env::var("NORA_PYPI_PROXY_TIMEOUT") {
|
||||
if let Ok(timeout) = val.parse() {
|
||||
self.pypi.proxy_timeout = timeout;
|
||||
}
|
||||
}
|
||||
|
||||
// Token storage
|
||||
if let Ok(val) = env::var("NORA_AUTH_TOKEN_STORAGE") {
|
||||
self.auth.token_storage = val;
|
||||
@@ -212,6 +241,7 @@ impl Default for Config {
|
||||
},
|
||||
maven: MavenConfig::default(),
|
||||
npm: NpmConfig::default(),
|
||||
pypi: PypiConfig::default(),
|
||||
auth: AuthConfig::default(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user