[pve-devel] r5818 - in pve-manager/pve2/www/new: . data grid tree

svn-commits at proxmox.com svn-commits at proxmox.com
Mon Apr 18 14:06:30 CEST 2011


Author: dietmar
Date: 2011-04-18 14:06:30 +0200 (Mon, 18 Apr 2011)
New Revision: 5818

Modified:
   pve-manager/pve2/www/new/Workspace.js
   pve-manager/pve2/www/new/data/UpdateStore.js
   pve-manager/pve2/www/new/grid/ResourceGrid.js
   pve-manager/pve2/www/new/tree/ResourceTree.js
Log:
clear view at logout


Modified: pve-manager/pve2/www/new/Workspace.js
===================================================================
--- pve-manager/pve2/www/new/Workspace.js	2011-04-18 11:15:10 UTC (rev 5817)
+++ pve-manager/pve2/www/new/Workspace.js	2011-04-18 12:06:30 UTC (rev 5818)
@@ -4,6 +4,7 @@
 	'Ext.selection.*',
 	'PVE.window.LoginWindow', 
 	'PVE.Utils', 
+	'PVE.data.ResourceStore',
 	'PVE.tree.ResourceTree'],
 
     // private
@@ -41,6 +42,7 @@
 		    PVE.UserName = data.username;
 
 		    self.updateUserInfo();
+		    PVE.data.ResourceStore.startUpdate();
 		}
 	    });
 	}
@@ -112,7 +114,13 @@
 			    xtype: 'button',
 			    baseCls: 'x-btn',
 			    text: "Logout",
-			    handler: function() { self.showLogin(); self.setView(); }
+			    handler: function() { 
+				PVE.data.ResourceStore.stopUpdate();
+				self.showLogin(); 
+				self.setView(); 
+				var rt = self.down('pveResourceTree');
+				rt.clearTree();
+			    }
 			}
 		    ],
 		    margins: '2 0 5 0'

Modified: pve-manager/pve2/www/new/data/UpdateStore.js
===================================================================
--- pve-manager/pve2/www/new/data/UpdateStore.js	2011-04-18 11:15:10 UTC (rev 5817)
+++ pve-manager/pve2/www/new/data/UpdateStore.js	2011-04-18 12:06:30 UTC (rev 5818)
@@ -18,7 +18,7 @@
 		PVE.data.UpdateQueue.queue(self);
 		load_task.delay(config.interval, run_load_task);
 	    } else {
-		load_task.delay(1000, run_load_task);
+		load_task.delay(200, run_load_task);
 	    }
 	};
 

Modified: pve-manager/pve2/www/new/grid/ResourceGrid.js
===================================================================
--- pve-manager/pve2/www/new/grid/ResourceGrid.js	2011-04-18 11:15:10 UTC (rev 5817)
+++ pve-manager/pve2/www/new/grid/ResourceGrid.js	2011-04-18 12:06:30 UTC (rev 5818)
@@ -17,6 +17,7 @@
     requires: [
 	'Ext.grid.*',
 	'Ext.grid.feature.Chunking',
+	'Ext.state.Manager',
 	'Ext.data.*',
 	'Ext.data.Store',
 	'Ext.util.*',
@@ -30,6 +31,7 @@
 	var me = this;
 
 	var rstore = PVE.data.ResourceStore;
+	var sp = Ext.state.Manager.getProvider();
 
 	var coldef = rstore.defaultColums();
 

Modified: pve-manager/pve2/www/new/tree/ResourceTree.js
===================================================================
--- pve-manager/pve2/www/new/tree/ResourceTree.js	2011-04-18 11:15:10 UTC (rev 5817)
+++ pve-manager/pve2/www/new/tree/ResourceTree.js	2011-04-18 12:06:30 UTC (rev 5818)
@@ -269,7 +269,6 @@
 	    }
 	};
 
-
 	sp.on('statechange', statechange);
 
 	Ext.apply(self, {
@@ -283,19 +282,20 @@
 		    rstore.un("load", updateTree)
 		}
 	    },
-	    
 	    getViewID: function() {
 		return pdata.view.id;
 	    },
 	    setView: function(view) {
 		pdata.view = view;
-
+		self.clearTree();
+		updateTree();
+	    },
+	    clearTree: function() {
 		pdata.updateCount = 0;
 		var rootnode = self.store.getRootNode();
 		rootnode.collapse();
 		rootnode.removeAll(true);
 		pdata.dataIndex = {};
-		updateTree();
 	    },
 	    applyState : function(state) {
 		if (state && state.value) {



More information about the pve-devel mailing list