use new asynchronous API for qemu

This commit is contained in:
Dietmar Maurer 2011-10-10 13:22:17 +02:00
parent e59c9d18f9
commit fc2b50c1dc
5 changed files with 11 additions and 20 deletions

View File

@ -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');

View File

@ -4,6 +4,7 @@ JSSRC= \
Utils.js \
Parser.js \
StateProvider.js \
qemu/SendKeyMenu.js \
VNCConsole.js \
data/TimezoneStore.js \
data/reader/JsonObject.js \

View File

@ -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',

View File

@ -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,

View File

@ -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);
}