<% local stat = require "luci.tools.status" local ver = require "luci.version" local has_dhcp = fs.access("/etc/config/dhcp") local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0) local sysinfo = luci.util.ubus("system", "info") or { } local boardinfo = luci.util.ubus("system", "board") or { } local unameinfo = nixio.uname() or { } local meminfo = sysinfo.memory or { total = 0, free = 0, buffered = 0, shared = 0 } local swapinfo = sysinfo.swap or { total = 0, free = 0 } -%> <%+header%>

<%:Status%>

<%:Router Model%> <%=pcdata(boardinfo.model or boardinfo.system or "?")%> <%:Wan Type%> <%:Wan IP%> <%:Connected%>
<%:Local Time%> - <%:Flash Size%> <%=luci.sys.exec("flashkb=`dmesg |grep spi |grep Kbytes|awk -F'(' '{print $2}'|awk -F' ' '{print $1}'`;if [ ${#flashkb} -gt 0 ];then let flashmb=$flashkb/1024;echo $flashmb;else dmesg |grep nand|grep MiB|head -n1|awk -F':' '{print $2}'|awk -F' ' '{print $3}'|awk -F'MiB' '{print $1}';fi;") or "?"%>MB <%:Wan Gateway%> <%:DNS1%>
<%:Uptime%> - <%:Lan Status%> <%:Lan Type%> <%:Lan IP%>
<%:Load Average%> - <%:firmware-info%> <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> 不同生活技术部
<%:Cpu Model%> <%=luci.sys.exec("grep -E 'system type|Hardware' /proc/cpuinfo |awk -F ': ' '{print $2}'") or "?"%>
<%:Total Available%> - "> <%:Wan Set%> "> <%:Lan Set%> "> <%:Wireless Set%>
<%:Active Connections%> -
<% if has_dhcp then %>
<%:DHCP Leases%>
<%:Hostname%> <%:IPv4-Address%> <%:MAC-Address%> <%:Leasetime remaining%>

<%:Collecting data...%>
<% end %> <% if has_wifi then %>
<%:Wireless%>
<%:Collecting data...%>
<%:Associated Stations%>
  <%:MAC-Address%> <%:Network%> <%:Signal%> <%:Noise%> <%:RX Rate%> <%:TX Rate%>

<%:Collecting data...%>
<% end %> <%+footer%>