[pbs-devel] [PATCH proxmox-widget-toolkit 2/2] DiskList: handle partition data from PBS backend

Hannes Laimer h.laimer at proxmox.com
Mon Apr 4 11:50:47 CEST 2022


Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
 src/panel/DiskList.js | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/panel/DiskList.js b/src/panel/DiskList.js
index eb8b1a8..c1877ef 100644
--- a/src/panel/DiskList.js
+++ b/src/panel/DiskList.js
@@ -169,8 +169,19 @@ Ext.define('Proxmox.DiskList', {
 		let data = item.data;
 		data.leaf = true;
 		data.expanded = true;
-		data.children = [];
+		data.children = data.partitions ? data.partitions : [];
+		for (let p of data.children) {
+		    p['disk-type'] = 'partition';
+		    p.iconCls = 'fa fa-fw fa-hdd-o x-fa-tree';
+		    p.parent = data.devpath;
+		    p.children = [];
+		    p.leaf = true;
+		}
 		data.iconCls = 'fa fa-fw fa-hdd-o x-fa-tree';
+		if (data.children.length > 0) {
+		    data.leaf = false;
+		}
+
 		if (!data.parent) {
 		    disks[data.devpath] = data;
 		}
-- 
2.30.2






More information about the pbs-devel mailing list