[pbs-devel] [PATCH widget-toolkit v3 03/14] window: add panel for editing simple, built-in realms

Hannes Laimer h.laimer at proxmox.com
Mon Aug 19 16:18:54 CEST 2024


On Fri Aug 16, 2024 at 1:16 PM CEST, Christoph Heiss wrote:
> Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
> ---
> Changes v2 -> v3:
>   * no changes
>
> Changes v1 -> v2:
>   * no changes
>
>  src/Makefile                 |  1 +
>  src/window/AuthEditSimple.js | 41 ++++++++++++++++++++++++++++++++++++
>  2 files changed, 42 insertions(+)
>  create mode 100644 src/window/AuthEditSimple.js
>
> diff --git a/src/Makefile b/src/Makefile
> index 0478251..20ba77b 100644
> --- a/src/Makefile
> +++ b/src/Makefile
> @@ -97,6 +97,7 @@ JSSRC=					\
>  	window/AuthEditOpenId.js	\
>  	window/AuthEditLDAP.js		\
>  	window/AuthEditAD.js		\
> +	window/AuthEditSimple.js        \
>  	window/TfaWindow.js		\
>  	window/AddTfaRecovery.js	\
>  	window/AddTotp.js		\
> diff --git a/src/window/AuthEditSimple.js b/src/window/AuthEditSimple.js
> new file mode 100644
> index 0000000..22932c0
> --- /dev/null
> +++ b/src/window/AuthEditSimple.js
> @@ -0,0 +1,41 @@
> +Ext.define('Proxmox.panel.SimpleRealmInputPanel', {
> +    extend: 'Proxmox.panel.InputPanel',
> +    xtype: 'pmxAuthSimplePanel',
> +    mixins: ['Proxmox.Mixin.CBind'],
> +
> +    type: 'simple',
> +
> +    column1: [
> +	{
> +	    xtype: 'pmxDisplayEditField',
> +	    name: 'realm',
> +	    cbind: {
> +		value: '{realm}',
> +	    },
> +	    fieldLabel: gettext('Realm'),
> +	    allowBlank: false,
> +	},
> +	{
> +	    xtype: 'proxmoxcheckbox',
> +	    fieldLabel: gettext('Default realm'),
> +	    name: 'default',
> +	    value: 0,

nit:
this should include
```
cbind: {
    deleteEmpty: '{!isCreate}'
},
```
IIRC we don't send false, so it works because we PUT, but still

> +	    autoEl: {
> +		tag: 'div',
> +		'data-qtip': gettext('Set realm as default for login'),
> +	    },
> +	},
> +    ],
> +
> +    column2: [
> +    ],
> +
> +    columnB: [
> +	{
> +	    xtype: 'proxmoxtextfield',
> +	    name: 'comment',
> +	    fieldLabel: gettext('Comment'),
> +	},
> +    ],
> +});
> +





More information about the pbs-devel mailing list