Commit 72a74d5d authored by Dietmar Maurer's avatar Dietmar Maurer

use new asynchronous API for qemu

parent 634b38d0
......@@ -120,8 +120,6 @@ __PACKAGE__->register_method({
my $node = extract_param($param, 'node');
# fixme: fork worker?
my $vmid = extract_param($param, 'vmid');
my $password = extract_param($param, 'password');
......
......@@ -4,6 +4,7 @@ JSSRC= \
Utils.js \
Parser.js \
StateProvider.js \
qemu/SendKeyMenu.js \
VNCConsole.js \
data/TimezoneStore.js \
data/reader/JsonObject.js \
......
......@@ -211,9 +211,8 @@ Ext.define('PVE.KVMConsole', {
var vm_command = function(cmd, reload_applet) {
PVE.Utils.API2Request({
params: { command: cmd },
url: '/nodes/' + me.nodename + '/qemu/' + me.vmid + "/status",
method: 'PUT',
url: '/nodes/' + me.nodename + '/qemu/' + me.vmid + "/status/" + cmd,
method: 'POST',
waitMsgTarget: me,
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
......@@ -246,16 +245,9 @@ Ext.define('PVE.KVMConsole', {
}
},
{
text: 'CAD',
handler: function() {
var msg = "Send CAD (Ctrl-Alt-Delete) to the VM?";
Ext.Msg.confirm('Confirm', msg, function(btn) {
if (btn !== 'yes') {
return;
}
vm_command("cad");
});
}
xtype: 'pveQemuSendKeyMenu',
nodename: me.nodename,
vmid: me.vmid
},
{
text: 'Reset',
......
......@@ -50,7 +50,7 @@ Ext.define('PVE.qemu.StatusView', {
};
Ext.applyIf(me, {
url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/status",
url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/status/current",
cwidth1: 150,
height: 145,
interval: 1000,
......
......@@ -29,12 +29,12 @@ Ext.define('PVE.qemu.Summary', {
var rrdurl = "/api2/png/nodes/" + nodename + "/qemu/" + vmid + "/rrd";
var vm_command = function(cmd) {
var vm_command = function(cmd, params) {
PVE.Utils.API2Request({
params: { command: cmd },
url: '/nodes/' + nodename + '/qemu/' + vmid + "/status",
params: params,
url: '/nodes/' + nodename + '/qemu/' + vmid + "/status/" + cmd,
waitMsgTarget: me,
method: 'PUT',
method: 'POST',
failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment