[pbs-devel] [PATCH proxmox-backup 3/3] GUI option for node.cfg default-lang

Dominik Csapak d.csapak at proxmox.com
Wed Feb 9 13:53:38 CET 2022


On 2/7/22 12:19, Matthias Heiserer wrote:
> Signed-off-by: Matthias Heiserer <m.heiserer at 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() {






More information about the pbs-devel mailing list