for-15-05: luci-mod-admin-full: update IPv4/IPv6 list views
authorHannu Nyman <hannu.nyman@iki.fi>
Fri, 18 Dec 2015 17:19:36 +0000 (19:19 +0200)
committerHannu Nyman <hannu.nyman@iki.fi>
Fri, 18 Dec 2015 17:25:01 +0000 (19:25 +0200)
Clarify address presentation on the Network/Interfaces page
by backporting f8d0ba00b2ff27dc9e2f10712bc343ae655fbdf9 :
  For better view of 'Interface Overview' IPv4/IPv6 addresses for
  interfaces should be displayed as lists, but not as comma separated
  strings.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm

index 1de3498..682edc4 100644 (file)
 
                                                if (ifc.ipaddrs && ifc.ipaddrs.length)
                                                {
-                                                       html += '<strong><%:IPv4%>: </strong>';
-
                                                        for (var i = 0; i < ifc.ipaddrs.length; i++)
                                                                html += String.format(
-                                                                       '%s%s/%d',
-                                                                       i ? ', ' : '',
+                                                                       '<strong><%:IPv4%>:</strong> %s/%d<br />',
                                                                        ifc.ipaddrs[i].addr,
                                                                        ifc.ipaddrs[i].prefix
                                                                );
-
-                                                       html += '<br />';
                                                }
 
                                                if (ifc.ip6addrs && ifc.ip6addrs.length)
                                                {
-                                                       html += '<strong><%:IPv6%>: </strong>';
-
                                                        for (var i = 0; i < ifc.ip6addrs.length; i++)
                                                                html += String.format(
-                                                                       '%s%s/%d',
-                                                                       i ? ', ' : '',
-                                                                       ifc.ip6addrs[i].addr.toUpperCase(),
+                                                                       '<strong><%:IPv6%>:</strong> %s/%d<br />',
+                                                                       ifc.ip6addrs[i].addr,
                                                                        ifc.ip6addrs[i].prefix
                                                                );
-
-                                                       html += '<br />';
                                                }
 
                                                d.innerHTML = html;