]>
Commit | Line | Data |
---|---|---|
668951e2 DC |
1 | Ext.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 | 74 | }, |
a72024ab TL |
75 | { |
76 | xtype: 'proxmoxtextfield', | |
77 | name: 'scopes', | |
78 | fieldLabel: gettext('Scopes'), | |
79 | emptyText: `${Proxmox.Utils.defaultText} (email profile)`, | |
80 | submitEmpty: false, | |
81 | cbind: { | |
82 | deleteEmpty: '{!isCreate}', | |
83 | }, | |
84 | }, | |
381bc55b TL |
85 | { |
86 | xtype: 'proxmoxKVComboBox', | |
87 | name: 'prompt', | |
88 | fieldLabel: gettext('Prompt'), | |
89 | editable: true, | |
90 | emptyText: gettext('Auth-Provider Default'), | |
91 | comboItems: [ | |
92 | ['__default__', gettext('Auth-Provider Default')], | |
93 | ['none', 'none'], | |
94 | ['login', 'login'], | |
95 | ['consent', 'consent'], | |
96 | ['select_account', 'select_account'], | |
97 | ], | |
98 | cbind: { | |
99 | deleteEmpty: '{!isCreate}', | |
100 | }, | |
101 | }, | |
0bc02609 | 102 | ], |
668951e2 | 103 | |
c24be90e TL |
104 | advancedColumnB: [ |
105 | { | |
106 | xtype: 'proxmoxtextfield', | |
107 | name: 'acr-values', | |
108 | fieldLabel: gettext('ACR Values'), | |
109 | submitEmpty: false, | |
110 | cbind: { | |
111 | deleteEmpty: '{!isCreate}', | |
112 | }, | |
113 | }, | |
114 | ], | |
115 | ||
0bc02609 | 116 | initComponent: function() { |
668951e2 DC |
117 | let me = this; |
118 | ||
0bc02609 TL |
119 | if (me.type !== 'openid') { |
120 | throw 'invalid type'; | |
668951e2 DC |
121 | } |
122 | ||
0bc02609 | 123 | me.callParent(); |
668951e2 DC |
124 | }, |
125 | }); | |
126 |