1. Bandwidth graphFor most normal users that connect to any page, there is no interest in knowing what bandwidth a server uses: they want quick loading of pages and fast downloads, nothing more. But as it can be
very usefull or even essential to nerds and techies
, here the way it can be done:
To display the bandwith graph without forcing page refreshs with <meta> and <iframe>, you can use a small javascript function and two lines of code in your html template.
A) Place this code int the header section of your template:
<script type="text/javascript">
// script by bacter
var c=0,t;
function reloadimg()
{c++;document.getElementById('bwused').src="/~img_graph200x42?c="+'\"'+c+'\"';t=setTimeout("reloadimg()",5000);}
</script>
This will reload a graph with dimension 200x42 pixels every 5 seconds. Change size and timing to fit your needs. The value urlvar c is used to avoid that the browser reloads from caché.
B)Insert in your template in the place you want that graph this two lines:
<img id="bwused" src ="/~img_graph200x42" />
<script type="text/javascript">reloadimg();</script>
2. Possible request:Also if to me displaying the used bandwidth on a website seems meaningless, it goes really useless if the 'webmaster' accesses his server on localhost or somebody does access from lan: beside a local speed (10..100 MBytes/s) , wan traffic (with home DSL speed below 100 kBytes/s) will not more be seen! To be more usefull, hfs would need an exclude-list for ip(-range) , so that traffic with those ips would not be considered in the graph, nor in %speed-in% and %speed-out%.
3. Feature WhoisWith macros you could already get some localization info, but most sites that provide this information only allow a limited number of free requests from one ip, so that it makes no sense to publish some code to do this. Whois as feature of hfs? May be, but at the same time as a dvdburning tool, in irc server and a spreadsheet