mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-25 21:16:35 +00:00
add button to start spice console
This commit is contained in:
parent
33afb29b29
commit
29223818a9
@ -118,13 +118,29 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var spiceBtn = Ext.create('Ext.Button', {
|
||||||
|
text: gettext('Spice'),
|
||||||
|
disabled: !caps.vms['VM.Console'],
|
||||||
|
handler: function() {
|
||||||
|
Ext.core.DomHelper.append(document.body, {
|
||||||
|
tag : 'iframe',
|
||||||
|
id : 'downloadIframe',
|
||||||
|
frameBorder : 0,
|
||||||
|
width : 0,
|
||||||
|
height : 0,
|
||||||
|
css : 'display:none;visibility:hidden;height:0px;',
|
||||||
|
src : '/api2/spiceconfig/nodes/' + nodename + '/qemu/' + vmid + '/spiceproxy'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'VM " + vmid + "'") + ")";
|
var descr = vmid + " (" + (vmname ? "'" + vmname + "' " : "'VM " + vmid + "'") + ")";
|
||||||
|
|
||||||
Ext.apply(me, {
|
Ext.apply(me, {
|
||||||
title: Ext.String.format(gettext("Virtual Machine {0} on node {1}"), descr, "'" + nodename + "'"),
|
title: Ext.String.format(gettext("Virtual Machine {0} on node {1}"), descr, "'" + nodename + "'"),
|
||||||
hstateid: 'kvmtab',
|
hstateid: 'kvmtab',
|
||||||
tbar: [ resumeBtn, startBtn, shutdownBtn, stopBtn, resetBtn,
|
tbar: [ resumeBtn, startBtn, shutdownBtn, stopBtn, resetBtn,
|
||||||
removeBtn, migrateBtn, consoleBtn ],
|
removeBtn, migrateBtn, consoleBtn, spiceBtn],
|
||||||
defaults: { statusStore: me.statusStore },
|
defaults: { statusStore: me.statusStore },
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
@ -190,6 +206,7 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
var status;
|
var status;
|
||||||
var qmpstatus;
|
var qmpstatus;
|
||||||
var template;
|
var template;
|
||||||
|
var spice;
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
me.workspace.checkVmMigration(me.pveSelNode);
|
me.workspace.checkVmMigration(me.pveSelNode);
|
||||||
@ -203,6 +220,8 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
if(rec.data.value){
|
if(rec.data.value){
|
||||||
template = rec.data.value;
|
template = rec.data.value;
|
||||||
}
|
}
|
||||||
|
spice = s.data.get('spice') ? true : false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qmpstatus === 'prelaunch' || qmpstatus === 'paused') {
|
if (qmpstatus === 'prelaunch' || qmpstatus === 'paused') {
|
||||||
@ -212,7 +231,10 @@ Ext.define('PVE.qemu.Config', {
|
|||||||
startBtn.setVisible(true);
|
startBtn.setVisible(true);
|
||||||
resumeBtn.setVisible(false);
|
resumeBtn.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spiceBtn.setVisible(spice);
|
||||||
|
|
||||||
|
spiceBtn.setDisabled(!caps.vms['VM.Console'] || status !== 'running');
|
||||||
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
|
startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
|
||||||
resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running' || template);
|
resetBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running' || template);
|
||||||
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
|
||||||
|
Loading…
Reference in New Issue
Block a user