Add a proper confirmation message when we detach an used disk

Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
This commit is contained in:
Emmanuel Kasper 2017-11-30 17:34:07 +01:00 committed by Dominik Csapak
parent ca4500e572
commit 06f3801499

View 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.');
}