]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/AuthEditBase.js
1 Ext
.define('PVE.panel.AuthBase', {
2 extend
: 'Proxmox.panel.InputPanel',
3 xtype
: 'pveAuthBasePanel',
7 onGetValues: function(values
) {
12 Proxmox
.Utils
.assemble_field_data(values
, { 'delete': 'port' });
18 values
.type
= me
.type
;
24 initComponent: function() {
27 let options
= PVE
.Utils
.authSchema
[me
.type
];
29 if (!me
.column1
) { me
.column1
= []; }
30 if (!me
.column2
) { me
.column2
= []; }
31 if (!me
.columnB
) { me
.columnB
= []; }
33 // first field is name
35 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
37 fieldLabel
: gettext('Realm'),
42 // last field is default'
44 xtype
: 'proxmoxcheckbox',
45 fieldLabel
: gettext('Default'),
51 // last field of column2is tfa
53 xtype
: 'pveTFASelector',
54 deleteEmpty
: !me
.isCreate
,
61 fieldLabel
: gettext('Comment'),
68 Ext
.define('PVE.dc.AuthEditBase', {
69 extend
: 'Proxmox.window.Edit',
71 onlineHelp
: 'pveum_authentication_realms',
79 initComponent: function() {
82 me
.isCreate
= !me
.realm
;
85 me
.url
= '/api2/extjs/access/domains';
88 me
.url
= '/api2/extjs/access/domains/' + me
.realm
;
92 let authConfig
= PVE
.Utils
.authSchema
[me
.authType
];
94 throw 'unknown auth type';
95 } else if (!authConfig
.add
&& me
.isCreate
) {
96 throw 'trying to add non addable realm';
99 me
.subject
= authConfig
.name
;
103 if (authConfig
.syncipanel
) {
112 title
: gettext('General'),
114 xtype
: authConfig
.ipanel
,
115 isCreate
: me
.isCreate
,
119 title
: gettext('Sync Options'),
121 xtype
: authConfig
.syncipanel
,
122 isCreate
: me
.isCreate
,
130 xtype
: authConfig
.ipanel
,
131 isCreate
: me
.isCreate
,
145 success: function(response
, options
) {
146 var data
= response
.result
.data
|| {};
147 // just to be sure (should not happen)
148 if (data
.type
!== me
.authType
) {
150 throw "got wrong auth type";