mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-29 01:01:14 +00:00
add generic OpenIDInputPanel
mostly copied from pve, but includes a realm displayeditfield as well as the comment field in contrast to the inputpanel in PVE, this is not extended from a base input panel (where in pve the comment/realm/default/etc. fields come from) we do this, since not all products can define a default or tfa Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
c159449543
commit
8f30708d44
@ -73,6 +73,7 @@ JSSRC= \
|
|||||||
window/ACMEDomains.js \
|
window/ACMEDomains.js \
|
||||||
window/FileBrowser.js \
|
window/FileBrowser.js \
|
||||||
window/AuthEditBase.js \
|
window/AuthEditBase.js \
|
||||||
|
window/AuthEditOpenId.js \
|
||||||
node/APT.js \
|
node/APT.js \
|
||||||
node/APTRepositories.js \
|
node/APTRepositories.js \
|
||||||
node/NetworkEdit.js \
|
node/NetworkEdit.js \
|
||||||
|
@ -1158,6 +1158,15 @@ utilities: {
|
|||||||
edit: false,
|
edit: false,
|
||||||
pwchange: true,
|
pwchange: true,
|
||||||
},
|
},
|
||||||
|
openid: {
|
||||||
|
name: gettext('OpenID Connect Server'),
|
||||||
|
ipanel: 'pmxAuthOpenIDPanel',
|
||||||
|
add: true,
|
||||||
|
edit: true,
|
||||||
|
tfa: false,
|
||||||
|
pwchange: false,
|
||||||
|
iconCls: 'pmx-itype-icon-openid-logo',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// to add or change existing for product specific ones
|
// to add or change existing for product specific ones
|
||||||
|
96
src/window/AuthEditOpenId.js
Normal file
96
src/window/AuthEditOpenId.js
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
Ext.define('Proxmox.panel.OpenIDInputPanel', {
|
||||||
|
extend: 'Proxmox.panel.InputPanel',
|
||||||
|
xtype: 'pmxAuthOpenIDPanel',
|
||||||
|
mixins: ['Proxmox.Mixin.CBind'],
|
||||||
|
|
||||||
|
type: 'openid',
|
||||||
|
|
||||||
|
onGetValues: function(values) {
|
||||||
|
let me = this;
|
||||||
|
|
||||||
|
if (me.isCreate) {
|
||||||
|
values.type = me.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
return values;
|
||||||
|
},
|
||||||
|
|
||||||
|
columnT: [
|
||||||
|
{
|
||||||
|
xtype: 'textfield',
|
||||||
|
name: 'issuer-url',
|
||||||
|
fieldLabel: gettext('Issuer URL'),
|
||||||
|
allowBlank: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
column1: [
|
||||||
|
{
|
||||||
|
xtype: 'pmxDisplayEditField',
|
||||||
|
name: 'realm',
|
||||||
|
cbind: {
|
||||||
|
value: '{realm}',
|
||||||
|
editable: '{isCreate}',
|
||||||
|
},
|
||||||
|
fieldLabel: gettext('Realm'),
|
||||||
|
allowBlank: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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'],
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
|
||||||
|
columnB: [
|
||||||
|
{
|
||||||
|
xtype: 'textfield',
|
||||||
|
name: 'comment',
|
||||||
|
fieldLabel: gettext('Comment'),
|
||||||
|
cbind: {
|
||||||
|
deleteEmpty: '{!isCreate}',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user