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' hstateid: 'storagetab'
}); });
// call here, so there is a root for insertNodes()
me.callParent();
if (caps.storage['Datastore.Allocate'] || if (caps.storage['Datastore.Allocate'] ||
caps.storage['Datastore.AllocateSpace'] || caps.storage['Datastore.AllocateSpace'] ||
caps.storage['Datastore.Audit']) { caps.storage['Datastore.Audit']) {
me.items.push({ me.insertNodes([
xtype: 'pveStorageContentView', {
title: gettext('Content'), xtype: 'pveStorageContentView',
iconCls: 'fa fa-th', title: gettext('Content'),
itemId: 'content' iconCls: 'fa fa-th',
}); itemId: 'content'
},
]);
} }
if (caps.storage['Permissions.Modify']) { if (caps.storage['Permissions.Modify']) {
me.items.push({ me.insertNodes([
xtype: 'pveACLView', {
title: gettext('Permissions'), xtype: 'pveACLView',
iconCls: 'fa fa-unlock', title: gettext('Permissions'),
itemId: 'permissions', iconCls: 'fa fa-unlock',
path: '/storage/' + storeid itemId: 'permissions',
}); path: '/storage/' + storeid
},
]);
} }
me.callParent();
} }
}); });