3 Copyright (C) 2006-2010 Jonathan Zarate
4 http://www.polarcloud.com/tomato/
6 For use with Tomato Firmware only.
7 No part of this file may be used without permission.
10 //<% nvram("l2tp_get_ip,pptp_get_ip,pptp_server_ip,router_name,wan_domain,wan_gateway,wan_get_domain,wan_hostname,wan_hwaddr,wan_ipaddr,wan_netmask,wan_proto,wan_run_mtu,et0macaddr,lan_proto,lan_ipaddr,dhcp_start,dhcp_num,dhcpd_startip,dhcpd_endip,lan_netmask,security_mode2,wl_crypto,wl_mode,wds_enable,wl0_hwaddr,wl_net_mode,wl_radio,wl_channel,lan_gateway,wl_ssid,t_model_name"); %>
20 if (typeof(last_wan_proto) == 'undefined') {
21 last_wan_proto = nvram.wan_proto;
23 else if (last_wan_proto != nvram.wan_proto) {
27 stats.cpuload = ((sysinfo.loads[0] / 65536.0).toFixed(2) + '<small> / </small> ' +
28 (sysinfo.loads[1] / 65536.0).toFixed(2) + '<small> / </small>' +
29 (sysinfo.loads[2] / 65536.0).toFixed(2));
30 stats.uptime = sysinfo.uptime_s;
32 a = sysinfo.totalram + sysinfo.totalswap;
33 b = sysinfo.totalfreeram + sysinfo.freeswap;
34 stats.memory = scaleSize(a) + ' / ' + scaleSize(b) + ' <small>(' + (b / a * 100.0).toFixed(2) + '%)</small>';
36 stats.time = '<% time(); %>';
37 stats.wanup = '<% wanup(); %>' == '1';
38 stats.wanuptime = '<% link_uptime(); %>';
39 stats.wanlease = '<% dhcpc_time(); %>';
42 stats.dns = dns.join(', ');
44 stats.wanip = nvram.wan_ipaddr;
45 stats.wannetmask = nvram.wan_netmask;
46 stats.wangateway = nvram.wan_gateway;
48 switch (nvram.wan_proto) {
51 stats.wanip = nvram.pptp_get_ip;
52 stats.wannetmask = '255.255.255.255';
55 stats.wangateway = nvram.pptp_server_ip;
60 stats.wanip = nvram.l2tp_get_ip;
61 stats.wannetmask = '255.255.255.255';
66 stats.wanip = '0.0.0.0';
67 stats.wannetmask = '0.0.0.0';
68 stats.wangateway = '0.0.0.0';
72 stats.wanstatus = '<% wanstatus(); %>';
73 if (stats.wanstatus != 'Connected') stats.wanstatus = '<b>' + stats.wanstatus + '</b>';
75 a = i = '<% wlchannel(); %>' * 1;
77 if ((i >= 1) && (i <= 14)) {
78 stats.channel = '<a href="tools-survey.asp">' + i + ' - ' + ghz[i - 1] + ' <small>GHz</small></a>'
79 if (a < 0) stats.channel += ' <small>(scanning...)</small>';
82 stats.channel = 'Auto';
88 wlcrssi = wlnoise = stats.qual = '';
89 isClient = ((nvram.wl_mode == 'wet') || (nvram.wl_mode == 'sta'));
94 if (wlcrssi == 0) a = 0;
95 else a = MAX(wlcrssi - wlnoise, 0);
96 stats.qual = a + ' <img src="bar' + MIN(MAX(Math.floor(a / 10), 1), 6) + '.gif">';
98 wlnoise += ' <small>dBm</small>';
99 wlcrssi += ' <small>dBm</small>';