[pve-devel] [PATCH manager v2 4/4] enable/disable xtermjs depending on the existance of a serial port

Dominik Csapak d.csapak at proxmox.com
Fri Jan 26 11:58:03 CET 2018


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/button/ConsoleButton.js | 8 ++++++++
 www/manager6/qemu/Config.js          | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/www/manager6/button/ConsoleButton.js b/www/manager6/button/ConsoleButton.js
index c5bb8276..97bed170 100644
--- a/www/manager6/button/ConsoleButton.js
+++ b/www/manager6/button/ConsoleButton.js
@@ -9,6 +9,7 @@ Ext.define('PVE.button.ConsoleButton', {
     iconCls: 'fa fa-terminal',
 
     enableSpice: true,
+    enableXtermjs: true,
 
     nodename: undefined,
 
@@ -23,6 +24,13 @@ Ext.define('PVE.button.ConsoleButton', {
 	me.down('#spicemenu').setDisabled(!enable);
     },
 
+    setEnableXtermJS: function(enable){
+	var me = this;
+
+	me.enableXtermjs = enable;
+	me.down('#xtermjs').setDisabled(!enable);
+    },
+
     handler: function() {
 	var me = this;
 	PVE.Utils.openDefaultConsoleWindow(me.enableSpice, me.consoleType, me.vmid,
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index f68bd1f8..4620fd20 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -324,6 +324,7 @@ Ext.define('PVE.qemu.Config', {
 	    var status;
 	    var qmpstatus;
 	    var spice = false;
+	    var xtermjs = false;
 
 	    if (!success) {
 		status = qmpstatus = 'unknown';
@@ -336,6 +337,7 @@ Ext.define('PVE.qemu.Config', {
 		template = rec.data.value || false;
 
 		spice = s.data.get('spice') ? true : false;
+		xtermjs = s.data.get('serial') ? true : false;
 
 	    }
 
@@ -352,6 +354,7 @@ Ext.define('PVE.qemu.Config', {
 	    }
 
 	    consoleBtn.setEnableSpice(spice);
+	    consoleBtn.setEnableXtermJS(xtermjs);
 
 	    startBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status === 'running' || template);
 	    shutdownBtn.setDisabled(!caps.vms['VM.PowerMgmt'] || status !== 'running');
-- 
2.11.0





More information about the pve-devel mailing list