]> git.proxmox.com Git - pve-manager.git/commitdiff
storage panel/browser: use insertNodes function
authorFabian Ebner <f.ebner@proxmox.com>
Fri, 13 Nov 2020 13:16:16 +0000 (14:16 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 15 Nov 2020 17:41:11 +0000 (18:41 +0100)
in preparation for dynamically loading nodes for content-type-specific views.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
www/manager6/storage/Browser.js

index e93aa8def0e6b2eeaf1c92983a585ccd2d17a14b..7537bdf1ac3c22ceffb0bd867aba45f95fbc644d 100644 (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({
-               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();
    }
 });