]> git.proxmox.com Git - pve-manager.git/blame - www/manager6/dc/AuthEditOpenId.js
ui: openID: make username-claim field editable for arbitrary values
[pve-manager.git] / www / manager6 / dc / AuthEditOpenId.js
CommitLineData
668951e2
DC
1Ext.define('PVE.panel.OpenIDInputPanel', {
2 extend: 'PVE.panel.AuthBase',
3 xtype: 'pveAuthOpenIDPanel',
0bc02609 4 mixins: ['Proxmox.Mixin.CBind'],
668951e2 5
0bc02609 6 onGetValues: function(values) {
668951e2
DC
7 let me = this;
8
0bc02609
TL
9 if (!values.verify) {
10 if (!me.isCreate) {
11 Proxmox.Utils.assemble_field_data(values, { 'delete': 'verify' });
12 }
13 delete values.verify;
668951e2
DC
14 }
15
0bc02609
TL
16 return me.callParent([values]);
17 },
668951e2 18
0bc02609
TL
19 columnT: [
20 {
21 xtype: 'textfield',
22 name: 'issuer-url',
23 fieldLabel: gettext('Issuer URL'),
24 allowBlank: false,
25 },
26 ],
27
28 column1: [
29 {
30 xtype: 'proxmoxtextfield',
31 fieldLabel: gettext('Client ID'),
32 name: 'client-id',
33 allowBlank: false,
34 },
35 {
36 xtype: 'proxmoxtextfield',
37 fieldLabel: gettext('Client Key'),
38 cbind: {
39 deleteEmpty: '{!isCreate}',
668951e2 40 },
0bc02609
TL
41 name: 'client-key',
42 },
43 ],
668951e2 44
0bc02609
TL
45 column2: [
46 {
47 xtype: 'proxmoxcheckbox',
48 fieldLabel: gettext('Autocreate Users'),
49 name: 'autocreate',
50 value: 0,
51 cbind: {
52 deleteEmpty: '{!isCreate}',
668951e2 53 },
0bc02609
TL
54 },
55 {
56 xtype: 'pmxDisplayEditField',
57 name: 'username-claim',
41a58b35 58 fieldLabel: gettext('Username Claim'),
0bc02609
TL
59 editConfig: {
60 xtype: 'proxmoxKVComboBox',
41a58b35
TL
61 editable: true,
62 comboItems: [
63 ['__default__', Proxmox.Utils.defaultText],
64 ['subject', 'subject'],
65 ['username', 'username'],
66 ['email', 'email'],
67 ],
c2cd0c9e 68 },
0bc02609
TL
69 cbind: {
70 value: get => get('isCreate') ? '__default__' : Proxmox.Utils.defaultText,
71 deleteEmpty: '{!isCreate}',
72 editable: '{isCreate}',
73 },
0bc02609
TL
74 },
75 ],
668951e2 76
0bc02609 77 initComponent: function() {
668951e2
DC
78 let me = this;
79
0bc02609
TL
80 if (me.type !== 'openid') {
81 throw 'invalid type';
668951e2
DC
82 }
83
0bc02609 84 me.callParent();
668951e2
DC
85 },
86});
87