* [pbs-devel] [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg
@ 2022-02-07 11:19 Matthias Heiserer
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 2/3] add english to translation enum for default-lang Matthias Heiserer
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Matthias Heiserer @ 2022-02-07 11:19 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
src/api2/node/config.rs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/api2/node/config.rs b/src/api2/node/config.rs
index c4af7b92..0a119354 100644
--- a/src/api2/node/config.rs
+++ b/src/api2/node/config.rs
@@ -62,6 +62,8 @@ pub enum DeletableProperty {
/// Delete the ciphers-tls-1.2 property.
#[serde(rename="ciphers-tls-1.2")]
ciphers_tls_1_2,
+ /// Delete the default-lang property.
+ default_lang,
}
#[api(
@@ -121,6 +123,7 @@ pub fn update_node_config(
DeletableProperty::email_from => { config.email_from = None; },
DeletableProperty::ciphers_tls_1_3 => { config.ciphers_tls_1_3 = 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.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.default_lang.is_some() { config.default_lang = update.default_lang; }
crate::config::node::save_config(&config)?;
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 2/3] add english to translation enum for default-lang
2022-02-07 11:19 [pbs-devel] [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Matthias Heiserer
@ 2022-02-07 11:19 ` Matthias Heiserer
2022-02-07 14:35 ` [pbs-devel] applied: " Thomas Lamprecht
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang Matthias Heiserer
2022-02-07 14:33 ` [pbs-devel] applied: [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Thomas Lamprecht
2 siblings, 1 reply; 6+ messages in thread
From: Matthias Heiserer @ 2022-02-07 11:19 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
src/config/node.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/config/node.rs b/src/config/node.rs
index a9b1e0d0..0ba87450 100644
--- a/src/config/node.rs
+++ b/src/config/node.rs
@@ -72,6 +72,8 @@ pub enum Translation {
Da,
/// German
De,
+ /// English
+ En,
/// Spanish
Es,
/// Euskera
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang
2022-02-07 11:19 [pbs-devel] [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Matthias Heiserer
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 2/3] add english to translation enum for default-lang Matthias Heiserer
@ 2022-02-07 11:19 ` Matthias Heiserer
2022-02-09 12:53 ` Dominik Csapak
2022-02-07 14:33 ` [pbs-devel] applied: [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Thomas Lamprecht
2 siblings, 1 reply; 6+ messages in thread
From: Matthias Heiserer @ 2022-02-07 11:19 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
---
www/config/NodeOptionView.js | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
index 64f3d792..24458058 100644
--- a/www/config/NodeOptionView.js
+++ b/www/config/NodeOptionView.js
@@ -42,7 +42,16 @@ Ext.define('PBS.NodeOptionView', {
vtype: 'proxmoxMail',
deleteEmpty: true,
},
-
+ {
+ xtype: 'combobox',
+ name: 'default-lang',
+ text: gettext('Default language'),
+ defaultValue: 'English',
+ // skip the 'default' item. It's not possible to delete the default
+ // language from the GUI, but setting it to 'en' has the same result
+ comboItems: Proxmox.Utils.language_array().slice(1),
+ deleteEmpty: true,
+ },
],
initComponent: function() {
--
2.30.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg
2022-02-07 11:19 [pbs-devel] [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Matthias Heiserer
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 2/3] add english to translation enum for default-lang Matthias Heiserer
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang Matthias Heiserer
@ 2022-02-07 14:33 ` Thomas Lamprecht
2 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2022-02-07 14:33 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Matthias Heiserer
On 07.02.22 12:19, Matthias Heiserer wrote:
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> src/api2/node/config.rs | 4 ++++
> 1 file changed, 4 insertions(+)
>
>
applied, thanks!
fyi: adapted the commit subject to "api: node config: add default-lang integration"
^ permalink raw reply [flat|nested] 6+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup 2/3] add english to translation enum for default-lang
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 2/3] add english to translation enum for default-lang Matthias Heiserer
@ 2022-02-07 14:35 ` Thomas Lamprecht
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2022-02-07 14:35 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Matthias Heiserer
On 07.02.22 12:19, Matthias Heiserer wrote:
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> src/config/node.rs | 2 ++
> 1 file changed, 2 insertions(+)
>
>
applied, prefixed "node config: " in the subject, having such short tags, for
human consumption (i.e., no file names copied verbatim please) can help when
browsing the history (e.g., on bisect, or to gather changelog) thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang Matthias Heiserer
@ 2022-02-09 12:53 ` Dominik Csapak
0 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2022-02-09 12:53 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Matthias Heiserer
On 2/7/22 12:19, Matthias Heiserer wrote:
> Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
> ---
> www/config/NodeOptionView.js | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
> index 64f3d792..24458058 100644
> --- a/www/config/NodeOptionView.js
> +++ b/www/config/NodeOptionView.js
> @@ -42,7 +42,16 @@ Ext.define('PBS.NodeOptionView', {
> vtype: 'proxmoxMail',
> deleteEmpty: true,
> },
> -
> + {
> + xtype: 'combobox',
> + name: 'default-lang',
> + text: gettext('Default language'),
> + defaultValue: 'English',
> + // skip the 'default' item. It's not possible to delete the default
> + // language from the GUI, but setting it to 'en' has the same result
> + comboItems: Proxmox.Utils.language_array().slice(1),
we can do better here, namely we can use '__default__' as the defaulValue.
the combobox handles this like an empty one and sends '"delete":"default-lang"' to
the backend
then, we should add the renderer too:
renderer: Proxmox.Utils.render_language
for now, this will not properly render '__default__', but
it should be easy to patch that in proxmox-widget-toolkit ;)
> + deleteEmpty: true,
> + },
> ],
>
> initComponent: function() {
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-02-09 12:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 11:19 [pbs-devel] [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Matthias Heiserer
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 2/3] add english to translation enum for default-lang Matthias Heiserer
2022-02-07 14:35 ` [pbs-devel] applied: " Thomas Lamprecht
2022-02-07 11:19 ` [pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang Matthias Heiserer
2022-02-09 12:53 ` Dominik Csapak
2022-02-07 14:33 ` [pbs-devel] applied: [PATCH proxmox-backup 1/3] API integration for default-lang in node-cfg Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal