[pve-devel] [PATCH manager v3 3/3] Add a proper confirmation message when we detach an used disk
Emmanuel Kasper
e.kasper at proxmox.com
Thu Nov 30 17:34:07 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 bc22cc98..112410c2 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 = 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.');
}
--
2.11.0
More information about the pve-devel
mailing list