]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
panel/AuthView: handle different baseUrls for configuring realms
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 12 Jul 2021 07:48:03 +0000 (09:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Jul 2021 07:50:24 +0000 (09:50 +0200)
we need that for pbs.

also give the option to use the type in the path, like in AuthEditBase

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/panel/AuthView.js

index 9bd9b3f4292f9fb613922096662919133b993933..781e84eaf2e63bc702c55c3ea5dd89c9fad47e02 100644 (file)
@@ -10,6 +10,9 @@ Ext.define('Proxmox.panel.AuthView', {
        trackOver: false,
     },
 
+    baseUrl: '/access/domains',
+    useTypeInUrl: false,
+
     columns: [
        {
            header: gettext('Realm'),
@@ -43,6 +46,8 @@ Ext.define('Proxmox.panel.AuthView', {
     openEditWindow: function(authType, realm) {
        let me = this;
        Ext.create('Proxmox.window.AuthEditBase', {
+           baseUrl: me.baseUrl,
+           useTypeInUrl: me.useTypeInUrl,
            authType,
            realm,
            listeners: {
@@ -99,7 +104,14 @@ Ext.define('Proxmox.panel.AuthView', {
            },
            {
                xtype: 'proxmoxStdRemoveButton',
-               baseurl: '/access/domains/',
+               getUrl: (rec) => {
+                   let url = me.baseUrl;
+                   if (me.useTypeInUrl) {
+                       url += `/${rec.get('type')}`;
+                   }
+                   url += `/${rec.getId()}`;
+                   return url;
+               },
                enableFn: (rec) => Proxmox.Schema.authDomains[rec.data.type].add,
                callback: () => me.reload(),
            },