From 20fdac1ac4a126ceebde13fb627a9f88bba0e2b3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 17 Nov 2015 17:42:22 +0100 Subject: [PATCH] luci-mod-admin-full: allow empty mac in interface status Also adjust for changed IP address format emitted by iface_status call. Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/admin_network/iface_overview.htm | 14 ++++++-------- .../luasrc/view/admin_network/iface_status.htm | 7 +++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm index 2967647fd..01f9fb01e 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_overview.htm @@ -135,7 +135,7 @@ html += String.format('<%:Uptime%>: %t
', ifc.uptime); } - if (ifc.type != 'tunnel') + if (ifc.macaddr) { html += String.format('<%:MAC-Address%>: %s
', ifc.macaddr); } @@ -153,10 +153,9 @@ for (var i = 0; i < ifc.ipaddrs.length; i++) html += String.format( - '%s%s/%d', + '%s%s', i ? ', ' : '', - ifc.ipaddrs[i].addr, - ifc.ipaddrs[i].prefix + ifc.ipaddrs[i] ); html += '
'; @@ -168,10 +167,9 @@ for (var i = 0; i < ifc.ip6addrs.length; i++) html += String.format( - '%s%s/%d', + '%s%s', i ? ', ' : '', - ifc.ip6addrs[i].addr.toUpperCase(), - ifc.ip6addrs[i].prefix + ifc.ip6addrs[i].toUpperCase() ); html += '
'; @@ -250,7 +248,7 @@ '" title="<%:Edit this interface%>" value="<%:Edit%>" id="<%=net[1]%>-ifc-edit" /> - + <% end %> diff --git a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm index 1ebdbfcfb..adf6dccd5 100644 --- a/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm +++ b/modules/luci-mod-admin-full/luasrc/view/admin_network/iface_status.htm @@ -25,7 +25,7 @@ html += String.format('<%:Uptime%>: %t
', ifc.uptime); } - if (ifc.type != 'tunnel') + if (ifc.macaddr) { html += String.format('<%:MAC-Address%>: %s
', ifc.macaddr); } @@ -43,10 +43,9 @@ for (var i = 0; i < ifc.ipaddrs.length; i++) html += String.format( - '%s%s/%d', + '%s%s', i ? ', ' : '', - ifc.ipaddrs[i].addr, - ifc.ipaddrs[i].prefix + ifc.ipaddrs[i] ); html += '
'; -- 2.11.0