contrib: remove recursive deps between theme-bootstrap and luci-base
[project/luci.git] / modules / base / luasrc / luasrc / view / cbi / network_netinfo.htm
1 <%+cbi/valueheader%>
2
3 <%-
4         local value = self:formvalue(section)
5         if not value or value == "-" then
6                 value = self:cfgvalue(section) or self.default
7         end
8
9         local nwm = require "luci.model.network".init()
10         local net = nwm:get_network(value)
11 -%>
12
13 <% if net then %>
14 <span class="ifacebadge"><%=net:name()%>:
15         <%
16                 local empty = true
17                 for _, iface in ipairs(net:get_interfaces() or { net:get_interface() }) do
18                         if not iface:is_bridge() then
19                                 empty = false
20          %>
21                 <img<%=attr("title", iface:get_i18n())%> style="width:16px; height:16px; vertical-align:middle" src="<%=resource%>/icons/<%=iface:type()%><%=iface:is_up() and "" or "_disabled"%>.png" />
22         <% end end %>
23         <% if empty then %><em><%:(no interfaces attached)%></em><% end %>
24 </span>
25 <% end %>
26
27 <%+cbi/valuefooter%>