api: node config: add default-lang integration

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Matthias Heiserer 2022-02-07 12:19:01 +01:00 committed by Thomas Lamprecht
parent e7668a3eea
commit 5ffa68d2c4

View File

@ -62,6 +62,8 @@ pub enum DeletableProperty {
/// Delete the ciphers-tls-1.2 property. /// Delete the ciphers-tls-1.2 property.
#[serde(rename="ciphers-tls-1.2")] #[serde(rename="ciphers-tls-1.2")]
ciphers_tls_1_2, ciphers_tls_1_2,
/// Delete the default-lang property.
default_lang,
} }
#[api( #[api(
@ -121,6 +123,7 @@ pub fn update_node_config(
DeletableProperty::email_from => { config.email_from = None; }, DeletableProperty::email_from => { config.email_from = None; },
DeletableProperty::ciphers_tls_1_3 => { config.ciphers_tls_1_3 = None; }, DeletableProperty::ciphers_tls_1_3 => { config.ciphers_tls_1_3 = None; },
DeletableProperty::ciphers_tls_1_2 => { config.ciphers_tls_1_2 = None; }, DeletableProperty::ciphers_tls_1_2 => { config.ciphers_tls_1_2 = None; },
DeletableProperty::default_lang => { config.default_lang = None; },
} }
} }
} }
@ -135,6 +138,7 @@ pub fn update_node_config(
if update.email_from.is_some() { config.email_from = update.email_from; } if update.email_from.is_some() { config.email_from = update.email_from; }
if update.ciphers_tls_1_3.is_some() { config.ciphers_tls_1_3 = update.ciphers_tls_1_3; } if update.ciphers_tls_1_3.is_some() { config.ciphers_tls_1_3 = update.ciphers_tls_1_3; }
if update.ciphers_tls_1_2.is_some() { config.ciphers_tls_1_2 = update.ciphers_tls_1_2; } if update.ciphers_tls_1_2.is_some() { config.ciphers_tls_1_2 = update.ciphers_tls_1_2; }
if update.default_lang.is_some() { config.default_lang = update.default_lang; }
crate::config::node::save_config(&config)?; crate::config::node::save_config(&config)?;