Commit 93ebca24 authored by Alexandre Derumier's avatar Alexandre Derumier Committed by Dietmar Maurer

forbid edit|delete of pending delete, and move_disk of pending disk

Signed-off-by: 's avatarAlexandre Derumier <aderumier@odiso.com>
parent 0c66a0b2
......@@ -270,6 +270,9 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec) {
return false;
}
if(rec.data['delete']){
return false;
}
var rowdef = rows[rec.data.key];
return !!rowdef.editor;
},
......@@ -281,7 +284,7 @@ Ext.define('PVE.qemu.HardwareView', {
selModel: sm,
disabled: true,
enableFn: function(rec) {
if (!rec) {
if (!rec || rec.data.key.match(/^unused\d+/) || rec.data['pending'] || rec.data['delete']) {
return false;
}
var rowdef = rows[rec.data.key];
......@@ -298,6 +301,9 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec || rec.data.key.match(/^unused\d+/)) {
return false;
}
if(rec.data['pending'] || rec.data['delete']){
return false;
}
var rowdef = rows[rec.data.key];
return rowdef.tdCls == 'pve-itype-icon-storage' && !rec.data.value.match(/media=cdrom/);
},
......@@ -336,6 +342,9 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec) {
return false;
}
if(rec.data['delete']){
return false;
}
var rowdef = rows[rec.data.key];
return rowdef.never_delete !== true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment