[pve-devel] [PATCH manager 19/20] gui: ceph: use taskDone functionality for reloading

Dominik Csapak d.csapak at proxmox.com
Tue Jun 4 14:47:58 CEST 2019


instead of simply reloading when the window is closed

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/ceph/OSD.js | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index 708ba274..f1789df6 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -418,9 +418,13 @@ Ext.define('PVE.node.CephOsdTree', {
 		method: 'POST',
 		success: function(response, options) {
 		    var upid = response.result.data;
-		    var win = Ext.create('Proxmox.window.TaskProgress', { upid: upid });
+		    var win = Ext.create('Proxmox.window.TaskProgress', {
+			upid: upid,
+			taskDone: function() {
+			    me.reload();
+			}
+		    });
 		    win.show();
-		    me.mon(win, 'close', reload, me);
 		},
 		failure: function(response, opts) {
 		    Ext.Msg.alert(gettext('Error'), response.htmlStatus);
@@ -434,10 +438,12 @@ Ext.define('PVE.node.CephOsdTree', {
 		var rec = sm.getSelection()[0];
 
 		var win = Ext.create('PVE.CephCreateOsd', {
-                    nodename: nodename
+                    nodename: nodename,
+		    taskDone: function(success) {
+			me.reload();
+		    }
 		});
 		win.show();
-		me.mon(win, 'close', reload, me);
 	    }
 	});
 
@@ -482,10 +488,12 @@ Ext.define('PVE.node.CephOsdTree', {
 
 		var win = Ext.create('PVE.CephRemoveOsd', {
                     nodename: rec.data.host,
-		    osdid: rec.data.id
+		    osdid: rec.data.id,
+		    taskDone: function(success) {
+			me.reload();
+		    }
 		});
 		win.show();
-		me.mon(win, 'close', reload, me);
 	    }
 	});
 
-- 
2.11.0





More information about the pve-devel mailing list