]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - html/html/themes/ipfire-new/include/js/refreshInetInfo.js
ed4a966b402d74903958b8280258a3e07a396270
2 * functions for retrieving status information via jQuery
3 * Modified: March 6th, 2013 by michael@koehler.tk
4 * Authors: IPFire Team (info@ipfire.org)
5 Kay-Michael Köhler (michael@koehler.tk)
6 * Visit http://www.ipfire.org/
16 $(document
).ready(function(){
20 function refreshInetInfo() {
22 url
: '/cgi-bin/speed.cgi',
23 success: function(xml
){
25 t_current
= new Date();
26 var t_diff
= t_current
- t_last
;
28 rxb_current
= $("rxb",xml
).text();
29 var rxb_diff
= rxb_current
- rxb_last
;
30 rxb_last
= rxb_current
;
32 var rx_kbs
= rxb_diff
/t_diff
;
33 rx_kbs
= Math
.round(rx_kbs
*10)/10;
35 txb_current
= $("txb",xml
).text();
36 var txb_diff
= txb_current
- txb_last
;
37 txb_last
= txb_current
;
39 var tx_kbs
= txb_diff
/t_diff
;
40 tx_kbs
= Math
.round(tx_kbs
*10)/10;
43 $("#rx_kbs").text(rx_kbs
+ ' kb/s');
44 $("#tx_kbs").text(tx_kbs
+ ' kb/s');
45 if ($("#bandwidthCalculationContainer").css('display') == 'none')
46 $("#bandwidthCalculationContainer").css('display','block');
53 window
.setTimeout("refreshInetInfo()", 2000);