public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager 1/2] ui: config panel: only set onlineHelp if it exists
@ 2023-06-14  9:50 Dominik Csapak
  2023-06-14  9:50 ` [pve-devel] [PATCH manager 2/2] ui: group storages in folder view Dominik Csapak
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-06-14  9:50 UTC (permalink / raw)
  To: pve-devel

otherwise we might run into an exception further down

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/panel/ConfigPanel.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/www/manager6/panel/ConfigPanel.js b/www/manager6/panel/ConfigPanel.js
index d578f944..5192d2bc 100644
--- a/www/manager6/panel/ConfigPanel.js
+++ b/www/manager6/panel/ConfigPanel.js
@@ -130,7 +130,10 @@ Ext.define('PVE.panel.Config', {
 	if (me.savedItems[cardid]) {
 	    var curcard = me.getLayout().getActiveItem();
 	    var newcard = me.add(me.savedItems[cardid]);
-	    me.helpButton.setOnlineHelp(newcard.onlineHelp || me.onlineHelp);
+	    let onlineHelp = newcard.onlineHelp || me.onlineHelp;
+	    if (onlineHelp) {
+		me.helpButton.setOnlineHelp(onlineHelp);
+	    }
 	    if (curcard) {
 		me.setActiveItem(cardid);
 		me.remove(curcard, true);
-- 
2.30.2





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

* [pve-devel] [PATCH manager 2/2] ui: group storages in folder view
  2023-06-14  9:50 [pve-devel] [PATCH manager 1/2] ui: config panel: only set onlineHelp if it exists Dominik Csapak
@ 2023-06-14  9:50 ` Dominik Csapak
  0 siblings, 0 replies; 2+ messages in thread
From: Dominik Csapak @ 2023-06-14  9:50 UTC (permalink / raw)
  To: pve-devel

so if there are many storages and/or nodes, it makes the list of
storages a bit clearer

to do that we have to add a virtual field to group by that is not the
same as the 'type' of the individual entries (otherwise the grouping
logic does insert them wrong)

to not pollute the column list in the search grids, we only include the
ones with 'header' or 'text' property (without those, the columsn would
show up with an empty string)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 www/manager6/data/ResourceStore.js | 10 +++++++++-
 www/manager6/form/ViewSelector.js  |  2 +-
 www/manager6/tree/ResourceTree.js  |  3 +++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/www/manager6/data/ResourceStore.js b/www/manager6/data/ResourceStore.js
index 871d5145..a4f16b87 100644
--- a/www/manager6/data/ResourceStore.js
+++ b/www/manager6/data/ResourceStore.js
@@ -256,6 +256,12 @@ Ext.define('PVE.data.ResourceStore', {
 		sortable: true,
 		width: 110,
 	    },
+	    // to group them, we need a field that is not named like the type
+	    storageGroup: {
+		type: 'string',
+		hidden: true,
+		calculate: (data) => data.storage,
+	    },
 	    pool: {
 		header: gettext('Pool'),
 		type: 'string',
@@ -354,7 +360,9 @@ Ext.define('PVE.data.ResourceStore', {
 		let res = [];
 		Ext.Object.each(field_defaults, function(field, info) {
 		    let fieldInfo = Ext.apply({ dataIndex: field }, info);
-		    res.push(fieldInfo);
+		    if (fieldInfo.header || fieldInfo.text) {
+			res.push(fieldInfo);
+		    }
 		});
 		return res;
 	    },
diff --git a/www/manager6/form/ViewSelector.js b/www/manager6/form/ViewSelector.js
index e25547c4..222d80e7 100644
--- a/www/manager6/form/ViewSelector.js
+++ b/www/manager6/form/ViewSelector.js
@@ -24,7 +24,7 @@ Ext.define('PVE.form.ViewSelector', {
 	    },
 	    folder: {
 		text: gettext('Folder View'),
-		groups: ['type'],
+		groups: ['type', 'storageGroup'],
 	    },
 	    pool: {
 		text: gettext('Pool View'),
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 54c6403d..d9f17be3 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -21,6 +21,9 @@ Ext.define('PVE.tree.ResourceTree', {
 		iconCls: 'fa fa-database',
 		text: gettext('Storage'),
 	    },
+	    storageGroup: {
+		iconCls: 'fa fa-database',
+	    },
 	    sdn: {
 		iconCls: 'fa fa-th',
 		text: gettext('SDN'),
-- 
2.30.2





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

end of thread, other threads:[~2023-06-14  9:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14  9:50 [pve-devel] [PATCH manager 1/2] ui: config panel: only set onlineHelp if it exists Dominik Csapak
2023-06-14  9:50 ` [pve-devel] [PATCH manager 2/2] ui: group storages in folder view Dominik Csapak

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