luci-mod: use built-in format for wifi hostname
authorPaul Donald <redacted>
Mon, 20 Apr 2026 12:45:56 +0000 (14:45 +0200)
committerPaul Donald <redacted>
Mon, 20 Apr 2026 12:46:13 +0000 (14:46 +0200)
Signed-off-by: Paul Donald <redacted>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/60_wifi.js

index 36c88b4533483ffa8bcaad503e888aab03d3a0d0..a9ab42c791f4347b5e53ffe8ef0f31ea94f9015c 100644 (file)
@@ -713,9 +713,9 @@ return view.extend({
                        let hint;
 
                        if (name && ipv4 && ipv6)
-                               hint = `${name} <span class="hide-xs">(${ipv4}, ${ipv6})</span>`;
+                               hint = `${'%h'.format(name)} <span class="hide-xs">(${ipv4}, ${ipv6})</span>`;
                        else if (name && (ipv4 ?? ipv6))
-                               hint = `${name} <span class="hide-xs">(${ipv4 || ipv6})</span>`;
+                               hint = `${'%h'.format(name)} <span class="hide-xs">(${ipv4 || ipv6})</span>`;
                        else
                                hint = name || ipv4 || ipv6 || '?';
 
index 01f7cbe0d565b06542cffa24c63b796564001cf4..96a9eece87d908607d537dc975665ce65b133589 100644 (file)
@@ -300,9 +300,9 @@ return baseclass.extend({
                                let hint;
 
                                if (name && ipv4 && ipv6)
-                                       hint = '%s <span class="hide-xs">(%s, %s)</span>'.format(name, ipv4, ipv6);
+                                       hint = '%h <span class="hide-xs">(%s, %s)</span>'.format(name, ipv4, ipv6);
                                else if (name && (ipv4 || ipv6))
-                                       hint = '%s <span class="hide-xs">(%s)</span>'.format(name, ipv4 || ipv6);
+                                       hint = '%h <span class="hide-xs">(%s)</span>'.format(name, ipv4 || ipv6);
                                else
                                        hint = name || ipv4 || ipv6 || '?';
 
git clone https://git.99rst.org/PROJECT