<%# Opennet Firmware Copyright 2010 Rene Ejury Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: index.htm 5448 2009-10-31 15:54:11Z jow $ -%> <%+header%> <% local uci = require "luci.model.uci" local cursor = uci.cursor() local version = cursor:get("on-core", "defaults", "version") local id = cursor:get("on-core", "settings", "on_id") function printZoneLine(zoneName) networks = cursor:get("firewall", "zone_"..zoneName, "network") if networks and relevant(networks) then %> <%=luci.i18n.translate("on_status_network_"..zoneName) %> <% printInterfaces(networks) %> <% end end function relevant(networks) for network in networks:gmatch("%S+") do iface = cursor:get("network", network, "ifname") if iface and luci.sys.exec("ip address show label "..iface) ~= "" then return true end end return false end function printInterfaces(networks) %> <% for network in networks:gmatch("%S+") do printValues(network) end %>
<%:on_networks_iface%> <%:on_networks_ip%> <%:on_networks_mac%> <%:on_networks_dhcp%>
<% end function printValues(network) ifname = cursor:get("network", network, "ifname") if not ifname then return end output = luci.sys.exec("ip address show label "..ifname.." | awk 'BEGIN {RS=\"qlen\"} /ether/ {print \"\"..ifname.."\\\"$7\"\\\"$3\"\\"; exit}'") if output and output ~= "" then %> <%=output%> <% local dhcp = cursor:get_all("dhcp", network) if dhcp and dhcp.ignore ~= "1" then %> <%=dhcp.start.." / "..dhcp.limit.." / "..dhcp.leasetime%> <% else print("---") end %> <% end end %>

<%:on_status_title_prefix%><%=version%><%:on_status_title_postfix%><%=id%>

<%:on_status_intro%>