panel: AuthView: make useTypeInUrl property per-realm

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
This commit is contained in:
Christoph Heiss 2024-08-23 13:07:22 +02:00 committed by Thomas Lamprecht
parent 3822a031dd
commit be8cb1efb4
2 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@ Ext.define('Proxmox.Schema', { // a singleton
edit: false,
pwchange: true,
sync: false,
useTypeInUrl: false,
},
openid: {
name: gettext('OpenID Connect Server'),
@ -18,6 +19,7 @@ Ext.define('Proxmox.Schema', { // a singleton
pwchange: false,
sync: false,
iconCls: 'pmx-itype-icon-openid-logo',
useTypeInUrl: true,
},
ldap: {
name: gettext('LDAP Server'),
@ -28,6 +30,7 @@ Ext.define('Proxmox.Schema', { // a singleton
tfa: true,
pwchange: false,
sync: true,
useTypeInUrl: true,
},
ad: {
name: gettext('Active Directory Server'),
@ -38,6 +41,7 @@ Ext.define('Proxmox.Schema', { // a singleton
tfa: true,
pwchange: false,
sync: true,
useTypeInUrl: true,
},
},
// to add or change existing for product specific ones

View File

@ -11,7 +11,6 @@ Ext.define('Proxmox.panel.AuthView', {
},
baseUrl: '/access/domains',
useTypeInUrl: false,
columns: [
{
@ -45,9 +44,11 @@ Ext.define('Proxmox.panel.AuthView', {
openEditWindow: function(authType, realm) {
let me = this;
const { useTypeInUrl } = Proxmox.Schema.authDomains[authType];
Ext.create('Proxmox.window.AuthEditBase', {
baseUrl: me.baseUrl,
useTypeInUrl: me.useTypeInUrl,
useTypeInUrl,
authType,
realm,
listeners: {
@ -123,7 +124,7 @@ Ext.define('Proxmox.panel.AuthView', {
xtype: 'proxmoxStdRemoveButton',
getUrl: (rec) => {
let url = me.baseUrl;
if (me.useTypeInUrl) {
if (Proxmox.Schema.authDomains[rec.data.type].useTypeInUrl) {
url += `/${rec.get('type')}`;
}
url += `/${rec.getId()}`;