[pve-devel] [PATCH manager 4/4] add suspend/resume events to updateTree

Dominik Csapak d.csapak at proxmox.com
Wed May 3 17:04:29 CEST 2017


this makes adding/modifying a large number of items a lot faster

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
inserting 5000 objects while having open the resource grid, takes about
four seconds here, which is acceptable when considering, that adding
this much vms/container at the same time will probably never happen

once those items in the tree, the web interface can be normally used,
and is not slow at all
 www/manager6/tree/ResourceTree.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index 61589b17..cd7ad500 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -206,7 +206,7 @@ Ext.define('PVE.tree.ResourceTree', {
 	var updateTree = function() {
 	    var tmp;
 
-	    // fixme: suspend events ?
+	    store.suspendEvents();
 
 	    var rootnode = me.store.getRootNode();
 	    me.setIconCls(rootnode.data);
@@ -330,6 +330,8 @@ Ext.define('PVE.tree.ResourceTree', {
 	    }
 
 	    pdata.updateCount++;
+	    store.resumeEvents();
+	    store.fireEvent('refresh', store);
 	};
 
 	var statechange = function(sp, key, value) {
-- 
2.11.0





More information about the pve-devel mailing list