[pve-devel] [PATCH manager 07/10] reload the pool grid correctly

Dominik Csapak d.csapak at proxmox.com
Mon Jul 31 11:28:39 CEST 2017


whenever a window is closed (creation, deletion) we want to reload the
pool grid, for not having to wait on the next refresh

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/ceph/Pool.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index a4247bfd..d254b969 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -154,6 +154,10 @@ Ext.define('PVE.node.CephPoolList', {
 	    }
 	});
 
+	var reload = function() {
+	    rstore.load();
+	};
+
 	var store = Ext.create('PVE.data.DiffStore', { rstore: rstore });
 
 	PVE.Utils.monStoreErrors(me, rstore);
@@ -165,6 +169,9 @@ Ext.define('PVE.node.CephPoolList', {
                     nodename: nodename
 		});
 		win.show();
+		win.on('destroy', function() {
+		    reload();
+		});
 	    }
 	});
 
@@ -181,10 +188,13 @@ Ext.define('PVE.node.CephPoolList', {
 		var base_url = '/nodes/' + nodename + '/ceph/pools/' +
 		    rec.data.pool_name;
 
-		Ext.create('PVE.window.SafeDestroy', {
+		var win = Ext.create('PVE.window.SafeDestroy', {
 		    url: base_url,
 		    item: { type: 'CephPool', id: rec.data.pool_name }
 		}).show();
+		win.on('destroy', function() {
+		    reload();
+		});
 	    }
 	});
 
-- 
2.11.0





More information about the pve-devel mailing list