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: Last
24 Hours
</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>
36 <script type='text/javascript' src='bwm-common.js'
></script>
38 <script type='text/javascript'
>
40 // <% nvram("wan_ifname,lan_ifname,wl_ifname,wan_proto,web_svg,rstats_enable,rstats_colors"); %>
42 var cprefix
= 'bw_24';
44 var updateDiv
= updateInt
;
46 var updateReTotal
= 1;
53 if (hours
== lastHours
) return;
54 showSelectedOption('hr', lastHours
, hours
);
58 function switchHours(h
)
60 if ((!svgReady
) || (updating
)) return;
63 updateMaxL
= (720 / 24) * hours
;
66 cookie
.set(cprefix
+ 'hrs', hours
);
69 var ref
= new TomatoRefresh('update.cgi', 'exec=bandwidth&arg0=speed');
71 ref
.refresh = function(text
)
75 this.refreshTime
= 1500;
80 E('rbusy').style
.display
= 'none';
83 this.refreshTime
= (fixInt(speed_history
._next
, 1, 120, 60) + 2) * 1000;
88 if (debugTime
) E('dtime').innerHTML
= (new Date()) + ' ' + (this.refreshTime
/ 1000);
97 ref
.showState = function()
99 E('refresh-button').value
= this.running
? 'Stop' : 'Start';
102 ref
.toggleX = function()
106 cookie
.set(cprefix
+ 'refresh', this.running
? 1 : 0);
109 ref
.initX = function()
113 a
= fixInt(cookie
.get(cprefix
+ 'refresh'), 0, 1, 1);
115 ref
.refreshTime
= 100;
122 if (nvram
.rstats_enable
!= '1') return;
125 // <% bandwidth("speed"); %>
131 if (typeof(speed_history
) == 'undefined') {
134 E('rbusy').style
.display
= '';
137 hours
= fixInt(cookie
.get(cprefix
+ 'hrs'), 1, 24, 24);
138 updateMaxL
= (720 / 24) * hours
;
147 <body onload='init()'
>
149 <table id='container' cellspacing=
0>
150 <tr><td colspan=
2 id='header'
>
151 <div class='title'
>Tomato
</div>
152 <div class='version'
>Version <%
version(); %></div>
154 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
156 <div id='ident'
><%
ident(); %></div>
161 <div id='tab-area'
></div>
163 <script type='text/javascript'
>
164 if ((nvram
.web_svg
!= '0') && (nvram
.rstats_enable
== '1')) {
165 // without a div, Opera 9 moves svgdoc several pixels outside of <embed> (?)
166 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>");
170 <div id='bwm-controls'
>
171 <small>(
2 minute interval)
</small><br>
174 <a href='javascript:switchHours(
4);' id='hr4'
>4</a>,
175 <a href='javascript:switchHours(
6);' id='hr6'
>6</a>,
176 <a href='javascript:switchHours(
12);' id='hr12'
>12</a>,
177 <a href='javascript:switchHours(
18);' id='hr18'
>18</a>,
178 <a href='javascript:switchHours(
24);' id='hr24'
>24</a><br>
180 <a href='javascript:switchAvg(
1)' id='avg1'
>Off
</a>,
181 <a href='javascript:switchAvg(
2)' id='avg2'
>2x
</a>,
182 <a href='javascript:switchAvg(
4)' id='avg4'
>4x
</a>,
183 <a href='javascript:switchAvg(
6)' id='avg6'
>6x
</a>,
184 <a href='javascript:switchAvg(
8)' id='avg8'
>8x
</a><br>
186 <a href='javascript:switchScale(
0)' id='scale0'
>Uniform
</a>,
187 <a href='javascript:switchScale(
1)' id='scale1'
>Per IF
</a><br>
189 <a href='javascript:switchDraw(
0)' id='draw0'
>Solid
</a>,
190 <a href='javascript:switchDraw(
1)' id='draw1'
>Line
</a><br>
191 Color:
<a href='javascript:switchColor()' id='drawcolor'
>-
</a><br>
192 <small><a href='javascript:switchColor(
1)' id='drawrev'
>[reverse]
</a></small><br>
194 » <a href=
"admin-bwm.asp">Configure
</a>
198 <table border=
0 cellspacing=
2 id='txt'
>
200 <td width='
8%' align='right' valign='top'
><b style='border-bottom:blue
1px solid' id='rx-name'
>RX
</b></td>
201 <td width='
15%' align='right' valign='top'
><span id='rx-current'
></span></td>
202 <td width='
8%' align='right' valign='top'
><b>Avg
</b></td>
203 <td width='
15%' align='right' valign='top' id='rx-avg'
></td>
204 <td width='
8%' align='right' valign='top'
><b>Peak
</b></td>
205 <td width='
15%' align='right' valign='top' id='rx-max'
></td>
206 <td width='
8%' align='right' valign='top'
><b>Total
</b></td>
207 <td width='
14%' align='right' valign='top' id='rx-total'
></td>
211 <td width='
8%' align='right' valign='top'
><b style='border-bottom:blue
1px solid' id='tx-name'
>TX
</b></td>
212 <td width='
15%' align='right' valign='top'
><span id='tx-current'
></span></td>
213 <td width='
8%' align='right' valign='top'
><b>Avg
</b></td>
214 <td width='
15%' align='right' valign='top' id='tx-avg'
></td>
215 <td width='
8%' align='right' valign='top'
><b>Peak
</b></td>
216 <td width='
15%' align='right' valign='top' id='tx-max'
></td>
217 <td width='
8%' align='right' valign='top'
><b>Total
</b></td>
218 <td width='
14%' align='right' valign='top' id='tx-total'
></td>
225 <script type='text/javascript'
>
226 if (nvram
.rstats_enable
!= '1') {
227 W('<div class="note-disabled">Bandwidth monitoring disabled.</b><br><br><a href="admin-bwm.asp">Enable »</a><div>');
228 E('rstats').style
.display
= 'none';
231 W('<div class="note-warning" style="display:none" id="rbusy">The rstats program is not responding or is busy. Try reloading after a few seconds.</div>');
238 <tr><td id='footer' colspan=
2>
239 <span id='dtime'
></span>
240 <img src='spin.gif' id='refresh-spinner' onclick='debugTime=
1'
>
241 <input type='button' value='Refresh' id='refresh-button' onclick='ref.toggleX()'
>