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"); %>
53 var Unclassified
= ['Unclassified'];
54 var classNames
= nvram
.qos_classnames
.split(' '); // Toastman - configurable class names
55 var abc
= Unclassified
.concat(classNames
);
73 location
.href
= 'qos-detailed.asp?class=' + n
;
79 var totalConnections
, totalOutgoingBandwidth
, totalIncomingBandwidth
;
81 totalConnections
= totalOutgoingBandwidth
= totalIncomingBandwidth
= 0;
83 for (i
= 0; i
< 11; ++i
)
85 if (!nfmarks
[i
]) nfmarks
[i
] = 0;
86 totalConnections
+= nfmarks
[i
];
87 if (!qrates_out
[i
]) qrates_out
[i
] = 0;
88 totalOutgoingBandwidth
+= qrates_out
[i
];
89 if (!qrates_in
[i
]) qrates_in
[i
] = 0;
90 totalIncomingBandwidth
+= qrates_in
[i
];
93 for (i
= 0; i
< 11; ++i
) {
95 E('ccnt' + i
).innerHTML
= n
;
96 if (totalConnections
> 0) p
= (n
/ totalConnections
) * 100;
98 E('cpct' + i
).innerHTML
= p
.toFixed(2) + '%';
100 E('ccnt-total').innerHTML
= totalConnections
;
102 for (i
= 1; i
< 11; ++i
) {
104 E('bocnt' + i
).innerHTML
= (n
/ 1000).toFixed(2)
105 E('bocntx' + i
).innerHTML
= (n
/ 8192).toFixed(2)
106 if (totalOutgoingBandwidth
> 0) p
= (n
/ totalOutgoingBandwidth
) * 100;
108 E('bopct' + i
).innerHTML
= p
.toFixed(2) + '%';
110 E('bocnt-total').innerHTML
= (totalOutgoingBandwidth
/ 1000).toFixed(2)
111 E('bocntx-total').innerHTML
= (totalOutgoingBandwidth
/ 8192).toFixed(2)
113 for (i
= 1; i
< 11; ++i
) {
115 E('bicnt' + i
).innerHTML
= (n
/ 1000).toFixed(2)
116 E('bicntx' + i
).innerHTML
= (n
/ 8192).toFixed(2)
117 if (totalIncomingBandwidth
> 0) p
= (n
/ totalIncomingBandwidth
) * 100;
119 E('bipct' + i
).innerHTML
= p
.toFixed(2) + '%';
121 E('bicnt-total').innerHTML
= (totalIncomingBandwidth
/ 1000).toFixed(2)
122 E('bicntx-total').innerHTML
= (totalIncomingBandwidth
/ 8192).toFixed(2)
126 var ref
= new TomatoRefresh('update.cgi', 'exec=qrate', 2, 'qos_graphs');
128 ref
.refresh = function(text
)
148 updateConnectionDistribution(nfmarks
, abc
);
149 updateBandwidthOutgoing(qrates_out
, abc
);
150 updateBandwidthIncoming(qrates_in
, abc
);
160 for (i
= 2; i
>= 0; --i
)
163 d
= e
.getSVGDocument();
180 updateConnectionDistribution
= w
.updateSVG
;
186 updateBandwidthOutgoing
= w
.updateSVG
;
192 updateBandwidthIncoming
= w
.updateSVG
;
205 updateConnectionDistribution(nfmarks
, abc
);
206 updateBandwidthOutgoing(qrates_out
, abc
);
207 updateBandwidthIncoming(qrates_in
, abc
);
209 else if (--svgReady
> -5)
211 setTimeout(checkSVG
, 500);
217 nbase
= fixInt(cookie
.get('qnbase'), 0, 1, 0);
220 ref
.initPage(2000, 3);
224 <body onload='init()'
>
225 <form id='_fom' action='javascript:{}'
>
226 <table id='container' cellspacing=
0>
227 <tr><td colspan=
2 id='header'
>
228 <div class='title'
>Tomato
</div>
229 <div class='version'
>Version <%
version(); %></div>
231 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
233 <div id='ident'
><%
ident(); %></div>
237 <div class=
"section-title">Connections Distribution
</div>
238 <div class=
"section">
239 <table border=
0 width=
"100%"><tr><td>
240 <table style=
"width:250px">
241 <script type='text/javascript'
>
242 for (i
= 0; i
< 11; ++i
) {
243 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
244 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
245 '<td class="title" style="width:60px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
246 '<td id="ccnt' + i
+ '" class="count" style="width:90px"></td>' +
247 '<td id="cpct' + i
+ '" class="pct"></td></tr>');
250 <tr><td> </td><td class=
"total">Total
</a></td><td id=
"ccnt-total" class=
"total count"></td><td class=
"total pct">100%
</td></tr>
252 </td><td style=
"margin-right:150px">
253 <script type='text/javascript'
>
254 if (nvram
.web_svg
!= '0') {
255 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>');
262 <div class=
"section-title">Bandwidth Distribution (Outbound)
</div>
263 <div class=
"section">
264 <table border=
0 width=
"100%"><tr><td>
265 <table style=
"width:250px">
266 <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>
267 <script type='text/javascript'
>
268 for (i
= 1; i
< 11; ++i
) {
269 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
270 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
271 '<td class="title" style="width:45px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
272 '<td id="bocnt' + i
+ '" class="count" style="width:60px"></td>' +
273 '<td id="bocntx' + i
+ '" class="count" style="width:50px"></td>' +
274 '<td id="bopct' + i
+ '" class="pct"></td></tr>');
277 <tr><td> </td><td class=
"total">Total
</a></td><td id=
"bocnt-total" class=
"total count"></td><td id=
"bocntx-total" class=
"total count"></td><td class=
"total pct">100%
</td></tr>
279 </td><td style=
"margin-right:150px">
280 <script type='text/javascript'
>
281 if (nvram
.web_svg
!= '0') {
282 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>');
289 <div class=
"section-title">Bandwidth Distribution (Inbound)
</div>
290 <div class=
"section">
291 <table border=
0 width=
"100%"><tr><td>
292 <table style=
"width:250px">
293 <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>
294 <script type='text/javascript'
>
295 for (i
= 1; i
< 11; ++i
) {
296 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
297 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
298 '<td class="title" style="width:45px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
299 '<td id="bicnt' + i
+ '" class="count" style="width:60px"></td>' +
300 '<td id="bicntx' + i
+ '" class="count" style="width:50px"></td>' +
301 '<td id="bipct' + i
+ '" class="pct"></td></tr>');
304 <tr><td> </td><td class=
"total">Total
</a></td><td id=
"bicnt-total" class=
"total count"></td><td id=
"bicntx-total" class=
"total count"></td><td class=
"total pct">100%
</td></tr>
306 </td><td style=
"margin-right:150px">
307 <script type='text/javascript'
>
308 if (nvram
.web_svg
!= '0') {
309 W('<embed src="qos-graph.svg?n=2&v=<% version(); %>" style="width:310px;height:310px;margin:0;padding:0" id="svg2" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/"></embed>');
317 <script type='text/javascript'
>
318 if (nvram
.qos_enable
!= '1') {
319 W('<div class="note-disabled"><b>QoS disabled.</b> <a href="qos-settings.asp">Enable »</a></div>');
326 <tr><td id='footer' colspan=
2>
327 <script type='text/javascript'
>genStdRefresh(1,2,'ref.toggle()');</script>