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

Dominik Csapak d.csapak at proxmox.com
Wed Jan 3 13:04:15 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 68d5a268..276819d4 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -323,6 +323,7 @@ Ext.define('PVE.qemu.Config', {
 	    var status;
 	    var qmpstatus;
 	    var spice = false;
+	    var xtermjs = false;
 
 	    if (!success) {
 		status = qmpstatus = 'unknown';
@@ -335,6 +336,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;
 
 	    }
 
@@ -351,6 +353,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