storage panel/browser: use insertNodes function

in preparation for dynamically loading nodes for content-type-specific views.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2020-11-13 14:16:16 +01:00 committed by Thomas Lamprecht
parent a83c659a11
commit 1a763337a2

View File

@ -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({
me.insertNodes([
{
xtype: 'pveStorageContentView',
title: gettext('Content'),
iconCls: 'fa fa-th',
itemId: 'content'
});
},
]);
}
if (caps.storage['Permissions.Modify']) {
me.items.push({
me.insertNodes([
{
xtype: 'pveACLView',
title: gettext('Permissions'),
iconCls: 'fa fa-unlock',
itemId: 'permissions',
path: '/storage/' + storeid
});
},
]);
}
me.callParent();
}
});