a72aa5253a04ff2109560056550f87a40bcc91c5
[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 <%- if luci.model.uci.get_statevalue("network", "lan", "up") == "1" then %>
70 <br />
71 <h2><%:m_n_local%></h2>
72 <table cellspacing="0" cellpadding="6" class="smalltext">
73   <tr>
74     <th><%:ipaddress%>:</th>
75     <td><%=luci.model.uci.get_statevalue("network", "lan", "ipaddr")%></td>
76   </tr>
77   <tr>
78     <th><%:netmask%>:</th>
79     <td><%=luci.model.uci.get_statevalue("network", "lan", "netmask")%></td>
80   </tr>
81 </table>
82 <%- end %>
83
84
85 <%- if luci.model.uci.get_statevalue("network", "lan", "up") == "1" then %>
86 <br />
87 <h2><%:m_n_inet%></h2>
88 <table cellspacing="0" cellpadding="6" class="smalltext">
89   <tr>
90     <th><%:ipaddress%>:</th>
91     <td><%=luci.model.uci.get_statevalue("network", "wan", "ipaddr")%></td>
92   </tr>
93   <tr>
94     <th><%:netmask%>:</th>
95     <td><%=luci.model.uci.get_statevalue("network", "wan", "netmask")%></td>
96   </tr>
97 </table>
98 <%- end %>
99
100 <%- if next(iwconfig) then %> 
101 <h2><%:wifi%></h2>
102 <br />
103 <table cellspacing="0" cellpadding="6" class="smalltext">
104 <tr>
105 <th><%:name%></th>
106 <th><%:protocol%></th>
107 <th><%:frequency%></th>
108 <th><%:power%></th>
109 <th><%:bitrate%></th>
110 <th><%:rts%></th>
111 <th><%:frag%></th>
112 <th><%:link%></th>
113 <th><%:signal%></th>
114 <th><%:noise%></th>
115 </tr>
116 <%for k, v in pairs(iwconfig) do
117 %>
118 <tr>
119 <td rowspan="2"><%=k%></td>
120 <td><%=v[1]%></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>
129 </tr>
130 <tr>
131 <td colspan="4"><strong>ESSID: </strong><%=v.ESSID%></td>
132 <td colspan="5"><strong>BSSID: </strong><%=(v.Cell or v["Access Point"])%></td>
133 </tr>
134 <%end%>
135 </table>
136 <%-end%>
137 <%+footer%>