From 6c545e91d3f300f8fee128f978172443feb70b24 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 19 Jan 2016 11:26:47 +0100 Subject: [PATCH] lxc GUI: add 'Convert to template' --- www/manager/lxc/CmdMenu.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/www/manager/lxc/CmdMenu.js b/www/manager/lxc/CmdMenu.js index f4498617..3a1928c9 100644 --- a/www/manager/lxc/CmdMenu.js +++ b/www/manager/lxc/CmdMenu.js @@ -98,6 +98,26 @@ Ext.define('PVE.lxc.CmdMenu', { }); } }, + { + text: gettext('Convert to template'), + icon: '/pve2/images/forward.png', + handler: function() { + var msg = Ext.String.format(gettext("Do you really want to convert {0} into a template?"), gettext('CT') + ' ' + vmid); + Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) { + if (btn !== 'yes') { + return; + } + + PVE.Utils.API2Request({ + url: '/nodes/' + nodename + '/lxc/' + vmid + '/template', + method: 'POST', + failure: function(response, opts) { + Ext.Msg.alert('Error', response.htmlStatus); + } + }); + }); + } + }, { text: gettext('Console'), icon: '/pve2/images/display.png',