Commit a07561a1 authored by Leigh Stoller's avatar Leigh Stoller

What started out as 10 minute hack, took a couple of hours of

frustration until I realized that style.css does not actually come
from your devel tree, but somehow comes from the main tree.
But, along the way I did some reading about style sheets, and now I
know just enough to be dangerous.

Anyway, whats this revision about? No comment. You figure it out.
parent 97e588df
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2005 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
# Get some stats about current experiments
$query_result =
DBQueryFatal("select count(*) from experiments as e " .
"left join experiment_stats as s on s.exptidx=e.idx " .
"left join experiment_resources as rs on rs.idx=s.rsrcidx ".
"where state='active' and rs.pnodes>0 and " .
" e.pid!='emulab-ops' and ".
" not (e.pid='ron' and e.eid='all')");
if (mysql_num_rows($query_result) != 1) {
$active_expts = "ERR";
} else {
$row = mysql_fetch_array($query_result);
$active_expts = $row[0];
}
$query_result = DBQueryFatal("select count(*) from experiments where ".
"state='swapped' and pid!='emulab-ops' and pid!='testbed'");
if (mysql_num_rows($query_result) != 1) {
$swapped_expts = "ERR";
} else {
$row = mysql_fetch_array($query_result);
$swapped_expts = $row[0];
}
$query_result = DBQueryFatal("select count(*) from experiments where ".
"swap_requests > 0 and idle_ignore=0 ".
"and pid!='emulab-ops' and pid!='testbed'");
if (mysql_num_rows($query_result) != 1) {
$idle_expts = "ERR";
} else {
$row = mysql_fetch_array($query_result);
$idle_expts = $row[0];
}
$freepcs = TBFreePCs();
# Force the page to reload periodically.
$autorefresh = 90;
PAGEBEGINNING("Current Usage", 1, 1);
?>
<table valign=top align=center width=100% height=100% border=1>
<tr><td nowrap colspan=2 class="contentheader" bgcolor="#E1EAEA" align="center">
<font size=-1>Current Experiments</font></td></tr>
<tr><td class="menuoptusage" align=right>
<?php echo $active_expts ?></td>
<td align="left" class="menuoptusage">
<a href=explist.php3#active>Active</a>
</td></tr>
<tr><td align="right" class="menuoptusage"><?php echo $idle_expts ?></td>
<td align="left" class="menuoptusage">Idle</td></tr>
<tr><td align="right" class="menuoptusage"><?php echo $swapped_expts ?></td>
<td align="left" class="menuoptusage">
<a href=explist.php3#swapped>Swapped</a>
</td></tr>
<tr><td align="right" class="menuoptusage"><b><?php echo $freepcs ?></b></td>
<td align="left" class="menuoptusage"><b>Free PCs</b></td>
</tr>
</table></body></html>
......@@ -45,42 +45,6 @@ if ($uid = GETUID()) {
#
PAGEHEADER("Emulab - Network Emulation Testbed Home");
# Get some stats about current experiments
$query_result =
DBQueryFatal("select count(*) from experiments as e " .
"left join experiment_stats as s on s.exptidx=e.idx " .
"left join experiment_resources as rs on rs.idx=s.rsrcidx ".
"where state='active' and rs.pnodes>0 and " .
" e.pid!='emulab-ops' and ".
" not (e.pid='ron' and e.eid='all')");
if (mysql_num_rows($query_result) != 1) {
$active_expts = "ERR";
} else {
$row = mysql_fetch_array($query_result);
$active_expts = $row[0];
}
$query_result = DBQueryFatal("select count(*) from experiments where ".
"state='swapped' and pid!='emulab-ops' and pid!='testbed'");
if (mysql_num_rows($query_result) != 1) {
$swapped_expts = "ERR";
} else {
$row = mysql_fetch_array($query_result);
$swapped_expts = $row[0];
}
$query_result = DBQueryFatal("select count(*) from experiments where ".
"swap_requests > 0 and idle_ignore=0 ".
"and pid!='emulab-ops' and pid!='testbed'");
if (mysql_num_rows($query_result) != 1) {
$idle_expts = "ERR";
} else {
$row = mysql_fetch_array($query_result);
$idle_expts = $row[0];
}
#
# Special banner message.
#
......@@ -93,23 +57,6 @@ if ($message != "") {
?>
<center>
<table align="right">
<tr><th nowrap colspan=2 class="contentheader" align="center">
Current Experiments</th></tr>
<tr><td align="right" class="menuopt"><?php echo $active_expts ?></td>
<td align="left" class="menuopt">
<a href=explist.php3#active>Active</a>
</td></tr>
<tr><td align="right" class="menuopt"><?php echo $idle_expts ?></td>
<td align="left" class="menuopt">Idle</td></tr>
<tr><td align="right" class="menuopt"><?php echo $swapped_expts ?></td>
<td align="left" class="menuopt">
<a href=explist.php3#swapped>Swapped</a>
</td></tr>
</table>
</center>
<p><em>Netbed</em>, an outgrowth of <em>Emulab</em>, provides
integrated access to three disparate experimental environments:
<a href="tutorial/docwrapper.php3?docname=nse.html">simulated</a>,
......
......@@ -478,12 +478,7 @@ function WRITESIDEBAR() {
WRITESIDEBARDIVIDER();
# Free PCs. Silly.
$freepcs = TBFreePCs();
WRITESIDEBARBUTTON("Node Status ".
"<b><font color=black>($freepcs free PCs)".
"</font></b>",
WRITESIDEBARBUTTON("Node Status",
$TBBASE, "nodecontrol_list.php3");
SIDEBARCELL("List <a " .
......@@ -670,7 +665,7 @@ function WRITESIMPLESIDEBAR($menudefs) {
#
# spits out beginning part of page
#
function PAGEBEGINNING( $title, $nobanner = 0 ) {
function PAGEBEGINNING( $title, $nobanner = 0, $nocontent = 0 ) {
global $BASEPATH, $TBMAINSITE, $THISHOMEBASE, $ELABINELAB;
global $TBDIR, $WWW;
global $MAINPAGE;
......@@ -693,9 +688,9 @@ function PAGEBEGINNING( $title, $nobanner = 0 ) {
<style type='text/css' media='all'>
<!-- @import '$BASEPATH/style.css'; -->";
if (!$MAINPAGE) {
echo "<!-- @import '$BASEPATH/style-nonmain.css'; -->";
}
# if (!$MAINPAGE) {
# echo "<!-- @import '$BASEPATH/style-nonmain.css'; -->";
# }
echo "</style>\n";
......@@ -739,13 +734,21 @@ function PAGEBEGINNING( $title, $nobanner = 0 ) {
if (!$MAINPAGE) {
echo "<font size='+1' color='#CCFFCC'>&nbsp;<b>$WWW</b></font>";
}
echo "</td></tr></table>\n";
echo "</td>\n";
echo "<td valign=top align=right width=175
class=banneriframe>
<iframe src=currentusage.php3
width=100% height=100 marginheight=0 marginwidth=0
scrolling=no frameborder=0></iframe></td>\n";
echo "</tr></table>\n";
}
if (! $nocontent ) {
echo "<table cellpadding='8' cellspacing='0' height='100%'
width='100%'>
<tr height='100%'>
<td valign='top' class='leftcell' bgcolor='#ccddee'>
<!-- sidebar begins -->";
}
echo "<table cellpadding='8' cellspacing='0' height='100%' width='100%'>
<tr height='100%'>
<td valign='top' class='leftcell' bgcolor='#ccddee'>
<!-- sidebar begins -->";
}
#
......@@ -838,7 +841,7 @@ function PAGEHEADER($title, $view = NULL) {
} else {
$nobanner = 0;
}
PAGEBEGINNING( $title, $nobanner );
PAGEBEGINNING( $title, $nobanner, 0 );
if (!isset($view['hide_sidebar'])) {
WRITESIDEBAR();
}
......
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-2003 University of Utah and the Flux Group.
* Copyright (c) 2000-2003, 2005 University of Utah and the Flux Group.
* All rights reserved.
*/
......@@ -49,6 +49,11 @@ td.paddedcell2 { padding: 0.5em; }
padding: 8px;
padding-left: 3px;
background-image: url(wallpaper1.png); }
.banneriframe {
background-color: #000;
border: solid 2px black;
padding: 0px;
spacing: 0px; }
.menu {
border: solid 2px black;
margin: 0px;
......@@ -69,7 +74,6 @@ td.paddedcell2 { padding: 0.5em; }
padding-bottom: 0px;
margin: 0px;
border: 0px; }
.menuopt,.menuoptb, .menuoptdiv, .menuopts, .menuoptst, .menuoptsb {
background-color: #cde;
padding-left: 6px;
......@@ -79,6 +83,15 @@ td.paddedcell2 { padding: 0.5em; }
border: 0px;
font-size: 10pt; }
td.menuoptusage {
background-color: #cde;
padding-left: 6px;
padding-top: 1px;
padding-bottom: 0px;
margin: 0px;
border: 0px;
font-size: 10pt }
.topbaropt {
background-color: #fff;
padding-bottom: 0px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment