[pve-devel] [PATCH manager v2 3/3] Add a proper confirmation message when we detach an used disk

Emmanuel Kasper e.kasper at proxmox.com
Wed Nov 15 11:54:58 CET 2017


Signed-off-by: Emmanuel Kasper <e.kasper at proxmox.com>
---
 www/manager6/qemu/HardwareView.js | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index 2cd0c940..e6bc0231 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -402,9 +402,16 @@ Ext.define('PVE.qemu.HardwareView', {
 	    disabled: true,
 	    dangerous: true,
 	    confirmMsg: function(rec) {
-		var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
-					    "'" + me.renderKey(rec.data.key, {}, rec) + "'");
-		if (rec.data.key.match(/^unused\d+$/)) {
+		var warn = 'Are you sure you want to remove entry {0}';
+		if (this.text === this.altText) {
+		    warn = 'Are you sure you want to detach entry {0}';
+		}
+
+		var entry = rec.data.key;
+		var msg = Ext.String.format(gettext(warn), "'"
+		    + me.renderKey(entry, {}, rec) + "'");
+
+		if (entry.match(/^unused\d+$/)) {
 		    msg += " " + gettext('This will permanently erase all data.');
 		}
 
-- 
2.11.0





More information about the pve-devel mailing list