ui: config panel: refactor onlineHelp switch to object map

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-01-10 12:14:07 +01:00
parent 709065a63f
commit ea5d9c35c8

View 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) {