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: Monthly
</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 <script type='text/javascript' src='debug.js'
></script>
22 <script type='text/javascript' src='bwm-hist.js'
></script>
24 <script type='text/javascript'
>
26 // <% nvram("wan_ifname,lan_ifname,rstats_enable"); %>
28 // <% bandwidth("monthly"); %>
34 if (typeof(monthly_history
) == 'undefined') {
43 w
= window
.open('', 'tomato_data_m');
44 w
.document
.writeln('<pre>');
45 for (i
= 0; i
< monthly_history
.length
; ++i
) {
46 h
= monthly_history
[i
];
47 w
.document
.writeln([(((h
[0] >> 16) & 0xFF) + 1900), (((h
[0] >>> 8) & 0xFF) + 1), h
[1], h
[2]].join(','));
49 w
.document
.writeln('</pre>');
55 cookie
.set('monthly', scale
, 31);
69 grid
= '<table class="bwmg" cellspacing="1">';
70 grid
+= makeRow('header', 'Date', 'Download', 'Upload', 'Total');
72 for (i
= 0; i
< monthly_history
.length
; ++i
) {
73 h
= monthly_history
[i
];
74 yr
= (((h
[0] >> 16) & 0xFF) + 1900);
75 mo
= ((h
[0] >>> 8) & 0xFF);
77 grid
+= makeRow(((rows
& 1) ? 'odd' : 'even'), ymText(yr
, mo
), rescale(h
[1]), rescale(h
[2]), rescale(h
[1] + h
[2]));
81 E('bwm-monthly-grid').innerHTML
= grid
+ '</table>';
88 if (nvram
.rstats_enable
!= '1') return;
90 if ((s
= cookie
.get('monthly')) != null) {
91 if (s
.match(/^([0-2])$/)) {
92 E('scale').value
= scale
= RegExp
.$1 * 1;
97 monthly_history
.sort(cmpHist
);
103 <body onload='init()'
>
105 <table id='container' cellspacing=
0>
106 <tr><td colspan=
2 id='header'
>
107 <div class='title'
>Tomato
</div>
108 <div class='version'
>Version <%
version(); %></div>
110 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
112 <div id='ident'
><%
ident(); %></div>
116 <div class='section-title'
>WAN Bandwidth - Monthly
</div>
117 <div id='bwm-monthly-grid' style='float:left'
></div>
118 <div style=
"float:right;text-align:right">
119 <b>Date
</b> <select onchange='changeDate(this,
"ym")' id='dafm'
><option value=
0>yyyy-mm
</option><option value=
1>mm-yyyy
</option><option value=
2>mmm yyyy
</option><option value=
3>mm.yyyy
</option></select><br>
120 <b>Scale
</b> <select onchange='changeScale(this)' id='scale'
><option value=
0>KB
</option><option value=
1>MB
</option><option value=
2 selected
>GB
</option></select><br>
122 » <a href=
"javascript:genData()">Data
</a>
124 » <a href=
"admin-bwm.asp">Configure
</a>
129 <script type='text/javascript'
>checkRstats();</script>
134 <tr><td id='footer' colspan=
2>
135 <input type='button' value='Refresh' onclick='reloadPage()'
>