[pve-devel] [PATCH manager v2 3/4] set the default console in the gui when setting the option

Dominik Csapak d.csapak at proxmox.com
Fri Apr 20 15:37:49 CEST 2018


until now, we only set the default console once on page load,
this enables to set it everytime the dc->options panel loads,
so also after setting an option

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/OptionView.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 6b976be6..a3f1d3f7 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -59,6 +59,19 @@ Ext.define('PVE.dc.OptionView', {
 
 	me.callParent();
 
+	// set the new value for the default console
+	me.mon(me.rstore, 'load', function(store, records, success) {
+	    if (!success) {
+		return;
+	    }
+
+	    var rec = store.getById('console');
+	    PVE.VersionInfo.console = rec.data.value;
+	    if (rec.data.value === '__default__') {
+		delete PVE.VersionInfo.console;
+	    }
+	});
+
 	me.on('activate', me.rstore.startUpdate);
 	me.on('destroy', me.rstore.stopUpdate);
 	me.on('deactivate', me.rstore.stopUpdate);
-- 
2.11.0





More information about the pve-devel mailing list