[pbs-devel] [PATCH proxmox-backup 3/3] fix #3939: ui: default realm setting in NodeOptionView

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Apr 11 10:13:36 CEST 2022


On 23.03.22 14:01, Matthias Heiserer wrote:
> Again, different than we do it in PVE, because default-realm
> is stored in node.cfg.
> 

While this patch may be obsolete in the current form with my bz comment and
review on the backend, still some notes.

> Signed-off-by: Matthias Heiserer <m.heiserer at proxmox.com>
> ---
>  www/config/NodeOptionView.js | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
> index bb12513b..f3652a53 100644
> --- a/www/config/NodeOptionView.js
> +++ b/www/config/NodeOptionView.js
> @@ -53,8 +53,31 @@ Ext.define('PBS.NodeOptionView', {
>  	},
>      ],
>  
> +    add_pmxRealmComboBox_row: function(name, text, opts) {

I'd figure that camels and snakes don't mix well, at least in casing style ;-)

But in general: this is unnecessary, as currently used you can just add another
static entry in the `gridRows` array, and if the user of this whole component
needs to be able to config something (which they ain't with your approach, but
it feels like that was the aim?) a simple (c)bind can avoid such intermediate
creation helper.

> +	let me = this;
> +	opts = opts || {};
> +	me.rows = me.rows || {};
> +	me.rows[name] = {
> +	    required: true,
> +	    header: text,
> +	    defaultValue: opts.defaultValue,
> +	    renderer: opts.renderer,
> +	    editor: {
> +		xtype: 'proxmoxWindowEdit',
> +		subject: text,
> +		items: {
> +		    xtype: 'pmxRealmComboBox',
> +		    name: name,
> +		},
> +	    },
> +	};
> +    },
> +
>      initComponent: function() {
>  	let me = this;
> +	me.add_pmxRealmComboBox_row('default-realm', gettext('Default realm'), {
> +	    defaultValue: 'pam',
> +	});
>  
>  	me.callParent();
>  






More information about the pbs-devel mailing list