[pbs-devel] [PATCH widget-toolkit 2/2] panel/AuthView: handle different baseUrls for configuring realms

Dominik Csapak d.csapak at proxmox.com
Mon Jul 12 09:48:03 CEST 2021


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 at proxmox.com>
---
 src/panel/AuthView.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/panel/AuthView.js b/src/panel/AuthView.js
index 9bd9b3f..781e84e 100644
--- a/src/panel/AuthView.js
+++ b/src/panel/AuthView.js
@@ -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(),
 	    },
-- 
2.30.2






More information about the pbs-devel mailing list