[pve-devel] [PATCH manager 2/6] ui: dc/Auth*: refactor AuthEdit

Thomas Lamprecht t.lamprecht at proxmox.com
Sun Apr 26 13:39:40 CEST 2020


On 4/9/20 4:10 PM, Dominik Csapak wrote:
> diff --git a/www/manager6/dc/AuthEditBase.js b/www/manager6/dc/AuthEditBase.js
> new file mode 100644
> index 00000000..5c4b6a90
> --- /dev/null
> +++ b/www/manager6/dc/AuthEditBase.js
> @@ -0,0 +1,120 @@
> +Ext.define('PVE.panel.AuthBase', {
> +    extend: 'Proxmox.panel.InputPanel',
> +    xtype: 'pveAuthBasePanel',
> +
> +    type: '',
> +
> +    onGetValues: function(values) {
> +	let me = this;
> +
> +	if (!values.port) {
> +	    if (!me.isCreate) {
> +		Proxmox.Utils.assemble_field_data(values, { 'delete': 'port' });
> +	    }
> +	    delete values.port;
> +	}
> +
> +	if (me.isCreate) {
> +	    values.type = me.authType;

this broke addition of new realms, here it's me.type not authType as you used
below in the edit window. Further, a fix for manager 1/6 was required to make
create fully work again - "tfa" field mustn't be deleted-if-empty in the create
case.


> +	}
> +
> +	return values;
> +    },
> +

> +
> +Ext.define('PVE.dc.AuthEditBase', {
> +    extend: 'Proxmox.window.Edit',
> +
> ...
> +
> +	Ext.apply(me, {
> +	    items: [{
> +		realm: me.realm,
> +		xtype: authConfig.ipanel,
> +		isCreate: me.isCreate,
> +		type: me.authType,
> +	    }],
> +	});
> +
> +	me.callParent();
> +





More information about the pve-devel mailing list