]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: save ui options from /cluster/options instead of version
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 16 Nov 2022 15:48:05 +0000 (16:48 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 17 Nov 2022 17:20:12 +0000 (18:20 +0100)
/cluster/options is now the go to place for getting these options
(until we have more options unrelated to the datacenter.cfg)

Also move the use of the console from VersionInfo to here, since
this will be the future place for ui related backend options.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Utils.js
www/manager6/Workspace.js
www/manager6/dc/OptionView.js

index adcf082ffdf6a60242d8bf84def5119c373c2f7b..6ce22ded5b22bb0ade2e50f4ba8a242b72c94476 100644 (file)
@@ -1332,7 +1332,7 @@ Ext.define('PVE.Utils', {
            allowSpice = consoles.spice;
            allowXtermjs = !!consoles.xtermjs;
        }
-       let dv = PVE.VersionInfo.console || (type === 'kvm' ? 'vv' : 'xtermjs');
+       let dv = PVE.UIOptions.console || (type === 'kvm' ? 'vv' : 'xtermjs');
        if (dv === 'vv' && !allowSpice) {
            dv = allowXtermjs ? 'xtermjs' : 'html5';
        } else if (dv === 'xtermjs' && !allowXtermjs) {
@@ -1854,6 +1854,17 @@ Ext.define('PVE.Utils', {
     },
 
     notesTemplateVars: ['cluster', 'guestname', 'node', 'vmid'],
+
+    updateUIOptions: function() {
+       Proxmox.Utils.API2Request({
+           url: '/cluster/options',
+           method: 'GET',
+           success: function(response) {
+               PVE.UIOptions = {};
+               PVE.UIOptions.console = response?.result?.data?.console;
+           },
+       });
+    },
 },
 
     singleton: true,
index 2bb502e0cebcf4830f4b2d4450ffdf55d35dea98..a7423508edb68b2d4ff10dc6fa4a8a37828c7e4d 100644 (file)
@@ -158,6 +158,8 @@ Ext.define('PVE.StdWorkspace', {
                },
            });
 
+           PVE.Utils.updateUIOptions();
+
            Proxmox.Utils.API2Request({
                url: '/cluster/sdn',
                method: 'GET',
index 5a2be182e72c42d76f4e22a14e3d481b2444427d..ff96351d5e9ebd874f364137bc422acd272ae533 100644 (file)
@@ -343,9 +343,9 @@ Ext.define('PVE.dc.OptionView', {
            }
 
            var rec = store.getById('console');
-           PVE.VersionInfo.console = rec.data.value;
+           PVE.UIOptions.console = rec.data.value;
            if (rec.data.value === '__default__') {
-               delete PVE.VersionInfo.console;
+               delete PVE.UIOptions.console;
            }
        });