2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
17 local system, model, memtotal = luci.sys.sysinfo()
19 local uptime = luci.sys.uptime()
20 uptime = tonumber(uptime)
22 local utdays = math.floor(uptime / 86400)
23 uptime = uptime % 86400
24 local uthour = math.floor(uptime / 3600)
25 uptime = uptime % 3600
26 local utmins = math.floor(uptime / 60)
27 local utsecs = uptime % 60
29 local iwconfig = luci.sys.wifi.getiwconfig()
31 <h1><%:a_i_i_hello%></h1>
32 <p><%:a_i_i_admin1%></p>
33 <p><%:a_i_i_admin2%><br />
35 <p><%:a_i_i_admin6%></p>
36 <p><em><strong><a href="<%=controller%>/about"><%:a_i_i_team%></a></strong></em></p>
41 <table cellspacing="0" cellpadding="6" class="smalltext">
43 <th><%:hostname%>:</th>
44 <td><%=luci.sys.hostname()%></td>
51 <th><%:m_i_processor%>:</th>
55 <th><%:m_i_memory%>:</th>
56 <td><%=string.format("%.2f", tonumber(memtotal) / 1024)%> MiB</td>
59 <th><%:m_i_systemtime%>:</th>
60 <td><%=os.date("%c")%></td>
63 <th><%:m_i_uptime%>:</th>
64 <td><%=string.format("%dd %d:%d:%.0f", utdays, uthour, utmins, utsecs)%></td>
70 <h2><%:m_n_local%></h2>
71 <table cellspacing="0" cellpadding="6" class="smalltext">
73 <th><%:ipaddress%>:</th>
74 <td><%=luci.model.uci.get_statevalue("network", "lan", "ipaddr")%></td>
77 <th><%:netmask%>:</th>
78 <td><%=luci.model.uci.get_statevalue("network", "lan", "netmask")%></td>
84 <h2><%:m_n_inet%></h2>
85 <table cellspacing="0" cellpadding="6" class="smalltext">
87 <th><%:ipaddress%>:</th>
88 <td><%=luci.model.uci.get_statevalue("network", "wan", "ipaddr")%></td>
91 <th><%:netmask%>:</th>
92 <td><%=luci.model.uci.get_statevalue("network", "wan", "netmask")%></td>
96 <%- if next(iwconfig) then %>
99 <table cellspacing="0" cellpadding="6" class="smalltext">
102 <th><%:protocol%></th>
103 <th><%:frequency%></th>
105 <th><%:bitrate%></th>
112 <%for k, v in pairs(iwconfig) do
115 <td rowspan="2"><%=k%></td>
117 <td><%=v.Frequency%></td>
118 <td><%=v["Tx-Power"]%></td>
119 <td><%=v["Bit Rate"]%></td>
120 <td><%=v["RTS thr"]%></td>
121 <td><%=v["Fragment thr"]%></td>
122 <td><%=v["Link Quality"]%></td>
123 <td><%=v["Signal level"]%></td>
124 <td><%=v["Noise level"]%></td>
127 <td colspan="4"><strong>ESSID: </strong><%=v.ESSID%></td>
128 <td colspan="5"><strong>BSSID: </strong><%=(v.Cell or v["Access Point"])%></td>