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
16 local system, model, memtotal = luci.sys.sysinfo()
18 local uptime = luci.sys.uptime()
19 uptime = tonumber(uptime)
21 local utdays = math.floor(uptime / 86400)
22 uptime = uptime % 86400
23 local uthour = math.floor(uptime / 3600)
24 uptime = uptime % 3600
25 local utmins = math.floor(uptime / 60)
26 local utsecs = uptime % 60
28 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>
69 <%- if luci.model.uci.get_statevalue("network", "lan", "up") == "1" then %>
71 <h2><%:m_n_local%></h2>
72 <table cellspacing="0" cellpadding="6" class="smalltext">
74 <th><%:ipaddress%>:</th>
75 <td><%=luci.model.uci.get_statevalue("network", "lan", "ipaddr")%></td>
78 <th><%:netmask%>:</th>
79 <td><%=luci.model.uci.get_statevalue("network", "lan", "netmask")%></td>
85 <%- if luci.model.uci.get_statevalue("network", "lan", "up") == "1" then %>
87 <h2><%:m_n_inet%></h2>
88 <table cellspacing="0" cellpadding="6" class="smalltext">
90 <th><%:ipaddress%>:</th>
91 <td><%=luci.model.uci.get_statevalue("network", "wan", "ipaddr")%></td>
94 <th><%:netmask%>:</th>
95 <td><%=luci.model.uci.get_statevalue("network", "wan", "netmask")%></td>
100 <%- if next(iwconfig) then %>
103 <table cellspacing="0" cellpadding="6" class="smalltext">
106 <th><%:protocol%></th>
107 <th><%:frequency%></th>
109 <th><%:bitrate%></th>
116 <%for k, v in pairs(iwconfig) do
119 <td rowspan="2"><%=k%></td>
121 <td><%=v.Frequency%></td>
122 <td><%=v["Tx-Power"]%></td>
123 <td><%=v["Bit Rate"]%></td>
124 <td><%=v["RTS thr"]%></td>
125 <td><%=v["Fragment thr"]%></td>
126 <td><%=v["Link Quality"]%></td>
127 <td><%=v["Signal level"]%></td>
128 <td><%=v["Noise level"]%></td>
131 <td colspan="4"><strong>ESSID: </strong><%=v.ESSID%></td>
132 <td colspan="5"><strong>BSSID: </strong><%=(v.Cell or v["Access Point"])%></td>