]> git.proxmox.com Git - proxmox-widget-toolkit.git/blame - src/window/AuthEditOpenId.js
ui: OpenID realm: allow to edit scopes
[proxmox-widget-toolkit.git] / src / window / AuthEditOpenId.js
CommitLineData
8f30708d
DC
1Ext.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',
c860b349 67 fieldLabel: gettext('Username Claim'),
8f30708d
DC
68 editConfig: {
69 xtype: 'proxmoxKVComboBox',
c860b349
TL
70 editable: true,
71 comboItems: [
72 ['__default__', Proxmox.Utils.defaultText],
73 ['subject', 'subject'],
74 ['username', 'username'],
75 ['email', 'email'],
76 ],
8f30708d
DC
77 },
78 cbind: {
79 value: get => get('isCreate') ? '__default__' : Proxmox.Utils.defaultText,
80 deleteEmpty: '{!isCreate}',
81 editable: '{isCreate}',
82 },
8f30708d 83 },
0dce277c
TL
84 {
85 xtype: 'proxmoxtextfield',
86 name: 'scopes',
87 fieldLabel: gettext('Scopes'),
88 emptyText: `${Proxmox.Utils.defaultText} (email profile)`,
89 submitEmpty: false,
90 cbind: {
91 deleteEmpty: '{!isCreate}',
92 },
93 },
8f30708d
DC
94 ],
95
96 columnB: [
97 {
98 xtype: 'textfield',
99 name: 'comment',
100 fieldLabel: gettext('Comment'),
101 cbind: {
102 deleteEmpty: '{!isCreate}',
103 },
104 },
105 ],
106});
107