win.show();
}
},
+ {
+ text: gettext('Suspend'),
+ icon: '/pve2/images/forward.png',
+ handler: function() {
+ var msg = Ext.String.format(gettext("Do you really want to suspend {0}?"), gettext('VM') + ' ' + vmid);
+ Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
+ if (btn !== 'yes') {
+ return;
+ }
+ vm_command('suspend');
+ });
+ }
+ },
+ {
+ text: gettext('Resume'),
+ icon: '/pve2/images/forward.png',
+ handler: function() {
+ vm_command('resume');
+ }
+ },
{
text: gettext('Shutdown'),
icon: '/pve2/images/stop.png',
handler: function() {
- var msg = Ext.String.format(gettext("Do you really want to shutdown VM {0}?"), vmid);
+ var msg = Ext.String.format(gettext("Do you really want to shutdown {0}?"), gettext('VM') + ' ' + vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
text: gettext('Stop'),
icon: '/pve2/images/gtk-stop.png',
handler: function() {
- var msg = Ext.String.format(gettext("Do you really want to stop VM {0}?"), vmid);
+ var msg = Ext.String.format(gettext("Do you really want to stop {0}?"), gettext('VM') + ' ' + vmid);
Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
if (btn !== 'yes') {
return;
}
- vm_command("stop", { timeout: 30 });
+ vm_command("stop");
});
}
},
+ {
+ text: gettext('Clone'),
+ icon: '/pve2/images/forward.png',
+ handler: function() {
+ var win = Ext.create('PVE.window.Clone', {
+ nodename: nodename,
+ vmid: vmid
+ });
+ win.show();
+ }
+ },
+ {
+ 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('VM') + ' ' + vmid);
+ Ext.Msg.confirm(gettext('Confirm'), msg, function(btn) {
+ if (btn !== 'yes') {
+ return;
+ }
+
+ PVE.Utils.API2Request({
+ url: '/nodes/' + nodename + '/qemu/' + vmid + '/template',
+ method: 'POST',
+ failure: function(response, opts) {
+ Ext.Msg.alert('Error', response.htmlStatus);
+ }
+ });
+ });
+ }
+ },
{
text: gettext('Console'),
icon: '/pve2/images/display.png',
handler: function() {
- PVE.Utils.openConoleWindow('kvm', vmid, nodename, vmname);
+ PVE.Utils.API2Request({
+ url: '/nodes/' + nodename + '/qemu/' + vmid + '/status/current',
+ failure: function(response, opts) {
+ Ext.Msg.alert('Error', response.htmlStatus);
+ },
+ success: function(response, opts) {
+ var allowSpice = response.result.data.spice;
+ PVE.Utils.openDefaultConsoleWindow(allowSpice, 'kvm', vmid, nodename, vmname);
+ }
+ });
}
}
];