mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-08 12:29:49 +00:00
use new asynchronous API for qemu
This commit is contained in:
parent
e59c9d18f9
commit
fc2b50c1dc
@ -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');
|
||||||
|
@ -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 \
|
||||||
|
@ -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',
|
||||||
|
@ -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,
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user