[pve-devel] [PATCH 3/7] forbid edit|delete of pending delete, and move_disk of pending disk
Alexandre Derumier
aderumier at odiso.com
Fri Jan 2 15:18:06 CET 2015
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
www/manager/qemu/HardwareView.js | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/www/manager/qemu/HardwareView.js b/www/manager/qemu/HardwareView.js
index 5738d9a..50e7bb0 100644
--- a/www/manager/qemu/HardwareView.js
+++ b/www/manager/qemu/HardwareView.js
@@ -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;
--
1.7.10.4
More information about the pve-devel
mailing list