[pve-devel] [RFC PATCH manager 3/4] ui: data/PermPathStore: load list of groups to show their path

Dominik Csapak d.csapak at proxmox.com
Thu Jun 17 15:32:02 CEST 2021


tries to load the list of defined groups and adds them to the store

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
also not really sure about it either, if we save the realmlist, maybe
the grouplist too? or as i already wrote, load the realmlist everytime
too?

 www/manager6/data/PermPathStore.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/www/manager6/data/PermPathStore.js b/www/manager6/data/PermPathStore.js
index f55257cc..c1c52b75 100644
--- a/www/manager6/data/PermPathStore.js
+++ b/www/manager6/data/PermPathStore.js
@@ -83,5 +83,25 @@ Ext.define('PVE.data.PermPathStore', {
 	    property: 'value',
 	    direction: 'ASC',
 	});
+
+	Proxmox.Utils.API2Request({
+	    url: `/access/groups`,
+	    success: function(response) {
+		me.suspendEvents();
+		response.result.data.forEach((group) => {
+		    me.add({
+			value: `/access/groups/${group.groupid}`,
+		    });
+		});
+		me.resumeEvents();
+
+		me.fireEvent('refresh', me);
+		me.fireEvent('datachanged', me);
+		me.sort({
+			property: 'value',
+			direction: 'ASC',
+		});
+	    },
+	});
     },
 });
-- 
2.20.1






More information about the pve-devel mailing list