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'); my $node = extract_param($param, 'node');
# fixme: fork worker?
my $vmid = extract_param($param, 'vmid'); my $vmid = extract_param($param, 'vmid');
my $password = extract_param($param, 'password'); my $password = extract_param($param, 'password');

View File

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

View File

@ -211,9 +211,8 @@ Ext.define('PVE.KVMConsole', {
var vm_command = function(cmd, reload_applet) { var vm_command = function(cmd, reload_applet) {
PVE.Utils.API2Request({ PVE.Utils.API2Request({
params: { command: cmd }, url: '/nodes/' + me.nodename + '/qemu/' + me.vmid + "/status/" + cmd,
url: '/nodes/' + me.nodename + '/qemu/' + me.vmid + "/status", method: 'POST',
method: 'PUT',
waitMsgTarget: me, waitMsgTarget: me,
failure: function(response, opts) { failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus); Ext.Msg.alert('Error', response.htmlStatus);
@ -246,16 +245,9 @@ Ext.define('PVE.KVMConsole', {
} }
}, },
{ {
text: 'CAD', xtype: 'pveQemuSendKeyMenu',
handler: function() { nodename: me.nodename,
var msg = "Send CAD (Ctrl-Alt-Delete) to the VM?"; vmid: me.vmid
Ext.Msg.confirm('Confirm', msg, function(btn) {
if (btn !== 'yes') {
return;
}
vm_command("cad");
});
}
}, },
{ {
text: 'Reset', text: 'Reset',

View File

@ -50,7 +50,7 @@ Ext.define('PVE.qemu.StatusView', {
}; };
Ext.applyIf(me, { Ext.applyIf(me, {
url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/status", url: "/api2/json/nodes/" + nodename + "/qemu/" + vmid + "/status/current",
cwidth1: 150, cwidth1: 150,
height: 145, height: 145,
interval: 1000, interval: 1000,

View File

@ -29,12 +29,12 @@ Ext.define('PVE.qemu.Summary', {
var rrdurl = "/api2/png/nodes/" + nodename + "/qemu/" + vmid + "/rrd"; var rrdurl = "/api2/png/nodes/" + nodename + "/qemu/" + vmid + "/rrd";
var vm_command = function(cmd) { var vm_command = function(cmd, params) {
PVE.Utils.API2Request({ PVE.Utils.API2Request({
params: { command: cmd }, params: params,
url: '/nodes/' + nodename + '/qemu/' + vmid + "/status", url: '/nodes/' + nodename + '/qemu/' + vmid + "/status/" + cmd,
waitMsgTarget: me, waitMsgTarget: me,
method: 'PUT', method: 'POST',
failure: function(response, opts) { failure: function(response, opts) {
Ext.Msg.alert('Error', response.htmlStatus); Ext.Msg.alert('Error', response.htmlStatus);
} }