]>
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
.authType
;
24 initComponent: function() {
27 if (!me
.column1
) { me
.column1
= []; }
28 if (!me
.column2
) { me
.column2
= []; }
29 if (!me
.columnB
) { me
.columnB
= []; }
31 // first field is name
33 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
35 fieldLabel
: gettext('Realm'),
40 // last field is default'
42 xtype
: 'proxmoxcheckbox',
43 fieldLabel
: gettext('Default'),
48 // last field of column2is tfa
50 xtype
: 'pveTFASelector',
56 fieldLabel
: gettext('Comment'),
63 Ext
.define('PVE.dc.AuthEditBase', {
64 extend
: 'Proxmox.window.Edit',
72 initComponent: function() {
75 me
.isCreate
= !me
.realm
;
78 me
.url
= '/api2/extjs/access/domains';
81 me
.url
= '/api2/extjs/access/domains/' + me
.realm
;
85 let authConfig
= PVE
.Utils
.authSchema
[me
.authType
];
87 throw 'unknown auth type';
88 } else if (!authConfig
.add
&& me
.isCreate
) {
89 throw 'trying to add non addable realm';
92 me
.subject
= authConfig
.name
;
97 xtype
: authConfig
.ipanel
,
98 isCreate
: me
.isCreate
,
107 success: function(response
, options
) {
108 var data
= response
.result
.data
|| {};
109 // just to be sure (should not happen)
110 if (data
.type
!== me
.authType
) {
112 throw "got wrong auth type";