]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
Add a proper confirmation message when we detach an used disk
authorEmmanuel Kasper <e.kasper@proxmox.com>
Thu, 30 Nov 2017 16:34:07 +0000 (17:34 +0100)
committerDominik Csapak <d.csapak@proxmox.com>
Mon, 4 Dec 2017 11:02:47 +0000 (12:02 +0100)
Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
www/manager6/qemu/HardwareView.js

index bc22cc9852b2d20e2a5628d281bc6a9ea7b2948a..112410c275103aee72a0894034ddc045fb3989a5 100644 (file)
@@ -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 = gettext('Are you sure you want to remove entry {0}');
+               if (this.text === this.altText) {
+                   warn = gettext('Are you sure you want to detach entry {0}');
+               }
+
+               var entry = rec.data.key;
+               var msg = Ext.String.format(warn, "'"
+                   + me.renderKey(entry, {}, rec) + "'");
+
+               if (entry.match(/^unused\d+$/)) {
                    msg += " " + gettext('This will permanently erase all data.');
                }