From: Jo-Philipp Wich <jow@openwrt.org>
Date: Tue, 26 Jun 2012 21:49:15 +0000 (+0000)
Subject: libs/web: extend network_ifacelist widget to display all networks an iface is member of
X-Git-Tag: 0.11.0~576
X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fe7424b68e920cd5472978beeaf32763a83bd391;p=oweals%2Fluci.git

libs/web: extend network_ifacelist widget to display all networks an iface is member of
---

diff --git a/libs/web/luasrc/view/cbi/network_ifacelist.htm b/libs/web/luasrc/view/cbi/network_ifacelist.htm
index a6565eb9f..727b0a4a6 100644
--- a/libs/web/luasrc/view/cbi/network_ifacelist.htm
+++ b/libs/web/luasrc/view/cbi/network_ifacelist.htm
@@ -51,7 +51,13 @@
 			<% if link then -%><a href="<%=link%>"><% end -%>
 			<img title="<%=iface:get_type_i18n()%>" style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
 			<% if link then -%></a><% end -%>
-			<%=pcdata(iface:get_i18n())%><% local n = iface:get_network(); if n then %> (<a href="<%=n:adminlink()%>"><%=n:name()%></a>)<% end %>
+			<%=pcdata(iface:get_i18n())%>
+			<% local ns = iface:get_networks(); if #ns > 0 then %>(
+				<%- local i, n; for i, n in ipairs(ns) do -%>
+					<%-= (i>1) and ', ' -%>
+					<a href="<%=n:adminlink()%>"><%=n:name()%></a>
+				<%- end -%>
+			)<% end %>
 		</label>
 	</li>
 	<% end end %>