From e0e13f7566734a556afd305251e003649c1f524b Mon Sep 17 00:00:00 2001 From: librelad Date: Mon, 6 Jul 2026 22:47:10 +0100 Subject: [PATCH] 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) Signed-off-by: librelad --- .../components/admin/config/js/config-utils.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/containers/libreportal/frontend/components/admin/config/js/config-utils.js b/containers/libreportal/frontend/components/admin/config/js/config-utils.js index cf1bd64..436960d 100755 --- a/containers/libreportal/frontend/components/admin/config/js/config-utils.js +++ b/containers/libreportal/frontend/components/admin/config/js/config-utils.js @@ -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) {