RSA Keylength to 1024
[tomato.git] / release / src / router / www / status-overview.asp
blobadfdca4f5db666f2c749ffcc35c55e6f9e822008
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 Tomato VLAN GUI
8 Copyright (C) 2011 Augusto Bott
9 http://code.google.com/p/tomato-sdhc-vlan/
11 For use with Tomato Firmware only.
12 No part of this file may be used without permission.
13 -->
14 <html>
15 <head>
16 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
17 <meta name='robots' content='noindex,nofollow'>
18 <title>[<% ident(); %>] Status: Overview</title>
19 <link rel='stylesheet' type='text/css' href='tomato.css'>
20 <% css(); %>
21 <script type='text/javascript' src='tomato.js'></script>
22 <script type='text/javascript' src='interfaces.js'></script>
24 <!-- / / / -->
26 <style type='text/css'>
27 .controls {
28 width: 90px;
29 margin-top: 5px;
30 margin-bottom: 10px;
32 </style>
34 <script type='text/javascript' src='debug.js'></script>
36 <script type='text/javascript'>
37 wmo = {'ap':'Access Point','sta':'Wireless Client','wet':'Wireless Ethernet Bridge','wds':'WDS'};
38 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'};
39 enc = {'tkip':'TKIP','aes':'AES','tkip+aes':'TKIP / AES'};
40 bgmo = {'disabled':'-','mixed':'Auto','b-only':'B Only','g-only':'G Only','bg-mixed':'B/G Mixed','lrs':'LRS','n-only':'N Only'};
42 lastjiffiestotal = 0;
43 lastjiffiesidle = 0;
44 lastjiffiesusage = 100;
45 </script>
47 <script type='text/javascript' src='wireless.jsx?_http_id=<% nv(http_id); %>'></script>
48 <script type='text/javascript' src='status-data.jsx?_http_id=<% nv(http_id); %>'></script>
50 <script type='text/javascript'>
51 show_dhcpc = ((nvram.wan_proto == 'dhcp') || (((nvram.wan_proto == 'l2tp') || (nvram.wan_proto == 'pptp')) && (nvram.pptp_dhcp == '1')));
52 show_codi = ((nvram.wan_proto == 'pppoe') || (nvram.wan_proto == 'l2tp') || (nvram.wan_proto == 'pptp'));
54 show_radio = [];
55 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
56 /* REMOVE-BEGIN
57 // show_radio.push((nvram['wl'+wl_unit(uidx)+'_radio'] == '1'));
58 REMOVE-END */
59 if (wl_sunit(uidx)<0)
60 show_radio.push((nvram['wl'+wl_fface(uidx)+'_radio'] == '1'));
63 nphy = features('11n');
65 function dhcpc(what)
67 form.submitHidden('dhcpc.cgi', { exec: what, _redirect: 'status-overview.asp' });
70 function serv(service, sleep)
72 form.submitHidden('service.cgi', { _service: service, _redirect: 'status-overview.asp', _sleep: sleep });
75 function wan_connect()
77 serv('wan-restart', 5);
80 function wan_disconnect()
82 serv('wan-stop', 2);
85 function wlenable(uidx, n)
87 form.submitHidden('wlradio.cgi', { enable: '' + n, _nextpage: 'status-overview.asp', _nextwait: n ? 6 : 3, _wl_unit: wl_unit(uidx) });
90 var ref = new TomatoRefresh('status-data.jsx', '', 0, 'status_overview_refresh');
92 ref.refresh = function(text)
94 stats = {};
95 try {
96 eval(text);
98 catch (ex) {
99 stats = {};
101 show();
105 function c(id, htm)
107 E(id).cells[1].innerHTML = htm;
110 function show()
112 c('cpu', stats.cpuload);
113 c('cpupercent', stats.cpupercent);
114 c('uptime', stats.uptime);
115 c('time', stats.time);
116 c('wanip', stats.wanip);
117 c('wannetmask', stats.wannetmask);
118 c('wangateway', stats.wangateway);
119 c('dns', stats.dns);
120 c('memory', stats.memory);
121 c('swap', stats.swap);
122 elem.display('swap', stats.swap != '');
124 /* IPV6-BEGIN */
125 c('ip6_wan', stats.ip6_wan);
126 elem.display('ip6_wan', stats.ip6_wan != '');
127 c('ip6_lan', stats.ip6_lan);
128 elem.display('ip6_lan', stats.ip6_lan != '');
129 c('ip6_lan_ll', stats.ip6_lan_ll);
130 elem.display('ip6_lan_ll', stats.ip6_lan_ll != '');
131 /* IPV6-END */
133 c('wanstatus', stats.wanstatus);
134 c('wanuptime', stats.wanuptime);
135 if (show_dhcpc) c('wanlease', stats.wanlease);
136 if (show_codi) {
137 E('b_connect').disabled = stats.wanup;
138 E('b_disconnect').disabled = !stats.wanup;
141 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
142 if (wl_sunit(uidx)<0) {
143 c('radio'+uidx, wlstats[uidx].radio ? 'Enabled' : '<b>Disabled</b>');
144 c('rate'+uidx, wlstats[uidx].rate);
145 if (show_radio[uidx]) {
146 E('b_wl'+uidx+'_enable').disabled = wlstats[uidx].radio;
147 E('b_wl'+uidx+'_disable').disabled = !wlstats[uidx].radio;
149 c('channel'+uidx, stats.channel[uidx]);
150 if (nphy) {
151 c('nbw'+uidx, wlstats[uidx].nbw);
153 c('interference'+uidx, stats.interference[uidx]);
154 elem.display('interference'+uidx, stats.interference[uidx] != '');
156 if (wlstats[uidx].client) {
157 c('rssi'+uidx, wlstats[uidx].rssi || '');
158 c('noise'+uidx, wlstats[uidx].noise || '');
159 c('qual'+uidx, stats.qual[uidx] || '');
162 c('ifstatus'+uidx, wlstats[uidx].ifstatus || '');
166 function earlyInit()
168 elem.display('b_dhcpc', show_dhcpc);
169 elem.display('b_connect', 'b_disconnect', show_codi);
170 if (nvram.wan_proto == 'disabled')
171 elem.display('wan-title', 'sesdiv_wan', 0);
172 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
173 if (wl_sunit(uidx)<0)
174 elem.display('b_wl'+wl_fface(uidx)+'_enable', 'b_wl'+wl_fface(uidx)+'_disable', show_radio[uidx]);
176 show();
179 function init() {
180 var c;
181 if (((c = cookie.get('status_overview_system_vis')) != null) && (c != '1')) toggleVisibility("system");
182 if (((c = cookie.get('status_overview_wan_vis')) != null) && (c != '1')) toggleVisibility("wan");
183 if (((c = cookie.get('status_overview_lan_vis')) != null) && (c != '1')) toggleVisibility("lan");
184 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
185 u = wl_fface(uidx);
186 if (((c = cookie.get('status_overview_wl_'+u+'_vis')) != null) && (c != '1')) toggleVisibility("wl_"+u);
189 ref.initPage(3000, 3);
192 function toggleVisibility(whichone) {
193 if (E('sesdiv_' + whichone).style.display == '') {
194 E('sesdiv_' + whichone).style.display = 'none';
195 E('sesdiv_' + whichone + '_showhide').innerHTML = '(Click here to show)';
196 cookie.set('status_overview_' + whichone + '_vis', 0);
197 } else {
198 E('sesdiv_' + whichone).style.display='';
199 E('sesdiv_' + whichone + '_showhide').innerHTML = '(Click here to hide)';
200 cookie.set('status_overview_' + whichone + '_vis', 1);
203 </script>
205 </head>
206 <body onload='init()'>
207 <form>
208 <table id='container' cellspacing=0>
209 <tr><td colspan=2 id='header'>
210 <div class='title'>Tomato</div>
211 <div class='version'>Version <% version(); %></div>
212 </td></tr>
213 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
214 <td id='content'>
215 <div id='ident'><% ident(); %></div>
217 <!-- / / / -->
219 <div class='section-title'>System <small><i><a href='javascript:toggleVisibility("system");'><span id='sesdiv_system_showhide'>(Click here to hide)</span></a></i></small></div>
220 <div class='section' id='sesdiv_system'>
221 <script type='text/javascript'>
222 createFieldTable('', [
223 { title: 'Name', text: nvram.router_name },
224 { title: 'Model', text: nvram.t_model_name },
225 { title: 'Chipset', text: stats.systemtype },
226 { title: 'CPU Freq', text: stats.cpumhz, hidden: (stats.cpumhz == ' MHz') },
227 { title: 'Flash RAM Size', text: stats.flashsize },
228 null,
229 { title: 'Time', rid: 'time', text: stats.time },
230 { title: 'Uptime', rid: 'uptime', text: stats.uptime },
231 { title: 'CPU Load <small>(1 / 5 / 15 mins)</small>', rid: 'cpu', text: stats.cpuload },
232 { title: 'CPU Usage', rid: 'cpupercent', text: stats.cpupercent },
233 { title: 'Total / Free Memory', rid: 'memory', text: stats.memory },
234 { title: 'Total / Free Swap', rid: 'swap', text: stats.swap, hidden: (stats.swap == '') }
236 </script>
237 </div>
239 <div class='section-title' id='wan-title'>WAN <small><i><a href='javascript:toggleVisibility("wan");'><span id='sesdiv_wan_showhide'>(Click here to hide)</span></a></i></small></div>
240 <div class='section' id='sesdiv_wan'>
241 <script type='text/javascript'>
242 createFieldTable('', [
243 { title: 'MAC Address', text: nvram.wan_hwaddr },
244 { title: 'Connection Type', text: { 'dhcp':'DHCP', 'static':'Static IP', 'pppoe':'PPPoE', 'pptp':'PPTP', 'l2tp':'L2TP' }[nvram.wan_proto] || '-' },
245 { title: 'IP Address', rid: 'wanip', text: stats.wanip },
246 { title: 'Subnet Mask', rid: 'wannetmask', text: stats.wannetmask },
247 { title: 'Gateway', rid: 'wangateway', text: stats.wangateway },
248 /* IPV6-BEGIN */
249 { title: 'IPv6 Address', rid: 'ip6_wan', text: stats.ip6_wan, hidden: (stats.ip6_wan == '') },
250 /* IPV6-END */
251 { title: 'DNS', rid: 'dns', text: stats.dns },
252 { title: 'MTU', text: nvram.wan_run_mtu },
253 null,
254 { title: 'Status', rid: 'wanstatus', text: stats.wanstatus },
255 { title: 'Connection Uptime', rid: 'wanuptime', text: stats.wanuptime },
256 { title: 'Remaining Lease Time', rid: 'wanlease', text: stats.wanlease, ignore: !show_dhcpc }
258 </script>
259 <span id='b_dhcpc' style='display:none'>
260 <input type='button' class='controls' onclick='dhcpc("renew")' value='Renew'>
261 <input type='button' class='controls' onclick='dhcpc("release")' value='Release'> &nbsp;
262 </span>
263 <input type='button' class='controls' onclick='wan_connect()' value='Connect' id='b_connect' style='display:none'>
264 <input type='button' class='controls' onclick='wan_disconnect()' value='Disconnect' id='b_disconnect' style='display:none'>
265 </div>
268 <div class='section-title'>LAN <small><i><a href='javascript:toggleVisibility("lan");'><span id='sesdiv_lan_showhide'>(Click here to hide)</span></a></i></small></div>
269 <div class='section' id='sesdiv_lan'>
270 <script type='text/javascript'>
272 /* VLAN-BEGIN */
273 var s='';
274 var t='';
275 for (var i = 0 ; i <= MAX_BRIDGE_ID ; i++) {
276 var j = (i == 0) ? '' : i.toString();
277 if (nvram['lan' + j + '_ifname'].length > 0) {
278 if (nvram['lan' + j + '_proto'] == 'dhcp') {
279 if ((!fixIP(nvram.dhcpd_startip)) || (!fixIP(nvram.dhcpd_endip))) {
280 var x = nvram['lan' + j + '_ipaddr'].split('.').splice(0, 3).join('.') + '.';
281 nvram['dhcpd' + j + '_startip'] = x + nvram['dhcp' + j + '_start'];
282 nvram['dhcpd' + j + '_endip'] = x + ((nvram['dhcp' + j + '_start'] * 1) + (nvram['dhcp' + j + '_num'] * 1) - 1);
284 s += ((s.length>0)&&(s.charAt(s.length-1) != ' ')) ? ', ' : '';
285 s += '<a href="status-devices.asp">' + nvram['dhcpd' + j + '_startip'] + ' - ' + nvram['dhcpd' + j + '_endip'] + '</a> on LAN' + j + ' (br' + i + ')';
286 } else {
287 s += ((s.length>0)&&(s.charAt(s.length-1) != ' ')) ? ', ' : '';
288 s += 'Disabled on LAN' + j + ' (br' + i + ')';
290 t += ((t.length>0)&&(t.charAt(t.length-1) != ' ')) ? ', ' : '';
291 t += nvram['lan' + j + '_ipaddr'] + '/' + numberOfBitsOnNetMask(nvram['lan' + j + '_netmask']) + ' on LAN' + j + ' (br' + i + ')';
295 createFieldTable('', [
296 { title: 'Router MAC Address', text: nvram.et0macaddr },
297 { title: 'Router IP Addresses', text: t },
298 { title: 'Gateway', text: nvram.lan_gateway, ignore: nvram.wan_proto != 'disabled' },
299 { title: 'DNS', rid: 'dns', text: stats.dns, ignore: nvram.wan_proto != 'disabled' },
300 { title: 'DHCP', text: s }
302 /* VLAN-END */
304 /* NOVLAN-BEGIN */
305 if (nvram.lan_proto == 'dhcp') {
306 if ((!fixIP(nvram.dhcpd_startip)) || (!fixIP(nvram.dhcpd_endip))) {
307 var x = nvram.lan_ipaddr.split('.').splice(0, 3).join('.') + '.';
308 nvram.dhcpd_startip = x + nvram.dhcp_start;
309 nvram.dhcpd_endip = x + ((nvram.dhcp_start * 1) + (nvram.dhcp_num * 1) - 1);
311 s = '<a href="status-devices.asp">' + nvram.dhcpd_startip + ' - ' + nvram.dhcpd_endip + '</a>';
313 else {
314 s = 'Disabled';
316 createFieldTable('', [
317 { title: 'Router MAC Address', text: nvram.et0macaddr },
318 { title: 'Router IP Address', text: nvram.lan_ipaddr },
319 { title: 'Subnet Mask', text: nvram.lan_netmask },
320 { title: 'Gateway', text: nvram.lan_gateway, ignore: nvram.wan_proto != 'disabled' },
321 /* IPV6-BEGIN */
322 { title: 'Router IPv6 Address', rid: 'ip6_lan', text: stats.ip6_lan, hidden: (stats.ip6_lan == '') },
323 { title: 'IPv6 Link-local Address', rid: 'ip6_lan_ll', text: stats.ip6_lan_ll, hidden: (stats.ip6_lan_ll == '') },
324 /* IPV6-END */
325 { title: 'DNS', rid: 'dns', text: stats.dns, ignore: nvram.wan_proto != 'disabled' },
326 { title: 'DHCP', text: s }
328 /* NOVLAN-END */
330 </script>
331 </div>
333 <script type='text/javascript'>
334 for (var uidx = 0; uidx < wl_ifaces.length; ++uidx) {
335 /* REMOVE-BEGIN
336 // u = wl_unit(uidx);
337 REMOVE-END */
338 u = wl_fface(uidx);
339 W('<div class=\'section-title\' id=\'wl'+u+'-title\'>Wireless');
340 if (wl_ifaces.length > 0)
341 W(' (' + wl_display_ifname(uidx) + ')');
342 W(' <small><i><a href=\'javascript:toggleVisibility("wl_' + u + '");\'><span id=\'sesdiv_wl_' +u + '_showhide\'>(Click here to hide)</span></a></i></small>');
343 W('</div>');
344 W('<div class=\'section\' id=\'sesdiv_wl_'+u+'\'>');
345 sec = auth[nvram['wl'+u+'_security_mode']] + '';
346 if (sec.indexOf('WPA') != -1) sec += ' + ' + enc[nvram['wl'+u+'_crypto']];
348 wmode = wmo[nvram['wl'+u+'_mode']] + '';
349 if ((nvram['wl'+u+'_mode'] == 'ap') && (nvram['wl'+u+'_wds_enable'] * 1)) wmode += ' + WDS';
351 createFieldTable('', [
352 { title: 'MAC Address', text: nvram['wl'+u+'_hwaddr'] },
353 { title: 'Wireless Mode', text: wmode },
354 { title: 'Wireless Network Mode', text: bgmo[nvram['wl'+u+'_net_mode']], ignore: (wl_sunit(uidx)>=0) },
355 { title: 'Interface Status', rid: 'ifstatus'+uidx, text: wlstats[uidx].ifstatus },
356 { title: 'Radio', rid: 'radio'+uidx, text: (wlstats[uidx].radio == 0) ? '<b>Disabled</b>' : 'Enabled', ignore: (wl_sunit(uidx)>=0) },
357 /* REMOVE-BEGIN */
358 // { title: 'SSID', text: (nvram['wl'+u+'_ssid'] + ' <small><i>' + ((nvram['wl'+u+'_mode'] != 'ap') ? '' : ((nvram['wl'+u+'_closed'] == 0) ? '(Broadcast Enabled)' : '(Broadcast Disabled)')) + '</i></small>') },
359 /* REMOVE-END */
360 { title: 'SSID', text: nvram['wl'+u+'_ssid'] },
361 { title: 'Broadcast', text: (nvram['wl'+u+'_closed'] == 0) ? 'Enabled' : '<b>Disabled</b>', ignore: (nvram['wl'+u+'_mode'] != 'ap') },
362 { title: 'Security', text: sec },
363 { title: 'Channel', rid: 'channel'+uidx, text: stats.channel[uidx], ignore: (wl_sunit(uidx)>=0) },
364 { title: 'Channel Width', rid: 'nbw'+uidx, text: wlstats[uidx].nbw, ignore: ((!nphy) || (wl_sunit(uidx)>=0)) },
365 { title: 'Interference Level', rid: 'interference'+uidx, text: stats.interference[uidx], hidden: ((stats.interference[uidx] == '') || (wl_sunit(uidx)>=0)) },
366 { title: 'Rate', rid: 'rate'+uidx, text: wlstats[uidx].rate, ignore: (wl_sunit(uidx)>=0) },
367 { title: 'RSSI', rid: 'rssi'+uidx, text: wlstats[uidx].rssi || '', ignore: ((!wlstats[uidx].client) || (wl_sunit(uidx)>=0)) },
368 { title: 'Noise', rid: 'noise'+uidx, text: wlstats[uidx].noise || '', ignore: ((!wlstats[uidx].client) || (wl_sunit(uidx)>=0)) },
369 { title: 'Signal Quality', rid: 'qual'+uidx, text: stats.qual[uidx] || '', ignore: ((!wlstats[uidx].client) || (wl_sunit(uidx)>=0)) }
372 W('<input type=\'button\' class=\'controls\' onclick=\'wlenable('+uidx+', 1)\' id=\'b_wl'+uidx+'_enable\' value=\'Enable\' style=\'display:none\'>');
373 W('<input type=\'button\' class=\'controls\' onclick=\'wlenable('+uidx+', 0)\' id=\'b_wl'+uidx+'_disable\' value=\'Disable\' style=\'display:none\'>');
374 W('</div>');
376 </script>
379 <!-- / / / -->
381 </td></tr>
382 <tr><td id='footer' colspan=2>
383 <script type='text/javascript'>genStdRefresh(1,1,'ref.toggle()');</script>
384 </td></tr>
385 </table>
386 </form>
387 <script type='text/javascript'>earlyInit()</script>
388 </body>
389 </html>