From 1a763337a2325779b5e24e11c9e4f01fc1e012b8 Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Fri, 13 Nov 2020 14:16:16 +0100 Subject: [PATCH] storage panel/browser: use insertNodes function in preparation for dynamically loading nodes for content-type-specific views. Signed-off-by: Fabian Ebner --- www/manager6/storage/Browser.js | 35 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/www/manager6/storage/Browser.js b/www/manager6/storage/Browser.js index e93aa8de..7537bdf1 100644 --- a/www/manager6/storage/Browser.js +++ b/www/manager6/storage/Browser.js @@ -35,27 +35,32 @@ Ext.define('PVE.storage.Browser', { hstateid: 'storagetab' }); + // call here, so there is a root for insertNodes() + me.callParent(); + if (caps.storage['Datastore.Allocate'] || caps.storage['Datastore.AllocateSpace'] || caps.storage['Datastore.Audit']) { - me.items.push({ - xtype: 'pveStorageContentView', - title: gettext('Content'), - iconCls: 'fa fa-th', - itemId: 'content' - }); + me.insertNodes([ + { + xtype: 'pveStorageContentView', + title: gettext('Content'), + iconCls: 'fa fa-th', + itemId: 'content' + }, + ]); } if (caps.storage['Permissions.Modify']) { - me.items.push({ - xtype: 'pveACLView', - title: gettext('Permissions'), - iconCls: 'fa fa-unlock', - itemId: 'permissions', - path: '/storage/' + storeid - }); + me.insertNodes([ + { + xtype: 'pveACLView', + title: gettext('Permissions'), + iconCls: 'fa fa-unlock', + itemId: 'permissions', + path: '/storage/' + storeid + }, + ]); } - - me.callParent(); } });