]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: config panel: refactor onlineHelp switch to object map
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 10 Jan 2023 11:14:07 +0000 (12:14 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 10 Jan 2023 11:14:07 +0000 (12:14 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/panel/ConfigPanel.js

index 224bc7682f5df50952c650c3423190d1e47d8419..51c474078c559fcbb8b3212d74313de4780e8506 100644 (file)
@@ -176,13 +176,14 @@ Ext.define('PVE.panel.Config', {
        me.tbar = undefined;
 
        if (!me.onlineHelp) {
-           switch (me.pveSelNode.data.id) {
-               case 'type/storage': me.onlineHelp = 'chapter-pvesm.html'; break;
-               case 'type/qemu': me.onlineHelp = 'chapter-qm.html'; break;
-               case 'type/lxc': me.onlineHelp = 'chapter-pct.html'; break;
-               case 'type/pool': me.onlineHelp = 'chapter-pveum.html#_pools'; break;
-               case 'type/node': me.onlineHelp = 'chapter-sysadmin.html'; break;
-           }
+           let typeToOnlineHelp = {
+               'type/lxc': 'chapter-pct.html',
+               'type/node': 'chapter-sysadmin.html',
+               'type/pool': 'chapter-pveum.html#_pools',
+               'type/qemu': 'chapter-qm.html',
+               'type/storage': 'chapter-pvesm.html',
+           };
+           me.onlineHelp = typeToOnlineHelp[me.pveSelNode.data.id];
        }
 
        if (me.tbarSpacing) {