public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector
@ 2021-06-17 13:32 Dominik Csapak
  2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 2/4] ui: data/PermPathStore: show/load acl paths for realms Dominik Csapak
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Dominik Csapak @ 2021-06-17 13:32 UTC (permalink / raw)
  To: pve-devel

those two static acl paths were missing in the selector

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/data/PermPathStore.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/www/manager6/data/PermPathStore.js b/www/manager6/data/PermPathStore.js
index 051da3cf..1dc276b6 100644
--- a/www/manager6/data/PermPathStore.js
+++ b/www/manager6/data/PermPathStore.js
@@ -6,6 +6,8 @@ Ext.define('PVE.data.PermPathStore', {
     data: [
 	{ 'value': '/' },
 	{ 'value': '/access' },
+	{ 'value': '/access/groups' },
+	{ 'value': '/access/realm' },
 	{ 'value': '/nodes' },
 	{ 'value': '/pool' },
 	{ 'value': '/storage' },
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [RFC PATCH manager 2/4] ui: data/PermPathStore: show/load acl paths for realms
  2021-06-17 13:32 [pve-devel] [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Dominik Csapak
@ 2021-06-17 13:32 ` Dominik Csapak
  2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 3/4] ui: data/PermPathStore: load list of groups to show their path Dominik Csapak
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2021-06-17 13:32 UTC (permalink / raw)
  To: pve-devel

save the realm list on login, and if that list exists, show that
in the acl selector, else load the list and save it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
not really sure about it, also maybe we should simply load it everytime?

 www/manager6/data/PermPathStore.js | 32 ++++++++++++++++++++++++++++++
 www/manager6/window/LoginWindow.js | 22 ++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/www/manager6/data/PermPathStore.js b/www/manager6/data/PermPathStore.js
index 1dc276b6..f55257cc 100644
--- a/www/manager6/data/PermPathStore.js
+++ b/www/manager6/data/PermPathStore.js
@@ -42,6 +42,38 @@ Ext.define('PVE.data.PermPathStore', {
 		donePaths[path] = 1;
 	    }
 	});
+
+	if (PVE.Utils.realmList !== undefined) {
+	    PVE.Utils.realmList.forEach((realm) => {
+		me.add({
+		    value: `/access/realm/${realm}`,
+		});
+	    });
+	} else {
+	    Proxmox.Utils.API2Request({
+		url: `/access/domains`,
+		success: function(response) {
+		    PVE.Utils.realmList = [];
+		    me.suspendEvents();
+		    response.result.data.forEach((realm) => {
+			me.add({
+			    value: `/access/realm/${realm.realm}`,
+			});
+			PVE.Utils.realmList.push(realm.realm);
+		    });
+		    me.resumeEvents();
+
+		    me.fireEvent('refresh', me);
+		    me.fireEvent('datachanged', me);
+		    me.sort({
+			    property: 'value',
+			    direction: 'ASC',
+		    });
+		    PVE.Utils.realmList.sort();
+		},
+	    });
+	}
+
 	me.resumeEvents();
 
 	me.fireEvent('refresh', me);
diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
index 72078080..596ccbba 100644
--- a/www/manager6/window/LoginWindow.js
+++ b/www/manager6/window/LoginWindow.js
@@ -143,6 +143,27 @@ Ext.define('PVE.window.LoginWindow', {
 	    });
 	},
 
+	init: function(view) {
+	    let me = this;
+	    let realm_cb = me.lookup('realmCB');
+	    let realm_store = realm_cb.getStore();
+	    view.mon(
+		realm_store,
+		'load',
+		function(store, records, success) {
+		    if (!success || !records || !records.length) {
+			return;
+		    }
+		    if (!PVE.Utils.realmList) {
+			let realms = records.map((rec) => rec.data.realm).sort();
+			PVE.Utils.realmList = realms;
+		    }
+		},
+		view,
+		{ single: true },
+	    );
+	},
+
 	control: {
 	    'field[name=username]': {
 		specialkey: function(f, e) {
@@ -228,6 +249,7 @@ Ext.define('PVE.window.LoginWindow', {
 	    {
 		xtype: 'pmxRealmComboBox',
 		name: 'realm',
+		reference: 'realmCB',
 	    },
 	    {
 		xtype: 'proxmoxLanguageSelector',
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [RFC PATCH manager 3/4] ui: data/PermPathStore: load list of groups to show their path
  2021-06-17 13:32 [pve-devel] [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Dominik Csapak
  2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 2/4] ui: data/PermPathStore: show/load acl paths for realms Dominik Csapak
@ 2021-06-17 13:32 ` Dominik Csapak
  2021-06-17 13:32 ` [pve-devel] [PATCH manager 4/4] ui: dc/ACLView: make the window wider Dominik Csapak
  2021-06-18 15:07 ` [pve-devel] applied: [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Thomas Lamprecht
  3 siblings, 0 replies; 6+ messages in thread
From: Dominik Csapak @ 2021-06-17 13:32 UTC (permalink / raw)
  To: pve-devel

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

Signed-off-by: Dominik Csapak <d.csapak@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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] [PATCH manager 4/4] ui: dc/ACLView: make the window wider
  2021-06-17 13:32 [pve-devel] [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Dominik Csapak
  2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 2/4] ui: data/PermPathStore: show/load acl paths for realms Dominik Csapak
  2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 3/4] ui: data/PermPathStore: load list of groups to show their path Dominik Csapak
@ 2021-06-17 13:32 ` Dominik Csapak
  2021-06-18 15:09   ` [pve-devel] applied: " Thomas Lamprecht
  2021-06-18 15:07 ` [pve-devel] applied: [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Thomas Lamprecht
  3 siblings, 1 reply; 6+ messages in thread
From: Dominik Csapak @ 2021-06-17 13:32 UTC (permalink / raw)
  To: pve-devel

to accomodate the longer acl paths better

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/dc/ACLView.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/www/manager6/dc/ACLView.js b/www/manager6/dc/ACLView.js
index 51c247d6..65abd8cd 100644
--- a/www/manager6/dc/ACLView.js
+++ b/www/manager6/dc/ACLView.js
@@ -7,6 +7,8 @@ Ext.define('PVE.dc.ACLAdd', {
     isAdd: true,
     isCreate: true,
 
+    width: 400,
+
     initComponent: function() {
         let me = this;
 
-- 
2.20.1





^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] applied: [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector
  2021-06-17 13:32 [pve-devel] [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Dominik Csapak
                   ` (2 preceding siblings ...)
  2021-06-17 13:32 ` [pve-devel] [PATCH manager 4/4] ui: dc/ACLView: make the window wider Dominik Csapak
@ 2021-06-18 15:07 ` Thomas Lamprecht
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2021-06-18 15:07 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

On 17.06.21 15:32, Dominik Csapak wrote:
> those two static acl paths were missing in the selector
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/manager6/data/PermPathStore.js | 2 ++
>  1 file changed, 2 insertions(+)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 6+ messages in thread

* [pve-devel] applied: [PATCH manager 4/4] ui: dc/ACLView: make the window wider
  2021-06-17 13:32 ` [pve-devel] [PATCH manager 4/4] ui: dc/ACLView: make the window wider Dominik Csapak
@ 2021-06-18 15:09   ` Thomas Lamprecht
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2021-06-18 15:09 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

On 17.06.21 15:32, Dominik Csapak wrote:
> to accomodate the longer acl paths better
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  www/manager6/dc/ACLView.js | 2 ++
>  1 file changed, 2 insertions(+)
> 
>

applied, thanks! Leaving out the others for, do not seem wrong but is a bit off
in general and not yet the time to think more over this for a clear decision,
sorry.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-18 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 13:32 [pve-devel] [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Dominik Csapak
2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 2/4] ui: data/PermPathStore: show/load acl paths for realms Dominik Csapak
2021-06-17 13:32 ` [pve-devel] [RFC PATCH manager 3/4] ui: data/PermPathStore: load list of groups to show their path Dominik Csapak
2021-06-17 13:32 ` [pve-devel] [PATCH manager 4/4] ui: dc/ACLView: make the window wider Dominik Csapak
2021-06-18 15:09   ` [pve-devel] applied: " Thomas Lamprecht
2021-06-18 15:07 ` [pve-devel] applied: [PATCH manager 1/4] ui: data/PermPathStore: add missing basic acl paths to acl selector Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal