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("web_svg,qos_enable"); %>
52 var abc
= ['Unclassified', 'Highest', 'High', 'Medium', 'Low', 'Lowest', 'Class A', 'Class B', 'Class C', 'Class D', 'Class E'];
69 location
.href
= 'qos-detailed.asp?class=' + n
;
78 for (i
= 0; i
< 11; ++i
) {
79 if (!nfmarks
[i
]) nfmarks
[i
] = 0;
81 if (!qrates
[i
]) qrates
[i
] = 0;
85 for (i
= 0; i
< 11; ++i
) {
87 E('ccnt' + i
).innerHTML
= n
;
88 if (ct
> 0) p
= (n
/ ct
) * 100;
90 E('cpct' + i
).innerHTML
= p
.toFixed(2) + '%';
92 E('ccnt-total').innerHTML
= ct
;
94 for (i
= 1; i
< 11; ++i
) {
96 E('bcnt' + i
).innerHTML
= (n
/ 1000).toFixed(2)
97 E('bcntx' + i
).innerHTML
= (n
/ 8192).toFixed(2)
98 if (rt
> 0) p
= (n
/ rt
) * 100;
100 E('bpct' + i
).innerHTML
= p
.toFixed(2) + '%';
102 E('bcnt-total').innerHTML
= (rt
/ 1000).toFixed(2)
103 E('bcntx-total').innerHTML
= (rt
/ 8192).toFixed(2)
107 var ref
= new TomatoRefresh('update.cgi', 'exec=qrate', 2, 'qos_graphs');
109 ref
.refresh = function(text
)
133 for (i
= 1; i
>= 0; --i
) {
135 d
= e
.getSVGDocument();
136 if (d
.defaultView
) w
= d
.defaultView
;
137 else w
= e
.getWindow();
139 if (i
== 0) updateCD
= w
.updateSVG
;
140 else updateBD
= w
.updateSVG
;
151 else if (--svgReady
> -5) {
152 setTimeout(checkSVG
, 500);
158 nbase
= fixInt(cookie
.get('qnbase'), 0, 1, 0);
161 ref
.initPage(2000, 3);
165 <body onload='init()'
>
166 <form id='_fom' action='javascript:{}'
>
167 <table id='container' cellspacing=
0>
168 <tr><td colspan=
2 id='header'
>
169 <div class='title'
>Tomato
</div>
170 <div class='version'
>Version <%
version(); %></div>
172 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
174 <div id='ident'
><%
ident(); %></div>
178 <div class=
"section-title">Connections Distribution
</div>
179 <div class=
"section">
180 <table border=
0 width=
"100%"><tr><td>
181 <table style=
"width:250px">
182 <script type='text/javascript'
>
183 for (i
= 0; i
< 11; ++i
) {
184 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
185 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
186 '<td class="title" style="width:60px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
187 '<td id="ccnt' + i
+ '" class="count" style="width:90px"></td>' +
188 '<td id="cpct' + i
+ '" class="pct"></td></tr>');
191 <tr><td> </td><td class=
"total">Total
</a></td><td id=
"ccnt-total" class=
"total count"></td><td class=
"total pct">100%
</td></tr>
193 </td><td style=
"margin-right:150px">
194 <script type='text/javascript'
>
195 if (nvram
.web_svg
!= '0') {
196 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>');
203 <div class=
"section-title">Bandwidth Distribution (Outbound)
</div>
204 <div class=
"section">
205 <table border=
0 width=
"100%"><tr><td>
206 <table style=
"width:250px">
207 <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>
208 <script type='text/javascript'
>
209 for (i
= 1; i
< 11; ++i
) {
210 W('<tr style="cursor:pointer" onclick="mClick(' + i
+ ')">' +
211 '<td class="color" style="background:#' + colors
[i
] + '" onclick="mClick(' + i
+ ')"> </td>' +
212 '<td class="title" style="width:45px"><a href="qos-detailed.asp?class=' + i
+ '">' + abc
[i
] + '</a></td>' +
213 '<td id="bcnt' + i
+ '" class="count" style="width:60px"></td>' +
214 '<td id="bcntx' + i
+ '" class="count" style="width:50px"></td>' +
215 '<td id="bpct' + i
+ '" class="pct"></td></tr>');
218 <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>
220 </td><td style=
"margin-right:150px">
221 <script type='text/javascript'
>
222 if (nvram
.web_svg
!= '0') {
223 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>');
230 <script type='text/javascript'
>
231 if (nvram
.qos_enable
!= '1') {
232 W('<div class="note-disabled"><b>QoS disabled.</b> <a href="qos-settings.asp">Enable »</a></div>');
239 <tr><td id='footer' colspan=
2>
240 <script type='text/javascript'
>genStdRefresh(1,0,'ref.toggle()');</script>