luci-app-ddns: Fix multiple IP display bug
authorPaul Donald <[email protected]>
Wed, 23 Apr 2025 12:03:50 +0000 (14:03 +0200)
committerPaul Donald <[email protected]>
Wed, 23 Apr 2025 12:26:37 +0000 (14:26 +0200)
Occasionally, a DNS lookup returns multiple IPs, so the best thing to
do isn't to join them together as a unified string, but to separate
them with an HTML <br/>.

Signed-off-by: Paul Donald <[email protected]>
(cherry picked from commit 54192d3b3659e0ef94c976c84f71f85efdb4528d)

applications/luci-app-ddns/root/usr/share/rpcd/ucode/ddns.uc

index 3a8e5cf50a32aaa83410b88e4776cf13d0684060..3978672200d816bd053d515fb93c0c0b667628a8 100644 (file)
@@ -178,7 +178,7 @@ const methods = {
                                }
 
                                res[section] = {
-                                       ip: ip ? replace(ip, '\n', '') : null,
+                                       ip: ip ? replace(trim(ip), '\n', '<br/>') : null,
                                        last_update: lastUpdate !== 0 ? convertedLastUpdate : null,
                                        next_update: nextUpdate || null,
                                        pid: pid || null,