network_netinfo.htm 775 B

123456789101112131415161718192021222324252627
  1. <%+cbi/valueheader%>
  2. <%-
  3. local value = self:formvalue(section)
  4. if not value or value == "-" then
  5. value = self:cfgvalue(section) or self.default
  6. end
  7. local nwm = require "luci.model.network".init()
  8. local net = nwm:get_network(value)
  9. -%>
  10. <% if net then %>
  11. <span class="ifacebadge"><%=net:name()%>:
  12. <%
  13. local empty = true
  14. for _, iface in ipairs(net:get_interfaces() or { net:get_interface() }) do
  15. if not iface:is_bridge() then
  16. empty = false
  17. %>
  18. <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" />
  19. <% end end %>
  20. <% if empty then %><em><%:(no interfaces attached)%></em><% end %>
  21. </span>
  22. <% end %>
  23. <%+cbi/valuefooter%>