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(); %>] QoS: View Graphs
</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>
20 <script type='text/javascript' src='debug.js'
></script>
22 <style type='text/css'
>
41 border-top: 1px dashed
#bbb;
46 <script type='text/javascript'
>
47 // <% nvram("qos_classnames,web_svg,qos_enable"); %>
54 var Unclassified
= ['Unclassified'];
55 var classNames
= nvram
.qos_classnames
.split(' '); //Toastman Class Labels
56 var abc
= Unclassified
.concat(classNames
);
59 // var abc = ['Unclassified', 'Highest', 'High', 'Medium', 'Low', 'Lowest', 'Class A', 'Class B', 'Class C', 'Class D', 'Class E'];
77 location
.href
= 'qos-detailed.asp?class=' + n
;
86 for (i
= 0; i
< 11; ++i
) {
87 if (!nfmarks
[i
]) nfmarks
[i
] = 0;
89 if (!qrates
[i
]) qrates
[i
] = 0;
93 for (i
= 0; i
< 11; ++i
) {
95 E('ccnt' + i
).innerHTML
= n
;
96 if (ct
> 0) p
= (n
/ ct
) * 100;
98 E('cpct' + i
).innerHTML
= p
.toFixed(2) + '%';
100 E('ccnt-total').innerHTML
= ct
;
102 for (i
= 1; i
< 11; ++i
) {
104 E('bcnt' + i
).innerHTML
= (n
/ 1000).toFixed(2)
105 E('bcntx' + i
).innerHTML
= (n
/ 8192).toFixed(2)
106 if (rt
> 0) p
= (n
/ rt
) * 100;
108 E('bpct' + i
).innerHTML
= p
.toFixed(2) + '%';
110 E('bcnt-total').innerHTML
= (rt
/ 1000).toFixed(2)
111 E('bcntx-total').innerHTML
= (rt
/ 8192).toFixed(2)
115 var ref
= new TomatoRefresh('update.cgi', 'exec=qrate', 2, 'qos_graphs');
117 ref
.refresh = function(text
)
141 for (i
= 1; i
>= 0; --i
) {
143 d
= e
.getSVGDocument();
144 if (d
.defaultView
) w
= d
.defaultView
;
145 else w
= e
.getWindow();
147 if (i
== 0) updateCD
= w
.updateSVG
;
148 else updateBD
= w
.updateSVG
;
159 else if (--svgReady
> -5) {
160 setTimeout(checkSVG
, 500);
166 nbase
= fixInt(cookie
.get('qnbase'), 0, 1, 0);
169 ref
.initPage(2000, 3);
173 <body onload='init()'
>
174 <form id='_fom' action='javascript:{}'
>
175 <table id='container' cellspacing=
0>
176 <tr><td colspan=
2 id='header'
>
177 <div class='title'
>Tomato
</div>
178 <div class='version'
>Version <%
version(); %></div>
180 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
182 <div id='ident'
><%
ident(); %></div>
186 <div class=
"section-title">Connections Distribution
</div>
187 <div class=
"section">
188 <table border=
0 width=
"100%"><tr><td>
189 <table style=
"width:250px">
190 <script type='text/javascript'
>
191 for (i
= 0; i
< 11; ++i
) {
192 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
193 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
194 '<td class="title" style="width:60px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
195 '<td id="ccnt' + i
+ '" class="count" style="width:90px"></td>' +
196 '<td id="cpct' + i
+ '" class="pct"></td></tr>');
199 <tr><td> </td><td class=
"total">Total
</a></td><td id=
"ccnt-total" class=
"total count"></td><td class=
"total pct">100%
</td></tr>
201 </td><td style=
"margin-right:150px">
202 <script type='text/javascript'
>
203 if (nvram
.web_svg
!= '0') {
204 W('<embed src="qos-graph.svg?n=0&v=<% version(); %>" style="width:310px;height:310px;margin:0;padding:0" id="svg0" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/"></embed>');
211 <div class=
"section-title">Bandwidth Distribution (Outbound)
</div>
212 <div class=
"section">
213 <table border=
0 width=
"100%"><tr><td>
214 <table style=
"width:250px">
215 <tr><td class='color'
style=
"height:1em"></td><td class='title'
style=
"width:45px"> </td><td class='thead count'
>kbit/s
</td><td class='thead count'
>KB/s
</td><td class='pct'
> </td></tr>
216 <script type='text/javascript'
>
217 for (i
= 1; i
< 11; ++i
) {
218 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
219 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
220 '<td class="title" style="width:45px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
221 '<td id="bcnt' + i
+ '" class="count" style="width:60px"></td>' +
222 '<td id="bcntx' + i
+ '" class="count" style="width:50px"></td>' +
223 '<td id="bpct' + i
+ '" class="pct"></td></tr>');
226 <tr><td> </td><td class=
"total">Total
</a></td><td id=
"bcnt-total" class=
"total count"></td><td id=
"bcntx-total" class=
"total count"></td><td class=
"total pct">100%
</td></tr>
228 </td><td style=
"margin-right:150px">
229 <script type='text/javascript'
>
230 if (nvram
.web_svg
!= '0') {
231 W('<embed src="qos-graph.svg?n=1&v=<% version(); %>" style="width:310px;height:310px;margin:0;padding:0" id="svg1" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/"></embed>');
238 <script type='text/javascript'
>
239 if (nvram
.qos_enable
!= '1') {
240 W('<div class="note-disabled"><b>QoS disabled.</b> <a href="qos-settings.asp">Enable »</a></div>');
247 <tr><td id='footer' colspan=
2>
248 <script type='text/javascript'
>genStdRefresh(1,0,'ref.toggle()');</script>