[pve-devel] [PATCH v2 manager] close #584: ui qemu: changed remove unused disk to asynchron call

Tim Marx t.marx at proxmox.com
Wed Oct 17 13:24:10 CEST 2018


changed commit message to be more specific
added condition to only spawn tasks if its a unused disk as originally intended

Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index a1bccc3c..99aae6ed 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -376,7 +376,7 @@ Ext.define('PVE.qemu.HardwareView', {
 		Proxmox.Utils.API2Request({
 		    url: '/api2/extjs/' + baseurl,
 		    waitMsgTarget: me,
-		    method: 'PUT',
+		    method: rec.data.key.match(/^unused\d+$/) ? 'POST': 'PUT',
 		    params: {
 			'delete': rec.data.key
 		    },
@@ -385,7 +385,21 @@ Ext.define('PVE.qemu.HardwareView', {
 		    },
 		    failure: function (response, opts) {
 			Ext.Msg.alert('Error', response.htmlStatus);
-		    }
+		    },
+		    success: function(response, options) {
+			var upid = response.result.data;
+			if (upid !== null) {
+			    var win = Ext.create('Proxmox.window.TaskProgress', {
+				upid: upid,
+				listeners: {
+				    destroy: function () {
+					me.reload();
+				    }
+				}
+			    });
+			    win.show();
+			}
+		    },
 		});
 	    },
 	    listeners: {
-- 
2.11.0




More information about the pve-devel mailing list