add a 'convert to template' in the vm action bar

this was only available on right clicking a vm, now it is also available
in the action bar

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2017-04-14 10:09:21 +02:00 committed by Dietmar Maurer
parent 6356afca30
commit 34731a368f

View File

@ -73,13 +73,32 @@ 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 cloneBtn = Ext.create('PVE.button.Split', {
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);
},
menu: {
items: [{
text: gettext('Convert to template'),
disabled: template,
iconCls: 'fa fa-fw fa-file-o',
hidden: caps.vms['VM.Allocate'] ? false : true,
confirmMsg: PVE.Utils.format_task_description('qmtemplate', vmid),
handler: function() {
PVE.Utils.API2Request({
url: base_url + '/template',
waitMsgTarget: me,
method: 'POST',
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
}
});
}
}]
}
});
var shutdownBtn = Ext.create('PVE.button.Split', {