pve-manager/www/manager6/dc/AuthEditOpenId.js
Thomas Lamprecht 0bc0260983 ui: dc/auth: refactor openID edit window to be more static
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-03 16:31:43 +02:00

87 lines
1.6 KiB
JavaScript

Ext.define('PVE.panel.OpenIDInputPanel', {
extend: 'PVE.panel.AuthBase',
xtype: 'pveAuthOpenIDPanel',
mixins: ['Proxmox.Mixin.CBind'],
onGetValues: function(values) {
let me = this;
if (!values.verify) {
if (!me.isCreate) {
Proxmox.Utils.assemble_field_data(values, { 'delete': 'verify' });
}
delete values.verify;
}
return me.callParent([values]);
},
columnT: [
{
xtype: 'textfield',
name: 'issuer-url',
fieldLabel: gettext('Issuer URL'),
allowBlank: false,
},
],
column1: [
{
xtype: 'proxmoxtextfield',
fieldLabel: gettext('Client ID'),
name: 'client-id',
allowBlank: false,
},
{
xtype: 'proxmoxtextfield',
fieldLabel: gettext('Client Key'),
cbind: {
deleteEmpty: '{!isCreate}',
},
name: 'client-key',
},
],
column2: [
{
xtype: 'proxmoxcheckbox',
fieldLabel: gettext('Autocreate Users'),
name: 'autocreate',
value: 0,
cbind: {
deleteEmpty: '{!isCreate}',
},
},
{
xtype: 'pmxDisplayEditField',
name: 'username-claim',
editConfig: {
xtype: 'proxmoxKVComboBox',
},
cbind: {
value: get => get('isCreate') ? '__default__' : Proxmox.Utils.defaultText,
deleteEmpty: '{!isCreate}',
editable: '{isCreate}',
},
fieldLabel: gettext('Username Claim'),
comboItems: [
['__default__', Proxmox.Utils.defaultText],
['subject', 'subject'],
['username', 'username'],
['email', 'email'],
],
},
],
initComponent: function() {
let me = this;
if (me.type !== 'openid') {
throw 'invalid type';
}
me.callParent();
},
});