[pbs-devel] [PATCH v7 proxmox-backup 24/31] ui: group filter: allow to set namespace for local datastore
Christian Ebner
c.ebner at proxmox.com
Mon Nov 11 16:43:46 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 6:
- no changes
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