[pve-devel] [PATCH manager 3/3] Add a clone button in the VM toolbar

Emmanuel Kasper e.kasper at proxmox.com
Mon Feb 6 19:03:27 CET 2017


Up to now the Migrate function had a first class button in the toolbar,
but the Clone function didn't.
With this button the toolbar still fit correctly in a smaller
1280 pixel wide display.
---
 www/manager6/qemu/Config.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index aaf0eca..5aac131 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -73,6 +73,15 @@ Ext.define('PVE.qemu.Config', {
 	    iconCls: 'fa fa-send-o'
 	});
 
+	var cloneBtn = Ext.create('Ext.Button', {
+		text: gettext('Clone'),
+		iconCls: 'fa fa-fw fa-clone',
+		hidden: caps.vms['VM.Clone'] ? false : true,
+		handler: function() {
+		    PVE.window.Clone.wrap(nodename, vmid, template);
+		}
+	});
+
 	var resetBtn = Ext.create('PVE.button.Button', {
 	    text: gettext('Reset'),
 	    disabled: !caps.vms['VM.PowerMgmt'],
@@ -134,7 +143,7 @@ Ext.define('PVE.qemu.Config', {
 	    title: Ext.String.format(gettext("Virtual Machine {0} on node {1}"), descr, "'" + nodename + "'"),
 	    hstateid: 'kvmtab',
 	    tbar: [ resumeBtn, startBtn, shutdownBtn, resetBtn,
-		    removeBtn, migrateBtn, consoleBtn],
+		    removeBtn, migrateBtn, cloneBtn, consoleBtn],
 	    defaults: { statusStore: me.statusStore },
 	    items: [
 		{
-- 
2.1.4





More information about the pve-devel mailing list