[pve-devel] r5555 - in pve-manager/pve2/www/manager: . grid

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Feb 16 14:34:53 CET 2011


Author: dietmar
Date: 2011-02-16 14:34:53 +0100 (Wed, 16 Feb 2011)
New Revision: 5555

Modified:
   pve-manager/pve2/www/manager/NodeConfig.js
   pve-manager/pve2/www/manager/grid/ObjectView.js
Log:
display load error messages


Modified: pve-manager/pve2/www/manager/NodeConfig.js
===================================================================
--- pve-manager/pve2/www/manager/NodeConfig.js	2011-02-16 10:51:11 UTC (rev 5554)
+++ pve-manager/pve2/www/manager/NodeConfig.js	2011-02-16 13:34:53 UTC (rev 5555)
@@ -982,8 +982,12 @@
 	    }
 	});
 
+	var update_store = function() {
+	    store.load();
+	};
+
 	var load_task = new Ext.util.DelayedTask(function(delay) {
-	    store.load();
+	    update_store();
 	    load_task.delay(delay === undefined ? 1000 : delay);
 	});
 
@@ -994,7 +998,6 @@
 	    listeners: {
 		show: function() {
 		    load_task.delay(10);
-		    store.load();
 		},
 		hide: function() {
 		    load_task.cancel();

Modified: pve-manager/pve2/www/manager/grid/ObjectView.js
===================================================================
--- pve-manager/pve2/www/manager/grid/ObjectView.js	2011-02-16 10:51:11 UTC (rev 5554)
+++ pve-manager/pve2/www/manager/grid/ObjectView.js	2011-02-16 13:34:53 UTC (rev 5555)
@@ -52,6 +52,21 @@
 	});
 
 	PVE.grid.ObjectView.superclass.initComponent.call(self);
+
+	var display_exception = function(t, type, action, options, response, arg) {
+	    var msg;
+	    self.store.removeAll();
+	    if (type == 'response') {
+		msg = "Error " + response.status + ": " + response.statusText;
+	    } else {
+		msg = "Data load error";
+	    }
+	    self.getView().mainBody.update('<div class="x-grid-empty">' + msg + '</div>');
+	};
+
+	self.store.on('exception', display_exception); 
+	self.on('beforedestroy', function() { self.store.un('exception', display_exception) }); 
+
     }
 });
 




More information about the pve-devel mailing list