]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/window/AuthEditBase.js
1 Ext
.define('Proxmox.window.AuthEditBase', {
2 extend
: 'Proxmox.window.Edit',
10 baseurl
: '/access/domains',
13 initComponent: function() {
16 me
.isCreate
= !me
.realm
;
18 me
.url
= `/api2/extjs${me.baseUrl}`;
19 if (me
.useTypeInUrl
) {
20 me
.url
+= `/${me.authType}`;
26 me
.url
+= `/${me.realm}`;
30 let authConfig
= Proxmox
.Schema
.authDomains
[me
.authType
];
32 throw 'unknown auth type';
33 } else if (!authConfig
.add
&& me
.isCreate
) {
34 throw 'trying to add non addable realm';
37 me
.subject
= authConfig
.name
;
41 if (authConfig
.syncipanel
) {
50 title
: gettext('General'),
52 xtype
: authConfig
.ipanel
,
53 isCreate
: me
.isCreate
,
57 title
: gettext('Sync Options'),
59 xtype
: authConfig
.syncipanel
,
60 isCreate
: me
.isCreate
,
68 xtype
: authConfig
.ipanel
,
69 isCreate
: me
.isCreate
,
83 success: function(response
, options
) {
84 var data
= response
.result
.data
|| {};
85 // just to be sure (should not happen)
86 // only check this when the type is not in the api path
87 if (!me
.useTypeInUrl
&& data
.type
!== me
.authType
) {
89 throw "got wrong auth type";