1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
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.
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'
>
21 <script type='text/javascript' src='tomato.js'
></script>
22 <script type='text/javascript' src='interfaces.js'
></script>
26 <style type='text/css'
>
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'};
44 lastjiffiesusage
= 100;
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'));
55 for (var uidx
= 0; uidx
< wl_ifaces
.length
; ++uidx
) {
57 // show_radio.push((nvram['wl'+wl_unit(uidx)+'_radio'] == '1'));
60 show_radio
.push((nvram
['wl'+wl_fface(uidx
)+'_radio'] == '1'));
63 nphy
= features('11n');
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()
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
)
107 E(id
).cells
[1].innerHTML
= htm
;
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('wanprebuf',stats
.wanprebuf
); //Victek
118 c('wannetmask', stats
.wannetmask
);
119 c('wangateway', stats
.wangateway
);
121 c('memory', stats
.memory
);
122 c('swap', stats
.swap
);
123 elem
.display('swap', stats
.swap
!= '');
126 c('ip6_wan', stats
.ip6_wan
);
127 elem
.display('ip6_wan', stats
.ip6_wan
!= '');
128 c('ip6_lan', stats
.ip6_lan
);
129 elem
.display('ip6_lan', stats
.ip6_lan
!= '');
130 c('ip6_lan_ll', stats
.ip6_lan_ll
);
131 elem
.display('ip6_lan_ll', stats
.ip6_lan_ll
!= '');
134 c('wanstatus', stats
.wanstatus
);
135 c('wanuptime', stats
.wanuptime
);
136 if (show_dhcpc
) c('wanlease', stats
.wanlease
);
138 E('b_connect').disabled
= stats
.wanup
;
139 E('b_disconnect').disabled
= !stats
.wanup
;
142 for (var uidx
= 0; uidx
< wl_ifaces
.length
; ++uidx
) {
143 if (wl_sunit(uidx
)<0) {
144 c('radio'+uidx
, wlstats
[uidx
].radio
? 'Enabled' : '<b>Disabled</b>');
145 c('rate'+uidx
, wlstats
[uidx
].rate
);
146 if (show_radio
[uidx
]) {
147 E('b_wl'+uidx
+'_enable').disabled
= wlstats
[uidx
].radio
;
148 E('b_wl'+uidx
+'_disable').disabled
= !wlstats
[uidx
].radio
;
150 c('channel'+uidx
, stats
.channel
[uidx
]);
152 c('nbw'+uidx
, wlstats
[uidx
].nbw
);
154 c('interference'+uidx
, stats
.interference
[uidx
]);
155 elem
.display('interference'+uidx
, stats
.interference
[uidx
] != '');
157 if (wlstats
[uidx
].client
) {
158 c('rssi'+uidx
, wlstats
[uidx
].rssi
|| '');
159 c('noise'+uidx
, wlstats
[uidx
].noise
|| '');
160 c('qual'+uidx
, stats
.qual
[uidx
] || '');
163 c('ifstatus'+uidx
, wlstats
[uidx
].ifstatus
|| '');
169 elem
.display('b_dhcpc', show_dhcpc
);
170 elem
.display('b_connect', 'b_disconnect', show_codi
);
171 elem
.display('wan-title', 'wan-section', nvram
.wan_proto
!= 'disabled');
172 for (var uidx
= 0; uidx
< wl_ifaces
.length
; ++uidx
) {
173 if (wl_sunit(uidx
)<0)
174 elem
.display('b_wl'+uidx
+'_enable', 'b_wl'+uidx
+'_disable', show_radio
[uidx
]);
181 ref
.initPage(3000, 3);
186 <body onload='init()'
>
188 <table id='container' cellspacing=
0>
189 <tr><td colspan=
2 id='header'
>
190 <div class='title'
>Tomato
</div>
191 <div class='version'
>Version <%
version(); %></div>
193 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
195 <div id='ident'
><%
ident(); %></div>
199 <div class='section-title'
>System
</div>
200 <div class='section'
>
201 <script type='text/javascript'
>
202 createFieldTable('', [
203 { title
: 'Name', text
: nvram
.router_name
},
204 { title
: 'Model', text
: nvram
.t_model_name
},
205 { title
: 'Chipset', text
: stats
.systemtype
},
206 { title
: 'CPU Freq', text
: stats
.cpumhz
},
207 { title
: 'Flash RAM Size', text
: stats
.flashsize
},
209 { title
: 'Time', rid
: 'time', text
: stats
.time
},
210 { title
: 'Uptime', rid
: 'uptime', text
: stats
.uptime
},
211 { title
: 'CPU Load <small>(1 / 5 / 15 mins)</small>', rid
: 'cpu', text
: stats
.cpuload
},
212 { title
: 'CPU Usage', rid
: 'cpupercent', text
: stats
.cpupercent
},
213 { title
: 'Total / Free Memory', rid
: 'memory', text
: stats
.memory
},
214 { title
: 'Total / Free Swap', rid
: 'swap', text
: stats
.swap
, hidden
: (stats
.swap
== '') },
219 <div class='section-title' id='wan-title'
>WAN
</div>
220 <div class='section' id='wan-section'
>
221 <script type='text/javascript'
>
222 createFieldTable('', [
223 { title
: 'MAC Address', text
: nvram
.wan_hwaddr
},
224 { title
: 'Connection Type', text
: { 'dhcp':'DHCP', 'static':'Static IP', 'pppoe':'PPPoE', 'pptp':'PPTP', 'l2tp':'L2TP' }[nvram
.wan_proto
] || '-' },
225 { title
: 'IP Address', rid
: 'wanip', text
: stats
.wanip
},
226 { title
: 'Previous WAN IP', rid
: 'wanprebuf',text
:stats
.wanprebuf
}, //Victek
227 { title
: 'Subnet Mask', rid
: 'wannetmask', text
: stats
.wannetmask
},
228 { title
: 'Gateway', rid
: 'wangateway', text
: stats
.wangateway
},
230 { title
: 'IPv6 Address', rid
: 'ip6_wan', text
: stats
.ip6_wan
, hidden
: (stats
.ip6_wan
== '') },
232 { title
: 'DNS', rid
: 'dns', text
: stats
.dns
},
233 { title
: 'MTU', text
: nvram
.wan_run_mtu
},
235 { title
: 'Status', rid
: 'wanstatus', text
: stats
.wanstatus
},
236 { title
: 'Connection Uptime', rid
: 'wanuptime', text
: stats
.wanuptime
},
237 { title
: 'Remaining Lease Time', rid
: 'wanlease', text
: stats
.wanlease
, ignore
: !show_dhcpc
}
240 <span id='b_dhcpc' style='display:none'
>
241 <input type='button' class='controls' onclick='dhcpc(
"renew")' value='Renew'
>
242 <input type='button' class='controls' onclick='dhcpc(
"release")' value='Release'
>
244 <input type='button' class='controls' onclick='wan_connect()' value='Connect' id='b_connect' style='display:none'
>
245 <input type='button' class='controls' onclick='wan_disconnect()' value='Disconnect' id='b_disconnect' style='display:none'
>
249 <div class='section-title'
>LAN
</div>
250 <div class='section'
>
251 <script type='text/javascript'
>
256 for (var i
= 0 ; i
<= MAX_BRIDGE_ID
; i
++) {
257 var j
= (i
== 0) ? '' : i
.toString();
258 if (nvram
['lan' + j
+ '_ifname'].length
> 0) {
259 if (nvram
['lan' + j
+ '_proto'] == 'dhcp') {
260 if ((!fixIP(nvram
.dhcpd_startip
)) || (!fixIP(nvram
.dhcpd_endip
))) {
261 var x
= nvram
['lan' + j
+ '_ipaddr'].split('.').splice(0, 3).join('.') + '.';
262 nvram
['dhcpd' + j
+ '_startip'] = x
+ nvram
['dhcp' + j
+ '_start'];
263 nvram
['dhcpd' + j
+ '_endip'] = x
+ ((nvram
['dhcp' + j
+ '_start'] * 1) + (nvram
['dhcp' + j
+ '_num'] * 1) - 1);
265 s
+= ((s
.length
>0)&&(s
.charAt(s
.length
-1) != ' ')) ? ', ' : '';
266 s
+= '<a href="status-devices.asp">' + nvram
['dhcpd' + j
+ '_startip'] + ' - ' + nvram
['dhcpd' + j
+ '_endip'] + '</a> on LAN' + j
+ ' (br' + i
+ ')';
268 s
+= ((s
.length
>0)&&(s
.charAt(s
.length
-1) != ' ')) ? ', ' : '';
269 s
+= 'Disabled on LAN' + j
+ ' (br' + i
+ ')';
271 t
+= ((t
.length
>0)&&(t
.charAt(t
.length
-1) != ' ')) ? ', ' : '';
272 t
+= nvram
['lan' + j
+ '_ipaddr'] + '/' + numberOfBitsOnNetMask(nvram
['lan' + j
+ '_netmask']) + ' on LAN' + j
+ ' (br' + i
+ ')';
276 createFieldTable('', [
277 { title
: 'Router MAC Address', text
: nvram
.et0macaddr
},
278 { title
: 'Router IP Addresses', text
: t
},
279 { title
: 'Gateway', text
: nvram
.lan_gateway
, ignore
: nvram
.wan_proto
!= 'disabled' },
281 { title
: 'Router IPv6 Address', rid
: 'ip6_lan', text
: stats
.ip6_lan
, hidden
: (stats
.ip6_lan
== '') },
282 { title
: 'IPv6 Link-local Address', rid
: 'ip6_lan_ll', text
: stats
.ip6_lan_ll
, hidden
: (stats
.ip6_lan_ll
== '') },
284 { title
: 'DNS', rid
: 'dns', text
: stats
.dns
, ignore
: nvram
.wan_proto
!= 'disabled' },
285 { title
: 'DHCP', text
: s
}
290 if (nvram
.lan_proto
== 'dhcp') {
291 if ((!fixIP(nvram
.dhcpd_startip
)) || (!fixIP(nvram
.dhcpd_endip
))) {
292 var x
= nvram
.lan_ipaddr
.split('.').splice(0, 3).join('.') + '.';
293 nvram
.dhcpd_startip
= x
+ nvram
.dhcp_start
;
294 nvram
.dhcpd_endip
= x
+ ((nvram
.dhcp_start
* 1) + (nvram
.dhcp_num
* 1) - 1);
296 s
= '<a href="status-devices.asp">' + nvram
.dhcpd_startip
+ ' - ' + nvram
.dhcpd_endip
+ '</a>';
301 createFieldTable('', [
302 { title
: 'Router MAC Address', text
: nvram
.et0macaddr
},
303 { title
: 'Router IP Address', text
: nvram
.lan_ipaddr
},
304 { title
: 'Subnet Mask', text
: nvram
.lan_netmask
},
305 { title
: 'Gateway', text
: nvram
.lan_gateway
, ignore
: nvram
.wan_proto
!= 'disabled' },
307 { title
: 'Router IPv6 Address', rid
: 'ip6_lan', text
: stats
.ip6_lan
, hidden
: (stats
.ip6_lan
== '') },
308 { title
: 'IPv6 Link-local Address', rid
: 'ip6_lan_ll', text
: stats
.ip6_lan_ll
, hidden
: (stats
.ip6_lan_ll
== '') },
310 { title
: 'DNS', rid
: 'dns', text
: stats
.dns
, ignore
: nvram
.wan_proto
!= 'disabled' },
311 { title
: 'DHCP', text
: s
}
318 <script type='text/javascript'
>
319 for (var uidx
= 0; uidx
< wl_ifaces
.length
; ++uidx
) {
321 W('<div class=\'section-title\' id=\'wl'+uidx
+'-title\'>Wireless');
322 if (wl_ifaces
.length
> 1)
323 W(' (' + wl_display_ifname(uidx
) + ')');
325 W('<div class=\'section\' id=\'wl'+uidx
+'-section\'>');
326 sec
= auth
[nvram
['wl'+u
+'_security_mode']] + '';
327 if (sec
.indexOf('WPA') != -1) sec
+= ' + ' + enc
[nvram
['wl'+u
+'_crypto']];
329 wmode
= wmo
[nvram
['wl'+u
+'_mode']] + '';
330 if ((nvram
['wl'+u
+'_mode'] == 'ap') && (nvram
['wl'+u
+'_wds_enable'] * 1)) wmode
+= ' + WDS';
332 createFieldTable('', [
333 { title
: 'MAC Address', text
: nvram
['wl'+u
+'_hwaddr'] },
334 { title
: 'Wireless Mode', text
: wmode
},
335 { title
: 'Wireless Network Mode', text
: bgmo
[nvram
['wl'+u
+'_net_mode']] },
336 { title
: 'Interface Status', rid
: 'ifstatus'+uidx
, text
: wlstats
[uidx
].ifstatus
},
337 { title
: 'Radio', rid
: 'radio'+uidx
, text
: (wlstats
[uidx
].radio
== 0) ? '<b>Disabled</b>' : 'Enabled' },
339 // { 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>') },
341 { title
: 'SSID', text
: nvram
['wl'+u
+'_ssid'] },
342 { title
: 'Broadcast', text
: (nvram
['wl'+u
+'_closed'] == 0) ? 'Enabled' : '<b>Disabled</b>', ignore
: (nvram
['wl'+u
+'_mode'] != 'ap') },
343 { title
: 'Security', text
: sec
},
344 { title
: 'Channel', rid
: 'channel'+uidx
, text
: stats
.channel
[uidx
], ignore
: (wl_sunit(uidx
)>=0) },
345 { title
: 'Channel Width', rid
: 'nbw'+uidx
, text
: wlstats
[uidx
].nbw
, ignore
: ((!nphy
) || (wl_sunit(uidx
)>=0)) },
346 { title
: 'Interference Level', rid
: 'interference'+uidx
, text
: stats
.interference
[uidx
], hidden
: ((stats
.interference
[uidx
] == '') || (wl_sunit(uidx
)>=0)) },
347 { title
: 'Rate', rid
: 'rate'+uidx
, text
: wlstats
[uidx
].rate
, ignore
: (wl_sunit(uidx
)>=0) },
348 { title
: 'RSSI', rid
: 'rssi'+uidx
, text
: wlstats
[uidx
].rssi
|| '', ignore
: ((!wlstats
[uidx
].client
) || (wl_sunit(uidx
)>=0)) },
349 { title
: 'Noise', rid
: 'noise'+uidx
, text
: wlstats
[uidx
].noise
|| '', ignore
: ((!wlstats
[uidx
].client
) || (wl_sunit(uidx
)>=0)) },
350 { title
: 'Signal Quality', rid
: 'qual'+uidx
, text
: stats
.qual
[uidx
] || '', ignore
: ((!wlstats
[uidx
].client
) || (wl_sunit(uidx
)>=0)) }
353 W('<input type=\'button\' class=\'controls\' onclick=\'wlenable('+uidx
+', 1)\' id=\'b_wl'+uidx
+'_enable\' value=\'Enable\' style=\'display:none\'>');
354 W('<input type=\'button\' class=\'controls\' onclick=\'wlenable('+uidx
+', 0)\' id=\'b_wl'+uidx
+'_disable\' value=\'Disable\' style=\'display:none\'>');
363 <tr><td id='footer' colspan=
2>
364 <script type='text/javascript'
>genStdRefresh(1,1,'ref.toggle()');</script>
368 <script type='text/javascript'
>earlyInit()</script>