1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
12 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
13 <meta name='robots' content='noindex,nofollow'
>
14 <title>[<%
ident(); %>] Status: Overview
</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'
>
16 <link rel='stylesheet' type='text/css' href='color.css'
>
17 <script type='text/javascript' src='tomato.js'
></script>
21 <style type='text/css'
>
29 <script type='text/javascript' src='debug.js'
></script>
31 <script type='text/javascript'
>
32 ghz
= ['2.412','2.417','2.422','2.427','2.432','2.437','2.442','2.447','2.452','2.457','2.462','2.467','2.472','2.484'];
33 wmo
= {'ap':'Access Point','sta':'Wireless Client','wet':'Wireless Ethernet Bridge','wds':'WDS'};
34 auth
= {'disabled':'-','wep':'WEP','wpa_personal':'WPA Personal (PSK)','wpa_enterprise':'WPA Enterprise','wpa2_personal':'WPA2 Personal (PSK)','wpa2_enterprise':'WPA2 Enterprise','wpaX_personal':'WPA / WPA2 Personal','wpaX_enterprise':'WPA / WPA2 Enterprise','radius':'Radius'};
35 enc
= {'tkip':'TKIP','aes':'AES','tkip+aes':'TKIP / AES'};
36 bgmo
= {'disabled':'-','mixed':'Mixed B+G','b-only':'B Only','g-only':'G Only'};
39 <script type='text/javascript' src='status-data.jsx?_http_id=<%
nv(http_id
); %>'
></script>
41 <script type='text/javascript'
>
42 show_dhcpc
= ((nvram
.wan_proto
== 'dhcp') || (nvram
.wan_proto
== 'l2tp'));
43 show_codi
= ((nvram
.wan_proto
== 'pppoe') || (nvram
.wan_proto
== 'l2tp') || (nvram
.wan_proto
== 'pptp'));
44 show_radio
= (nvram
.wl_radio
== '1');
49 form
.submitHidden('dhcpc.cgi', { exec
: what
, _redirect
: 'status-overview.asp' });
52 function serv(service
, sleep
)
54 form
.submitHidden('service.cgi', { _service
: service
, _redirect
: 'status-overview.asp', _sleep
: sleep
});
57 function wan_connect()
59 serv('wan-restart', 5);
62 function wan_disconnect()
69 form
.submitHidden('wlradio.cgi', { enable
: '' + n
, _nextpage
: 'status-overview.asp', _nextwait
: n
? 10 : 3 });
72 var ref
= new TomatoRefresh('status-data.jsx', '', 0, 'status_overview_refresh');
74 ref
.refresh = function(text
)
89 E(id
).cells
[1].innerHTML
= htm
;
94 c('cpu', stats
.cpuload
);
95 c('uptime', stats
.uptime
);
96 c('time', stats
.time
);
97 c('wanip', stats
.wanip
);
98 c('wannetmask', stats
.wannetmask
);
99 c('wangateway', stats
.wangateway
);
101 c('memory', stats
.memory
);
103 c('wanstatus', stats
.wanstatus
);
104 c('wanuptime', stats
.wanuptime
);
105 if (show_dhcpc
) c('wanlease', stats
.wanlease
);
107 E('b_connect').disabled
= stats
.wanup
;
108 E('b_disconnect').disabled
= !stats
.wanup
;
111 c('radio', wlradio
? 'Enabled' : '<b>Disabled</b>');
113 E('b_wl_enable').disabled
= wlradio
;
114 E('b_wl_disable').disabled
= !wlradio
;
116 c('channel', stats
.channel
);
121 c('qual', stats
.qual
);
127 elem
.display('b_dhcpc', show_dhcpc
);
128 elem
.display('b_connect', 'b_disconnect', show_codi
);
129 elem
.display('wan-title', 'wan-section', nvram
.wan_proto
!= 'disabled');
130 elem
.display('b_wl_enable', 'b_wl_disable', show_radio
);
136 ref
.initPage(3000, 3);
141 <body onload='init()'
>
143 <table id='container' cellspacing=
0>
144 <tr><td colspan=
2 id='header'
>
145 <div class='title'
>Tomato
</div>
146 <div class='version'
>Version <%
version(); %></div>
148 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
150 <div id='ident'
><%
ident(); %></div>
154 <div class='section-title'
>System
</div>
155 <div class='section'
>
156 <script type='text/javascript'
>
157 createFieldTable('', [
158 { title
: 'Name', text
: nvram
.router_name
},
159 { title
: 'Model', text
: nvram
.t_model_name
},
161 { title
: 'Time', rid
: 'time', text
: stats
.time
},
162 { title
: 'Uptime', rid
: 'uptime', text
: stats
.uptime
},
163 { title
: 'CPU Load <small>(1 / 5 / 15 mins)</small>', rid
: 'cpu', text
: stats
.cpuload
},
164 { title
: 'Total / Free Memory', rid
: 'memory', text
: stats
.memory
}
169 <div class='section-title' id='wan-title'
>WAN
</div>
170 <div class='section' id='wan-section'
>
171 <script type='text/javascript'
>
172 createFieldTable('', [
173 { title
: 'MAC Address', text
: nvram
.wan_hwaddr
},
174 { title
: 'Connection Type', text
: { 'dhcp':'DHCP', 'static':'Static IP', 'pppoe':'PPPoE', 'pptp':'PPTP', 'l2tp':'L2TP' }[nvram
.wan_proto
] || '-' },
175 { title
: 'IP Address', rid
: 'wanip', text
: stats
.wanip
},
176 { title
: 'Subnet Mask', rid
: 'wannetmask', text
: stats
.wannetmask
},
177 { title
: 'Gateway', rid
: 'wangateway', text
: stats
.wangateway
},
178 { title
: 'DNS', rid
: 'dns', text
: stats
.dns
},
179 { title
: 'MTU', text
: nvram
.wan_run_mtu
},
181 { title
: 'Status', rid
: 'wanstatus', text
: stats
.wanstatus
},
182 { title
: 'Connection Uptime', rid
: 'wanuptime', text
: stats
.wanuptime
},
183 { title
: 'Remaining Lease Time', rid
: 'wanlease', text
: stats
.wanlease
, ignore
: !show_dhcpc
}
186 <span id='b_dhcpc' style='display:none'
>
187 <input type='button' class='controls' onclick='dhcpc(
"renew")' value='Renew'
>
188 <input type='button' class='controls' onclick='dhcpc(
"release")' value='Release'
>
190 <input type='button' class='controls' onclick='wan_connect()' value='Connect' id='b_connect' style='display:none'
>
191 <input type='button' class='controls' onclick='wan_disconnect()' value='Disconnect' id='b_disconnect' style='display:none'
>
195 <div class='section-title'
>LAN
</div>
196 <div class='section'
>
197 <script type='text/javascript'
>
198 if (nvram
.lan_proto
== 'dhcp') {
199 if ((!fixIP(nvram
.dhcpd_startip
)) || (!fixIP(nvram
.dhcpd_endip
))) {
200 var x
= nvram
.lan_ipaddr
.split('.').splice(0, 3).join('.') + '.';
201 nvram
.dhcpd_startip
= x
+ nvram
.dhcp_start
;
202 nvram
.dhcpd_endip
= x
+ ((nvram
.dhcp_start
* 1) + (nvram
.dhcp_num
* 1) - 1);
204 s
= '<a href="status-devices.asp">' + nvram
.dhcpd_startip
+ ' - ' + nvram
.dhcpd_endip
+ '</a>';
209 createFieldTable('', [
210 { title
: 'Router MAC Address', text
: nvram
.et0macaddr
},
211 { title
: 'Router IP Address', text
: nvram
.lan_ipaddr
},
212 { title
: 'Subnet Mask', text
: nvram
.lan_netmask
},
213 { title
: 'Gateway', text
: nvram
.lan_gateway
, ignore
: nvram
.wan_proto
!= 'disabled' },
214 { title
: 'DNS', rid
: 'dns', text
: stats
.dns
, ignore
: nvram
.wan_proto
!= 'disabled' },
215 { title
: 'DHCP', text
: s
}
220 <div class='section-title' id='wl-title'
>Wireless
</div>
221 <div class='section' id='wl-section'
>
222 <script type='text/javascript'
>
223 sec
= auth
[nvram
.security_mode2
];
224 if (sec
.indexOf('WPA') != -1) sec
+= ' + ' + enc
[nvram
.wl_crypto
];
226 wmode
= wmo
[nvram
.wl_mode
];
227 if ((nvram
.wl_mode
== 'ap') && (nvram
.wds_enable
* 1)) wmode
+= ' + WDS';
229 createFieldTable('', [
230 { title
: 'MAC Address', text
: nvram
.wl0_hwaddr
},
231 { title
: 'Wireless Mode', text
: wmode
},
232 { title
: 'B/G Mode', text
: bgmo
[nvram
.wl_net_mode
] },
233 { title
: 'Radio', rid
: 'radio', text
: (wlradio
== 0) ? '<b>Disabled</b>' : 'Enabled' },
234 { title
: 'SSID', text
: nvram
.wl_ssid
},
235 { title
: 'Security', text
: sec
},
236 { title
: 'Channel', rid
: 'channel', text
: stats
.channel
},
237 { title
: 'RSSI', rid
: 'rssi', text
: wlcrssi
, ignore
: !isClient
},
238 { title
: 'Noise', rid
: 'noise', text
: wlnoise
, ignore
: !isClient
},
239 { title
: 'Signal Quality', rid
: 'qual', text
: stats
.qual
, ignore
: !isClient
}
242 <input type='button' class='controls' onclick='wlenable(
1)' id='b_wl_enable' value='Enable' style='display:none'
>
243 <input type='button' class='controls' onclick='wlenable(
0)' id='b_wl_disable' value='Disable' style='display:none'
>
249 <tr><td id='footer' colspan=
2>
250 <script type='text/javascript'
>genStdRefresh(1,0,'ref.toggle()');</script>
254 <script type='text/javascript'
>earlyInit()</script>