[pve-devel] [PATCH manager v2] Reload the grid list of backups after the backup task completion

Emmanuel Kasper e.kasper at proxmox.com
Thu Jan 5 15:33:37 CET 2017


This allows visual feedback for first time users doing a backup.
---
change the way we reload by hiding the backup window instead of passing
aroung the reload() function

 www/manager6/grid/BackupView.js |  7 ++++++-
 www/manager6/window/Backup.js   | 12 ++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/www/manager6/grid/BackupView.js b/www/manager6/grid/BackupView.js
index 23a0281..15ae85d 100644
--- a/www/manager6/grid/BackupView.js
+++ b/www/manager6/grid/BackupView.js
@@ -123,7 +123,12 @@ Ext.define('PVE.grid.BackupView', {
 		    nodename: nodename,
 		    vmid: vmid,
 		    vmtype: vmtype,
-		    storage: storagesel.getValue()
+		    storage: storagesel.getValue(),
+		    listeners : {
+			close: function() {
+			    reload();
+			}
+		    }
 		});
 		win.show();
 	    }
diff --git a/www/manager6/window/Backup.js b/www/manager6/window/Backup.js
index 033c199..2a019ca 100644
--- a/www/manager6/window/Backup.js
+++ b/www/manager6/window/Backup.js
@@ -76,13 +76,21 @@ Ext.define('PVE.window.Backup', {
 			Ext.Msg.alert('Error',response.htmlStatus);
 		    },
 		    success: function(response, options) {
+			// close later so we reload the grid
+			// after the task has completed
+			me.hide();
+
 			var upid = response.result.data;
 			
 			var win = Ext.create('PVE.window.TaskViewer', { 
-			    upid: upid
+			    upid: upid,
+			    listeners: {
+				close: function() {
+				    me.close();
+				}
+			    }
 			});
 			win.show();
-			me.close();
 		    }
 		});
 	    }
-- 
2.1.4





More information about the pve-devel mailing list