fix(webui/config): proper acronym/brand casing in config section names

formatSubcategoryName title-cased naively, so section headers read "Ssh",
"Dns", "Libreportal". Add a whole-word acronym/brand map so they render
professionally as "SSH", "DNS", "LibrePortal" (also covers VPN/API/IP/UI/URL/
HTTP(S)/TLS/SSL/WebUI for future files). Composes with stripCategoryPrefix,
which runs after and is case-insensitive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-07-06 22:47:10 +01:00
parent 431d6561a8
commit e0e13f7566

View File

@ -5,7 +5,16 @@ class ConfigUtils {
}
formatSubcategoryName(subcategoryName) {
return subcategoryName.replace(/_/g, ' ').replace(/\b\w/g, function(l) { return l.toUpperCase(); });
var name = subcategoryName.replace(/_/g, ' ').replace(/\b\w/g, function(l) { return l.toUpperCase(); });
// Naive title-casing mangles acronyms/brand names ("Ssh", "Dns",
// "Libreportal"). Fix known ones per whole word so sections read
// professionally ("SSH", "DNS", "LibrePortal").
var ACRONYMS = {
Ssh: 'SSH', Dns: 'DNS', Vpn: 'VPN', Api: 'API', Ip: 'IP', Ui: 'UI',
Url: 'URL', Http: 'HTTP', Https: 'HTTPS', Tls: 'TLS', Ssl: 'SSL',
Webui: 'WebUI', Libreportal: 'LibrePortal'
};
return name.split(' ').map(function(w) { return ACRONYMS[w] || w; }).join(' ');
}
cleanDescription(description) {