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(); %>] Bandwidth: Real-Time Client Monitor
</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'
>
17 <script type='text/javascript' src='tomato.js'
></script>
21 <style type='text/css'
>
41 <script type='text/javascript' src='debug.js'
></script>
43 <script type='text/javascript' src='wireless.jsx?_http_id=<%
nv(http_id
); %>'
></script>
44 <script type='text/javascript' src='bwm-common.js'
></script>
46 <script type='text/javascript'
>
47 // <% nvram("wan_ifname,lan_ifname,wl_ifname,wan_proto,wan_iface,web_svg,rstats_colors,bwm_client,dhcpd_static"); %>
51 var cprefix
= 'bwcm_r';
53 var updateDiv
= updateInt
;
55 var updateReTotal
= 1;
62 var ref
= new TomatoRefresh('update.cgi', 'exec=climon', updateInt
);
64 ref
.stop = function() {
65 this.timer
.start(1000);
68 ref
.refresh = function(text
) {
69 var c
, i
, h
, n
, j
, k
, l
;
78 n
= (new Date()).getTime();
79 if (this.timeExpect
) {
80 if (debugTime
) E('dtime').innerHTML
= (this.timeExpect
- n
) + ' ' + ((this.timeExpect
+ 1000*updateInt
) - n
);
81 this.timeExpect
+= 1000*updateInt
;
82 this.refreshTime
= MAX(this.timeExpect
- n
, 500);
85 this.timeExpect
= n
+ 1000*updateInt
;
90 if ((p
= prev
[i
]) != null) {
94 h
.rx
.push((c
.rx
< p
.rx
) ? (c
.rx
+ (0xFFFFFFFF - p
.rx
)) : (c
.rx
- p
.rx
));
97 h
.tx
.push((c
.tx
< p
.tx
) ? (c
.tx
+ (0xFFFFFFFF - p
.tx
)) : (c
.tx
- p
.tx
));
99 else if (!speed_history
[i
]) {
100 speed_history
[i
] = {};
101 h
= speed_history
[i
];
104 for (j
= 300; j
> 0; --j
) {
119 function watchdog() {
122 wdogWarn
.style
.display
= '';
125 function watchdogReset() {
126 if (wdog
) clearTimeout(wdog
)
127 wdog
= setTimeout(watchdog
, 5000*updateInt
);
128 wdogWarn
.style
.display
= 'none';
132 if (nvram
.bwm_client
.length
> 0) {
133 E('sesdiv').style
.display
= '';
141 wdogWarn
= E('warnwd');
150 <body onload='init()'
>
152 <table id='container' cellspacing=
0>
153 <tr><td colspan=
2 id='header'
>
154 <div class='title'
>Tomato
</div>
155 <div class='version'
>Version <%
version(); %></div>
157 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
159 <div id='ident'
><%
ident(); %></div>
162 <script type='text/javascript'
>
163 if (nvram
.bwm_client
.length
< 1) {
164 W('<i>You need to <a href="basic-static.asp">configure</a> which LAN clients/devices should be monitored before coming back to this page.</i>');
167 <div id='sesdiv' style='display:none'
>
170 <div id='tab-area'
></div>
172 <script type='text/javascript'
>
173 if (nvram
.web_svg
!= '0') {
174 // without a div, Opera 9 moves svgdoc several pixels outside of <embed> (?)
175 W("<div style='border-top:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0;visibility:hidden;padding:0;margin:0' id='graph'><embed src='bwm-graph.svg?<% version(); %>' style='width:760px;height:300px;margin:0;padding:0' type='image/svg+xml' pluginspage='http://www.adobe.com/svg/viewer/install/'></embed></div>");
179 <div id='bwm-controls'
>
180 <small>(
<script type='text/javascript'
>W(5*updateInt
);</script> minute window,
<script type='text/javascript'
>W(updateInt);
</script> second interval)
</small><br>
183 <a href='javascript:switchAvg(
1)' id='avg1'
>Off
</a>,
184 <a href='javascript:switchAvg(
2)' id='avg2'
>2x
</a>,
185 <a href='javascript:switchAvg(
4)' id='avg4'
>4x
</a>,
186 <a href='javascript:switchAvg(
6)' id='avg6'
>6x
</a>,
187 <a href='javascript:switchAvg(
8)' id='avg8'
>8x
</a><br>
189 <a href='javascript:switchScale(
0)' id='scale0'
>Uniform
</a>,
190 <a href='javascript:switchScale(
1)' id='scale1'
>Per Client
</a><br>
192 <a href='javascript:switchDraw(
0)' id='draw0'
>Solid
</a>,
193 <a href='javascript:switchDraw(
1)' id='draw1'
>Line
</a><br>
194 Color:
<a href='javascript:switchColor()' id='drawcolor'
>-
</a><br>
195 <small><a href='javascript:switchColor(
1)' id='drawrev'
>[reverse]
</a></small><br>
198 » <a href=
"basic-static.asp">Configure
</a>
202 <table border=
0 cellspacing=
2 id='txt'
>
204 <td width='
8%' align='right' valign='top'
><b style='border-bottom:blue
1px solid' id='rx-name'
>RX
</b></td>
205 <td width='
15%' align='right' valign='top'
><span id='rx-current'
></span></td>
206 <td width='
8%' align='right' valign='top'
><b>Avg
</b></td>
207 <td width='
15%' align='right' valign='top' id='rx-avg'
></td>
208 <td width='
8%' align='right' valign='top'
><b>Peak
</b></td>
209 <td width='
15%' align='right' valign='top' id='rx-max'
></td>
210 <td width='
8%' align='right' valign='top'
><b>Total
</b></td>
211 <td width='
14%' align='right' valign='top' id='rx-total'
></td>
215 <td width='
8%' align='right' valign='top'
><b style='border-bottom:blue
1px solid' id='tx-name'
>TX
</b></td>
216 <td width='
15%' align='right' valign='top'
><span id='tx-current'
></span></td>
217 <td width='
8%' align='right' valign='top'
><b>Avg
</b></td>
218 <td width='
15%' align='right' valign='top' id='tx-avg'
></td>
219 <td width='
8%' align='right' valign='top'
><b>Peak
</b></td>
220 <td width='
15%' align='right' valign='top' id='tx-max'
></td>
221 <td width='
8%' align='right' valign='top'
><b>Total
</b></td>
222 <td width='
14%' align='right' valign='top' id='tx-total'
></td>
233 <tr><td id='footer' colspan=
2>
234 <span id='warnwd' style='display:none'
>Warning:
10 second timeout, restarting...
</span>
235 <span id='dtime'
></span>
236 <img src='spin.gif' id='refresh-spinner' onclick='javascript:debugTime=
1'
>