add schema and move authDomains there

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-07-09 16:11:19 +02:00
parent 8f30708d44
commit 5c085daf0b
3 changed files with 28 additions and 24 deletions

View File

@ -8,6 +8,7 @@ MARKEDJS=/usr/share/javascript/marked/marked.min.js
JSSRC= \
Utils.js \
Schema.js \
Toolkit.js \
Logo.js \
Parser.js \

27
src/Schema.js Normal file
View File

@ -0,0 +1,27 @@
Ext.define('Proxmox.Schema', { // a singleton
singleton: true,
authDomains: {
pam: {
name: 'Linux PAM',
add: false,
edit: false,
pwchange: true,
},
openid: {
name: gettext('OpenID Connect Server'),
ipanel: 'pmxAuthOpenIDPanel',
add: true,
edit: true,
tfa: false,
pwchange: false,
iconCls: 'pmx-itype-icon-openid-logo',
},
},
// to add or change existing for product specific ones
overrideAuthDomains: function(extra) {
for (const [key, value] of Object.entries(extra)) {
Proxmox.Utils.authSchema[key] = value;
}
},
});

View File

@ -1151,30 +1151,6 @@ utilities: {
return icon;
},
authSchema: {
pam: {
name: 'Linux PAM',
add: false,
edit: false,
pwchange: true,
},
openid: {
name: gettext('OpenID Connect Server'),
ipanel: 'pmxAuthOpenIDPanel',
add: true,
edit: true,
tfa: false,
pwchange: false,
iconCls: 'pmx-itype-icon-openid-logo',
},
},
// to add or change existing for product specific ones
overrideAuthSchema: function(extra) {
for (const [key, value] of Object.entries(extra)) {
Proxmox.Utils.authSchema[key] = value;
}
},
},
singleton: true,