e00100c18b7317ee256b00e486ff94f0a855ee1a
[project/luci.git] / modules / admin-mini / luasrc / view / mini / index.htm
1 <%#
2 LuCI - Lua Configuration Interface
3 Copyright 2008 Steven Barth <steven@midlink.org>
4 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
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
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 -%>
15 <%+header%>
16 <%-
17 local system, model, memtotal = luci.sys.sysinfo()
18
19 local uptime = luci.sys.uptime()
20 uptime = tonumber(uptime)
21
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
28
29 local iwconfig = luci.sys.wifi.getiwconfig()
30 -%>
31 <h1><%:a_i_i_hello%></h1>
32 <p><%:a_i_i_admin1%></p>
33 <p><%:a_i_i_admin2%><br />
34 <%:a_i_i_admin3%></p>
35 <p><%:a_i_i_admin6%></p>
36 <p><em><strong><a href="<%=controller%>/about"><%:a_i_i_team%></a></strong></em></p>
37 <br />
38 <hr />
39 <br />
40 <h2>Systemstatus</h2>
41 <table cellspacing="0" cellpadding="6" class="smalltext">
42   <tr>
43     <th><%:hostname%>:</th>
44     <td><%=luci.sys.hostname()%></td>
45   </tr>
46   <tr>
47     <th><%:system%>:</th>
48     <td><%=system%></td>
49   </tr>
50   <tr>
51     <th><%:m_i_processor%>:</th>
52     <td><%=model%></td>
53   </tr>
54   <tr>
55     <th><%:m_i_memory%>:</th>
56     <td><%=string.format("%.2f", tonumber(memtotal) / 1024)%> MiB</td>
57   </tr>
58   <tr>
59     <th><%:m_i_systemtime%>:</th>
60     <td><%=os.date("%c")%></td>
61   </tr>
62   <tr>
63     <th><%:m_i_uptime%>:</th>
64     <td><%=string.format("%dd %d:%d:%.0f", utdays, uthour, utmins, utsecs)%></td>
65   </tr>
66 </table>
67
68
69 <br />
70 <h2><%:m_n_local%></h2>
71 <table cellspacing="0" cellpadding="6" class="smalltext">
72   <tr>
73     <th><%:ipaddress%>:</th>
74     <td><%=luci.model.uci.get_statevalue("network", "lan", "ipaddr")%></td>
75   </tr>
76   <tr>
77     <th><%:netmask%>:</th>
78     <td><%=luci.model.uci.get_statevalue("network", "lan", "netmask")%></td>
79   </tr>
80 </table>
81
82
83 <br />
84 <h2><%:m_n_inet%></h2>
85 <table cellspacing="0" cellpadding="6" class="smalltext">
86   <tr>
87     <th><%:ipaddress%>:</th>
88     <td><%=luci.model.uci.get_statevalue("network", "wan", "ipaddr")%></td>
89   </tr>
90   <tr>
91     <th><%:netmask%>:</th>
92     <td><%=luci.model.uci.get_statevalue("network", "wan", "netmask")%></td>
93   </tr>
94 </table>
95
96 <%- if next(iwconfig) then %> 
97 <h2><%:wifi%></h2>
98 <br />
99 <table cellspacing="0" cellpadding="6" class="smalltext">
100 <tr>
101 <th><%:name%></th>
102 <th><%:protocol%></th>
103 <th><%:frequency%></th>
104 <th><%:power%></th>
105 <th><%:bitrate%></th>
106 <th><%:rts%></th>
107 <th><%:frag%></th>
108 <th><%:link%></th>
109 <th><%:signal%></th>
110 <th><%:noise%></th>
111 </tr>
112 <%for k, v in pairs(iwconfig) do
113 %>
114 <tr>
115 <td rowspan="2"><%=k%></td>
116 <td><%=v[1]%></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>
125 </tr>
126 <tr>
127 <td colspan="4"><strong>ESSID: </strong><%=v.ESSID%></td>
128 <td colspan="5"><strong>BSSID: </strong><%=(v.Cell or v["Access Point"])%></td>
129 </tr>
130 <%end%>
131 </table>
132 <%-end%>
133 <%+footer%>