diff --git a/www/menu.php3 b/www/menu.php3 index 32e1b12d7682ca3e4cc2b0815d29ba7f2edd0691..cae3f92a7fd983543799776857e8add0eaadfef3 100644 --- a/www/menu.php3 +++ b/www/menu.php3 @@ -8,6 +8,7 @@ $login_status = CHECKLOGIN_NOTLOGGEDIN; $login_uid = 0; $drewheader = 0; +$autorefresh = 0; # # This has to be set so we can spit out http or https paths properly! @@ -64,7 +65,7 @@ function WRITESIDEBARDIVIDER() { global $BASEPATH; echo "<tr>"; echo "<td class=\"menuoptdiv\">"; - # We have to put something in this cell, or IE ignores it. But, we don't + # We have to put something in this cell, or IE ignores it. But, we do not # want to make the table row full line-height, so a space will not do. echo "<img src=\"$BASEPATH/1px.gif\" border=0 height=1 width=1 />"; echo "</td>"; @@ -568,6 +569,7 @@ function PAGEBEGINNING( $title, $nobanner = 0 ) { global $TBDIR, $WWW; global $MAINPAGE; global $TBDOCBASE; + global $autorefresh; $MAINPAGE = !strcmp($TBDIR, "/usr/testbed/"); @@ -580,8 +582,8 @@ function PAGEBEGINNING( $title, $nobanner = 0 ) { <link rel=\"SHORTCUT ICON\" HREF=\"netbed.png\" TYPE=\"image/png\"> <!-- dumbed-down style sheet for any browser that groks (eg NS47). --> <link REL='stylesheet' HREF='$BASEPATH/common-style.css' TYPE='text/css' /> - <!-- don't import full style sheet into NS47, since it does a bad job - of handling it. NS47 doesn't understand '@import'. --> + <!-- do not import full style sheet into NS47, since it does bad job + of handling it. NS47 does not understand '@import'. --> <style type='text/css' media='all'> <!-- @import '$BASEPATH/style.css'; -->"; @@ -599,10 +601,13 @@ function PAGEBEGINNING( $title, $nobanner = 0 ) { echo "<meta NAME=\"description\" ". "CONTENT=\"emulab - network emulation testbed home\">\n"; } - echo "</head> <body bgcolor='#FFFFFF' topmargin='0' leftmargin='0' marginheight='0' marginwidth='0'>\n"; + + if ($autorefresh) { + echo "<meta HTTP-EQUIV=\"Refresh\" CONTENT=\"$autorefresh\">\n"; + } if (! $nobanner ) { echo "<map name=overlaymap> <area shape=rect coords=\"100,60,369,100\" @@ -649,10 +654,13 @@ function FINISHSIDEBAR() # function PAGEHEADER($title, $view = NULL) { global $login_status, $login_uid, $TBBASE, $TBDOCBASE, $THISHOMEBASE; - global $BASEPATH, $SSL_PROTOCOL, $drewheader; + global $BASEPATH, $SSL_PROTOCOL, $drewheader, $autorefresh; global $TBMAINSITE; $drewheader = 1; + if (isset($_GET['refreshrate']) && is_numeric($_GET['refreshrate'])) { + $autorefresh = $_GET['refreshrate']; + } # # Determine the proper basepath, which depends on whether the page diff --git a/www/showstats.php3 b/www/showstats.php3 index 8ba9b31863ba32df973b0ef7709264b0a68d1cb4..f4876704f4d229bf8352f7c06687a610d54313f1 100644 --- a/www/showstats.php3 +++ b/www/showstats.php3 @@ -1,7 +1,7 @@ <?php # # EMULAB-COPYRIGHT -# Copyright (c) 2000-2003 University of Utah and the Flux Group. +# Copyright (c) 2000-2004 University of Utah and the Flux Group. # All rights reserved. # include("defs.php3"); @@ -68,7 +68,21 @@ else { else echo "Project</a>."; } -echo "</b><br><br>\n"; +echo "</b><br>\n"; + +# Refresh option +if ($isadmin) { + echo "<b>Refresh every: "; + echo "<a class='static' ". + "href='showstats.php3?showby=$showby&refreshrate=30'>30</a>, "; + echo "<a class='static' ". + "href='showstats.php3?showby=$showby&refreshrate=60'>60</a>, "; + echo "<a class='static' ". + "href='showstats.php3?showby=$showby&refreshrate=120'>120</a> "; + echo "seconds.\n"; + echo "</b><br>\n"; +} +echo "<br>\n"; # Determine what to do. if ($showby == "user") {