|
*Also the popup should only appear when the cursor is over the graph!*
I think the graph is still there.... and there is only the grey frame above the graph... because the time popup only appears on the right point , where the graph actualy should be.
Code: ---------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US"> <head> <title>Systems Monitor</title> <link rel="stylesheet" type="text/css" href="/rrdicons/routers2.css" /> <script type="text/javascript">//<![CDATA[ // these local versions are not optimised but avoid cross-site scripting // problems when running in distributed mode function setlocationa(url) { parent.setlocationa(url); // if( parent.menu.location != url) { // parent.menu.location = url; // } } function setlocationb(url) { parent.setlocationb(url); // if( parent.menub && parent.menub.location != url ) { // parent.menub.location = url; // } }
function LoadMenu() { setlocationb("http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&bars=Cami&xgtype=d&page=menub&xgstyle=l2&if=svdb1057.epcos.biz_65539&xmtype=options#top"); setlocationa("http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&bars=Cami&xgtype=d&page=menu&xgstyle=l2&xmtype=routers#top"); } // Function for RRDs version 1.3
// This javascript code derived in part from Overlib by Eric Bosrup var tzoffset = 0; var ooffsetx = 10; var ooffsety = -25; // above the cursor, to the right var owidth = 100; var pop=null; var gx, gy, gw; var img=null; var interval = 0; var endtime = 0; var ns4=(document.layers)? true:false; var ns6=(document.getElementById)? true:false; var ie4=(document.all)? true:false; var ie5=false; var ie6=false; var dow=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"); var actual=new Array(5); // to hold 6/d/w/m/y arrays of 400 items var xactual=new Array(5); // to hold 6/d/w/m/y flags xactual[0]=0; xactual[1]=0; xactual[2]=0; xactual[3]=0; xactual[4]=0; xactual[5]=0; if(ie4){ if((navigator.userAgent.indexOf('MSIE 5')> 0) ||(navigator.userAgent.indexOf('MSIE 6')> 0) ||(navigator.userAgent.indexOf('MSIE 7')> 0) ){ ie5=true; } if((navigator.userAgent.indexOf('MSIE 6')> 0) ||(navigator.userAgent.indexOf('MSIE 7')> 0) ){ ie6=true; } if(ns6){ ns6=false; } } // removed due to IE race condition problem // if((ns4)||(ie4)||(ns6)){ // if(ns4)pop=self.document.dpopup; // if(ie4)pop=self.dpopup.style; // if(ns6)pop=self.document.getElementById("dpopup"); // } // else { self.status = "Error - cannot determine browser"; }
function getextra(t) { var idx; var group; var rv = ""; if(interval<1)return rv; if(interval == 1800) { // weeks have only 333 not 400 dp in graph image idx = 400-Math.floor((endtime-t)/(1500*1)); // array index } else { idx = 400-Math.floor((endtime-t)/(interval*1)); // array index } group = 0; // 6 hourly if ( interval > 61 ) { group = 1; } // daily if ( interval > 301 ) { group = 2; } // weekly if ( interval > 1801 ) { group = 3; } // monthly if ( interval > 7201 ) { group = 4; } // yealy // now, see if we have stored any data for this interval if( xactual[group]>0 && (""+actual[group][idx])!="undefined" ) { rv = "<BR>"+actual[group][idx]; } return rv; } function clearpopup() { if(pop != null ) { if(ns4)pop.visibility="hide"; else if(ie4)pop.visibility="hidden"; else if(ns6)pop.style.visibility="hidden"; } else { self.status = "Error - no popup div defined."; } endtime = 0; } function settext(s) { if( pop != null ) { if(ns4){ pop.document.write(s); pop.document.close(); pop.visibility="show"; }else if(ie4){ self.document.all['dpopup'].innerHTML=s; pop.visibility="visible"; }else if(ns6){ range=self.document.createRange(); range.setStartBefore(pop); domfrag=range.createContextualFragment(s); while(pop.hasChildNodes()){ pop.removeChild(pop.lastChild); } pop.appendChild(domfrag); pop.style.visibility="visible"; } // else { self.status = "Error - cannot determine brower"; } } else { self.status = "Error - no popup div available"; } } function repositionTo(obj,xL,yL){ if((ns4)||(ie4)){ obj.left=xL; obj.top=yL; } else if(ns6){ obj.style.left=xL + "px"; obj.style.top=yL+ "px"; } } function fix(n) { var d = n; if(d<10) d="0"+d; return d; } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft; if( obj.scrollLeft ) curtop -= obj.scrollLeft; obj = obj.offsetParent; } } else { if (obj.x) curleft += obj.x; if( obj.scrollLeft ) curtop -= obj.scrollLeft; } return curleft; }
// Here we have a problem - IE gives offset relative to window, Netscape // gives relative to frame. So a scrolled window doesnt work in IE. function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; if( obj.scrollTop ) curtop -= obj.scrollTop; obj = obj.offsetParent; } } else { if (obj.y) curtop += obj.y; if( obj.scrollTop ) curtop -= obj.scrollTop; } return curtop; }
function mousemove(e) { var msg, ox, oy, t, extra; var placeX, placeY, winoffset, ohpos, ovpos, iwidth, iheight, scrollheight; var scrolloffset, oaboveheight, d;
if( ! endtime ) return; if((ns4)||(ns6)){ox=e.pageX;oy=e.pageY; } if(ie4){ox=e.x;oy=e.y; } if(ie5){ox=e.x+self.document.body.scrollLeft;oy=e.y+self.document.body.scrollTop; } winoffset=(ie4)? self.document.body.scrollLeft : self.pageXOffset; scrolloffset=(ie4)? self.document.body.scrollTop : self.pageYOffset; // scrolloffset=(ie4)? top.graph.document.body.scrollTop : self.pageYOffset; if(ie4){ iwidth=self.document.body.clientWidth; iheight=self.document.body.clientHeight; } else if(ns4){ iwidth=self.innerWidth; iheight=self.innerHeight; } else if(ns6){ iwidth=self.outerWidth; iheight=self.outerHeight; } placeX=ox+2; if((eval(placeX)+ eval(owidth))>(winoffset + iwidth)){ placeX=iwidth + winoffset - owidth +ooffsetx; if(placeX < 0)placeX=ooffsetx; } if((oy - scrolloffset)> iheight){ ovpos=35; }else{ ovpos=36; } if(ovpos==35){ if(oaboveheight==0){ var divref=(ie4)? self.document.all['dpopup'] : pop; oaboveheight=(ns4)? divref.clip.height : divref.offsetHeight; } placeY=oy -(oaboveheight + ooffsety); if(placeY < scrolloffset)placeY=scrolloffset; }else{ placeY=oy + ooffsety; } ox -= findPosX(img); oy -= findPosY(img); if(( ox >= 67 ) && ( ox <= (gx+67)) && ( oy >= 33 ) && ( oy <= (gy+33) )) { if( interval == 1800 ) { // special for weekly t = endtime - 1500 * (67+gx-ox)*gw/gx; // may only be approximate? } else { t = endtime - interval * (67+gx-ox)*gw/gx; // may only be approximate? } } else { t = 0; } if( t ) { // the problem is we want to display this in the timezone of the TARGET. // t is the UTC time, and the Javascript Date object will give everything // relative to the workstation timezone. So, we add the tz offset of // the Target, and subtract the tz offset of the workstation. // note that the passed tzoffset and that returned by getTimezoneOffset // seem to be different signs. d = new Date(t*1000); d.setTime((t+tzoffset+(d.getTimezoneOffset()*60))*1000); if( interval > 72000 ) { // dayofweek day/month (yearly graph) msg = dow[d.getDay()]+" "+d.getDate()+"/"+(d.getMonth()+1);
} else if( interval > 4000 ) { // dayofweek day hour:00 (monthly graph) msg = dow[d.getDay()]+" "+d.getDate()+" "+fix(d.getHours())+":00"; } else if( interval > 1000 ) { // dayofweek time (weekly graph) msg = dow[d.getDay()]+" "+fix(d.getHours())+":"+fix(d.getMinutes()); } else { // time (daily graph) msg = fix(d.getHours())+":"+fix(d.getMinutes()); } // for debugging the amazingly difficult timezone calculations // msg = msg + " " + d.getDay() + "<BR>" + endtime + ":" + t + "<BR>" + tzoffset + ":" + (d.getTimezoneOffset()*60); extra = getextra(t); settext("<STRONG>"+msg+"</STRONG>"+extra); repositionTo(pop, placeX, placeY); } else { if(ns4)pop.visibility="hide"; else if(ie4)pop.visibility="hidden"; else if(ns6)pop.style.visibility="hidden"; } }
function timepopup(o,n,px,py,i,t,dx,tzo) { divname = n; img = o; gx = px; gy = py; interval = i; endtime = t; gw = dx; tzoffset = tzo; if(ns4) { pop=self.document.dpopup; } else if(ie4) { if(self.dpopup) { pop=self.dpopup.style;} else { endtime=0;}} else if(ns6) { pop=self.document.getElementById("dpopup"); } else { endtime = 0; } } //]]></script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body link="#2020ff" alink="#2020ff" vlink="#2020ff" bgcolor="#ffffff" text="#000000" onload="LoadMenu()" class="interface" expires="+5s">
<div id="dpopup" style="position:absolute; visibility:hidden; z-index:1000;" class=popup></div> <DIV class=pagetop></DIV><img width="149540308" alt="Traffic Analysis for lan0 -- SVDB1057" src="/graphs/Epcos.Bizsvdb1057.epcos.biz.cfg-svdb1057.epcos.biz_65539-d-l2.png" name="igraphd" height="2459159" border="0" onmouseover="timepopup(this,'igraphd',530,200,300,1216103100,400,7200)" onmouseout="clearpopup()" onmousemove="mousemove(event)" /><br /><br /><TABLE border=0><TR><TD>Last update: </TD><TD>Tue Jul 15 08:25:15 2008</TD></TR> </TABLE>
<br /><DIV class=pagefoot></DIV><DIV class=extensions></DIV><DIV class=icons><hr /> <a href="javascript:location.reload(true)"><img width="100" alt="Refresh" src="/rrdicons/refresh.gif" height="20" border="0" /></a> <a target="_top" href="http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&xgtype=d&if=svdb1057.epcos.biz_65539"><img width="100" alt="Bookmark" src="/rrdicons/bookmark.gif" height="20" border="0" /></a> <a target="graph" href="http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&bars=Cami&page=graph&xgtype=w&xgstyle=l2&if=svdb1057.epcos.biz_65539&xmtype=options"><img width="100" alt="Zoom Out" src="/rrdicons/zoomout.gif" height="20" border="0" /></a> <a target="graph" href="http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&bars=Cami&xgtype=d&page=csv&xgstyle=l2&if=svdb1057.epcos.biz_65539&xmtype=options"><img width="100" alt="CSV Download" src="/rrdicons/csv.gif" height="20" border="0" /></a> <a target="graph" href="http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&bars=Cami&xgtype=d&page=archive&xgstyle=l2&if=svdb1057.epcos.biz_65539&xmtype=options"><img width="100" alt="Add to archive" src="/rrdicons/archive.gif" height="20" border="0" /></a> <a target="graph" href="http://172.18.248.17/cgi-bin/routers2.cgi?rtr=Epcos.Biz%2Fsvdb1057.epcos.biz.cfg&bars=Cami&xgtype=d&page=graph&xgstyle=l2&if=svdb1057.epcos.biz_65539&uopts=r&xmtype=options"><img width="100" alt="Rescale" src="/rrdicons/rescale.gif" height="20" border="0" /></a> <br /> </DIV><DIV class=footer><hr /> <TABLE width=100% border=0 cellpadding=0 class=footer><TR class=footer> <TD align=left valign=top class=footer id=ftleft><a target="_new" href="http://www.steveshipway.org/software/" class="footer"><img width="120" alt="Routers2.cgi web page" src="/rrdicons/routers2.gif" class="footer" height="40" border="0" /></a><br /><center><small><a target="_new" href="http://www.steveshipway.org/software/wishlist.html" style="@media print { display:none; }" class="footer">Say Thanks!</a></small></center></TD><TD valign=top align=left class=footer id=ftmiddle><small class="footer">routers.cgi Version v2.18 : © <a href="mailto:steve@steveshipway.org" class="footer">Steve Shipway</a> 2000-2006 : <a target="_top" href="http://www.steveshipway.org/software/" class="footer">http://www.steveshipway.org/software/</a></small>
<br /><SMALL class=footer><I class=footer>Current system load average: 0.85 0.58 0.45</I></SMALL> <br /><SMALL class=footer>Page took 0s to generate</SMALL></TD><TD align=right valign=top class=footer id=ftright><a target="_new" href="http://www.rrdtool.org/" class="footer"><img alt="RRDTool" src="/rrdicons/rrdtool.gif" class="footer" border="0" /></a><br /><center><small><a target="_new" href="http://people.ee.ethz.ch/~oetiker/wish/" style="@media print { display:none; }" class="footer">Say Thanks!</a></small></center></TD><TR></TABLE> <!-- R:[Epcos.Biz/svdb1057.epcos.biz.cfg] I:[svdb1057.epcos.biz_65539] A:[] U:[adminuser] --> <!-- Instance: 15064 fromcache(routers) fromcache(/etc/mrtg/Epcos.Biz/svdb1057.epcos.biz.cfg) Graph: svdb1057.epcos.biz_65539 RRD: /var/www/html/mymrtg/svdb1057.epcos.biz/svdb1057.epcos.biz_65539.rrd --> <!-- Refresh: 300 --> <!-- Expires: +5s --> <!-- Language: None --> <!-- Processing took 0s --> </DIV> </body> </html>
|