[pbs-devel] [PATCH v6 proxmox-backup 22/29] ui: group filter: allow to set namespace for local datastore

Christian Ebner c.ebner at proxmox.com
Thu Oct 31 13:15:12 CET 2024


The namespace has to be set in order to get the correct groups to be
used as group filter options with a local datastore as source,
required for sync jobs in push direction.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 5:
- move namespace checks closer to api method url, showing their
  dependence more clearly

 www/form/GroupFilter.js | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/www/form/GroupFilter.js b/www/form/GroupFilter.js
index c9c2d913e..22f889752 100644
--- a/www/form/GroupFilter.js
+++ b/www/form/GroupFilter.js
@@ -252,14 +252,17 @@ Ext.define('PBS.form.GroupFilter', {
 	let url;
 	if (me.remote) {
 	    url = `/api2/json/config/remote/${me.remote}/scan/${me.datastore}/groups`;
+	    if (me.namespace) {
+		url += `?namespace=${me.namespace}`;
+	    }
 	} else if (me.datastore) {
 	    url = `/api2/json/admin/datastore/${me.datastore}/groups`;
+	    if (me.namespace) {
+		url += `?ns=${me.namespace}`;
+	    }
 	} else {
 	    return;
 	}
-	if (me.namespace) {
-	    url += `?namespace=${me.namespace}`;
-	}
 	me.setDsStoreUrl(url);
 	me.dsStore.load({
 	    callback: (records) => {
@@ -279,6 +282,18 @@ Ext.define('PBS.form.GroupFilter', {
 	}
 	me.remote = undefined;
 	me.datastore = datastore;
+	me.namespace = undefined;
+	me.updateGroupSelectors();
+    },
+
+    setLocalNamespace: function(datastore, namespace) {
+	let me = this;
+	if (me.datastore === datastore && me.namespace === namespace) {
+	    return;
+	}
+	me.remote = undefined;
+	me.datastore = datastore;
+	me.namespace = namespace;
 	me.updateGroupSelectors();
     },
 
-- 
2.39.5





More information about the pbs-devel mailing list