]> git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/window/AuthEditOpenId.js
add generic OpenIDInputPanel
[proxmox-widget-toolkit.git] / src / window / AuthEditOpenId.js
1 Ext.define('Proxmox.panel.OpenIDInputPanel', {
2 extend: 'Proxmox.panel.InputPanel',
3 xtype: 'pmxAuthOpenIDPanel',
4 mixins: ['Proxmox.Mixin.CBind'],
5
6 type: 'openid',
7
8 onGetValues: function(values) {
9 let me = this;
10
11 if (me.isCreate) {
12 values.type = me.type;
13 }
14
15 return values;
16 },
17
18 columnT: [
19 {
20 xtype: 'textfield',
21 name: 'issuer-url',
22 fieldLabel: gettext('Issuer URL'),
23 allowBlank: false,
24 },
25 ],
26
27 column1: [
28 {
29 xtype: 'pmxDisplayEditField',
30 name: 'realm',
31 cbind: {
32 value: '{realm}',
33 editable: '{isCreate}',
34 },
35 fieldLabel: gettext('Realm'),
36 allowBlank: false,
37 },
38 {
39 xtype: 'proxmoxtextfield',
40 fieldLabel: gettext('Client ID'),
41 name: 'client-id',
42 allowBlank: false,
43 },
44 {
45 xtype: 'proxmoxtextfield',
46 fieldLabel: gettext('Client Key'),
47 cbind: {
48 deleteEmpty: '{!isCreate}',
49 },
50 name: 'client-key',
51 },
52 ],
53
54 column2: [
55 {
56 xtype: 'proxmoxcheckbox',
57 fieldLabel: gettext('Autocreate Users'),
58 name: 'autocreate',
59 value: 0,
60 cbind: {
61 deleteEmpty: '{!isCreate}',
62 },
63 },
64 {
65 xtype: 'pmxDisplayEditField',
66 name: 'username-claim',
67 editConfig: {
68 xtype: 'proxmoxKVComboBox',
69 },
70 cbind: {
71 value: get => get('isCreate') ? '__default__' : Proxmox.Utils.defaultText,
72 deleteEmpty: '{!isCreate}',
73 editable: '{isCreate}',
74 },
75 fieldLabel: gettext('Username Claim'),
76 comboItems: [
77 ['__default__', Proxmox.Utils.defaultText],
78 ['subject', 'subject'],
79 ['username', 'username'],
80 ['email', 'email'],
81 ],
82 },
83 ],
84
85 columnB: [
86 {
87 xtype: 'textfield',
88 name: 'comment',
89 fieldLabel: gettext('Comment'),
90 cbind: {
91 deleteEmpty: '{!isCreate}',
92 },
93 },
94 ],
95 });
96