[pve-devel] [PATCH manager 2/2] prevent contextmenu on lxc templates

Dominik Csapak d.csapak at proxmox.com
Tue Apr 5 14:21:11 CEST 2016


since we do not support lxc templates on the gui yet,
prepare the correct contextmenu call, but comment it out

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/grid/ResourceGrid.js | 9 ++++++++-
 www/manager6/tree/ResourceTree.js | 9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/www/manager6/grid/ResourceGrid.js b/www/manager6/grid/ResourceGrid.js
index 99e9164..b97711f 100644
--- a/www/manager6/grid/ResourceGrid.js
+++ b/www/manager6/grid/ResourceGrid.js
@@ -183,10 +183,17 @@ Ext.define('PVE.grid.ResourceGrid', {
 			menu = Ext.create('PVE.qemu.TemplateMenu', {
 			    pveSelNode: record
 			});
-		    } else if (record.data.type === 'lxc') {
+		    } else if (record.data.type === 'lxc' && !record.data.template) {
 			menu = Ext.create('PVE.lxc.CmdMenu', {
 			    pveSelNode: record
 			});
+		    } else if (record.data.type === 'lxc' && record.data.template) {
+			/* since clone does not work reliably, disable for now
+			menu = Ext.create('PVE.lxc.TemplateMenu', {
+			    pveSelNode: record
+			});
+			*/
+			return;
 		    } else {
 			return;
 		    }
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index c38321b..556975e 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -345,10 +345,17 @@ Ext.define('PVE.tree.ResourceTree', {
 			menu = Ext.create('PVE.qemu.TemplateMenu', {
 			    pveSelNode: record
 			});
-		    } else if (record.data.type === 'lxc') {
+		    } else if (record.data.type === 'lxc' && !record.data.template) {
 			menu = Ext.create('PVE.lxc.CmdMenu', {
 			    pveSelNode: record
 			});
+		    } else if (record.data.type === 'lxc' && record.data.template) {
+			/* since clone does not work reliably, disable for now
+			menu = Ext.create('PVE.lxc.TemplateMenu', {
+			    pveSelNode: record
+			});
+			*/
+			return;
 		    } else {
 			return;
 		    }
-- 
2.1.4





More information about the pve-devel mailing list