From 9199d1718c72d7f6c72b6239d4e62a808d4d694a Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sun, 22 Nov 2020 15:26:13 +0100 Subject: [PATCH] ui: console: add beforeLoad callback we sometimes need to adapt parameters, but in a lot contexts the component is already created, and the activate event order of components may make this hard to do in a deterministic way. Signed-off-by: Thomas Lamprecht --- www/manager6/VNCConsole.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/manager6/VNCConsole.js b/www/manager6/VNCConsole.js index b7bdc31c..204babcc 100644 --- a/www/manager6/VNCConsole.js +++ b/www/manager6/VNCConsole.js @@ -36,12 +36,16 @@ Ext.define('PVE.noVncConsole', { items: box, listeners: { activate: function() { - var sp = Ext.state.Manager.getProvider(); - var queryDict = { + let sp = Ext.state.Manager.getProvider(); + if (Ext.isFunction(me.beforeLoad)) { + me.beforeLoad(); + } + let queryDict = { console: me.consoleType, // kvm, lxc, upgrade or shell vmid: me.vmid, node: me.nodename, cmd: me.cmd, + 'cmd-opts': me.cmdOpts, resize: sp.get('novnc-scaling', 'scale'), }; queryDict[type] = 1;