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
</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'
>
35 <script type='text/javascript' src='debug.js'
></script>
37 <script type='text/javascript' src='wireless.jsx?_http_id=<%
nv(http_id
); %>'
></script>
38 <script type='text/javascript' src='bwm-common.js'
></script>
41 <script type=
"text/javascript">
42 function stopRKey(evt
) {
43 var evt
= (evt
) ? evt
: ((event
) ? event
: null);
44 var node
= (evt
.target
) ? evt
.target
: ((evt
.srcElement
) ? evt
.srcElement
: null);
45 if ((evt
.keyCode
== 13) && (node
.type
=="text")) {return false;}
47 document
.onkeypress
= stopRKey
;
51 <script type='text/javascript'
>
52 // <% nvram("cmon_enable,cmon_ipaddr,wan_ifname,lan_ifname,wl_ifname,wan_proto,wan_iface,web_svg,rstats_colors"); %>
56 var updateDiv
= updateInt
;
58 var updateReTotal
= 1;
66 var ref
= new TomatoRefresh('update.cgi', 'exec=netdev', 2);
68 ref
.stop = function() {
69 this.timer
.start(1000);
72 ref
.refresh = function(text
) {
82 n
= (new Date()).getTime();
83 if (this.timeExpect
) {
84 if (debugTime
) E('dtime').innerHTML
= (this.timeExpect
- n
) + ' ' + ((this.timeExpect
+ 2000) - n
);
85 this.timeExpect
+= 2000;
86 this.refreshTime
= MAX(this.timeExpect
- n
, 500);
89 this.timeExpect
= n
+ 2000;
94 if ((p
= prev
[i
]) != null) {
98 h
.rx
.push((c
.rx
< p
.rx
) ? (c
.rx
+ (0xFFFFFFFF - p
.rx
)) : (c
.rx
- p
.rx
));
101 h
.tx
.push((c
.tx
< p
.tx
) ? (c
.tx
+ (0xFFFFFFFF - p
.tx
)) : (c
.tx
- p
.tx
));
103 else if (!speed_history
[i
]) {
104 speed_history
[i
] = {};
105 h
= speed_history
[i
];
108 for (j
= 300; j
> 0; --j
) {
127 wdogWarn
.style
.display
= '';
130 function watchdogReset()
132 if (wdog
) clearTimeout(wdog
)
133 wdog
= setTimeout(watchdog
, 10000);
134 wdogWarn
.style
.display
= 'none';
143 wdogWarn
= E('warnwd');
150 function toggleFiltersVisibility(){
151 if(E('clientmonitor').style
.display
=='')
152 E('clientmonitor').style
.display
='none';
154 E('clientmonitor').style
.display
='';
158 function verifyFields(focused
, quiet
)
162 var a
= !E('_f_cmon_enable').checked
;
163 E('_cmon_ipaddr').enabled
= a
;
164 elem
.display(PR('_cmon_ipaddr'), !a
);
173 fom
.cmon_enable
.value
= E('_f_cmon_enable').checked
? 1 : 0;
182 <body onload='init()'
>
183 <form id='_fom' method='post' action='tomato.cgi'
>
184 <table id='container' cellspacing=
0>
185 <tr><td colspan=
2 id='header'
>
186 <div class='title'
>Tomato
</div>
187 <div class='version'
>Version <%
version(); %></div>
189 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
191 <div id='ident'
><%
ident(); %></div>
196 <div id='tab-area'
></div>
198 <script type='text/javascript'
>
199 if (nvram
.web_svg
!= '0') {
200 // without a div, Opera 9 moves svgdoc several pixels outside of <embed> (?)
201 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>");
205 <div id='bwm-controls'
>
206 <small>(
10 minute window,
2 second interval)
</small><br>
209 <a href='javascript:switchAvg(
1)' id='avg1'
>Off
</a>,
210 <a href='javascript:switchAvg(
2)' id='avg2'
>2x
</a>,
211 <a href='javascript:switchAvg(
4)' id='avg4'
>4x
</a>,
212 <a href='javascript:switchAvg(
6)' id='avg6'
>6x
</a>,
213 <a href='javascript:switchAvg(
8)' id='avg8'
>8x
</a><br>
215 <a href='javascript:switchScale(
0)' id='scale0'
>Uniform
</a>,
216 <a href='javascript:switchScale(
1)' id='scale1'
>Per IF
</a><br>
218 <a href='javascript:switchDraw(
0)' id='draw0'
>Solid
</a>,
219 <a href='javascript:switchDraw(
1)' id='draw1'
>Line
</a><br>
220 Color:
<a href='javascript:switchColor()' id='drawcolor'
>-
</a><br>
221 <small><a href='javascript:switchColor(
1)' id='drawrev'
>[reverse]
</a></small><br>
224 » <a href=
"admin-bwm.asp">Configure
</a>
230 <table border=
0 cellspacing=
2 id='txt'
>
232 <td width='
8%' align='right' valign='top'
><b style='border-bottom:blue
1px solid' id='rx-name'
>RX
</b></td>
233 <td width='
15%' align='right' valign='top'
><span id='rx-current'
></span></td>
234 <td width='
8%' align='right' valign='top'
><b>Avg
</b></td>
235 <td width='
15%' align='right' valign='top' id='rx-avg'
></td>
236 <td width='
8%' align='right' valign='top'
><b>Peak
</b></td>
237 <td width='
15%' align='right' valign='top' id='rx-max'
></td>
238 <td width='
8%' align='right' valign='top'
><b>Total
</b></td>
239 <td width='
14%' align='right' valign='top' id='rx-total'
></td>
243 <td width='
8%' align='right' valign='top'
><b style='border-bottom:blue
1px solid' id='tx-name'
>TX
</b></td>
244 <td width='
15%' align='right' valign='top'
><span id='tx-current'
></span></td>
245 <td width='
8%' align='right' valign='top'
><b>Avg
</b></td>
246 <td width='
15%' align='right' valign='top' id='tx-avg'
></td>
247 <td width='
8%' align='right' valign='top'
><b>Peak
</b></td>
248 <td width='
15%' align='right' valign='top' id='tx-max'
></td>
249 <td width='
8%' align='right' valign='top'
><b>Total
</b></td>
250 <td width='
14%' align='right' valign='top' id='tx-total'
></td>
259 <input type='hidden' name='cmon_enable'
>
260 <input type='hidden' name='cmon_ipaddr'
>
261 <input type='hidden' name='_nextpage' value='bwm-realtime.asp'
>
262 <input type='hidden' name='_service' value='bwm-restart'
>
263 <input type='hidden' name='_service' value='cmon-restart'
>
269 <div class='section-title'
>Client Monitor
<small><i><a href='javascript:toggleFiltersVisibility();'
>(Toggle Visibility)
</a></i></small></div>
270 <div class='section' id='clientmonitor' style='display:none'
>
271 <script type='text/javascript'
>
273 createFieldTable('', [
274 { title
: 'Enable Monitor', name
: 'f_cmon_enable', type
: 'checkbox', value
: nvram
.cmon_enable
!= '0'},
275 { title
: 'Monitoring IP Address', name
: 'cmon_ipaddr', type
: 'text', maxlen
: 15, size
: 17, value
: nvram
.cmon_ipaddr
}
285 <li><b>Note:
</b> The monitored client is isolated from the BW/Limiter graphs and details.
294 <tr><td id='footer' colspan=
2>
295 <span id='warnwd' style='display:none'
>Warning:
10 second session timeout, restarting...
</span>
296 <span id='footer-msg'
></span>
297 <input type='button' value='Save' id='save-button' onclick='save()'
>
298 <input type='button' value='Refresh' onclick='reloadPage()'
>
299 <span id='dtime'
></span>
300 <img src='spin.gif' id='refresh-spinner' onclick='javascript:debugTime=
1'
>
304 <script type='text/javascript'
>verifyFields(null, 1);</script>