Commit 29ca24eb authored by Leigh Stoller's avatar Leigh Stoller

Some quickie changes for Jay.

* Remove star on netbed CD
* Remove ron/all picture from counts and pictures.
* Display a multiple of 4 pictures
* Add new icon to active/swapped links on index page
* Link to active/swapped directly from index page
* Change title to Active and Recently Swapped Out.

Still a problem though; counts no longer match. will fix when I return
from the dentist.
parent aa72d7d6
......@@ -9,22 +9,24 @@ include("defs.php3");
#
# Standard Testbed Header
#
PAGEHEADER("Pretty Pictures of (Recently) Active Experiments");
PAGEHEADER("Active and Recently Swapped Out Experiments");
#
# We let anyone access this page. No details are leaked out, hopefully.
#
$thumbCount = 0;
$thumbMax = 0;
function GENPLIST ($which, $query_result)
{
global $thumbCount, $TBOPSPID, $TB_EXPTSTATE_ACTIVE;
global $thumbCount, $thumbMax, $TBOPSPID, $TB_EXPTSTATE_ACTIVE;
echo "<center><h3>$which</h3></center>\n";
echo "<table border=2 cols=4 cellpadding=2
cellspacing=2 align=center><tr>";
while (($row = mysql_fetch_array($query_result)) && $thumbCount < 100) {
while (($row = mysql_fetch_array($query_result)) &&
($thumbMax == 0 || $thumbCount < $thumbMax)) {
$pid = $row["pid"];
$eid = $row["eid"];
$pnodes = $row["pnodes"];
......@@ -32,8 +34,9 @@ function GENPLIST ($which, $query_result)
$swapdate = $row["swapdate"];
$state = $row["state"];
if ($pid == $TBOPSPID || $pnodes == 0 || !isset($thumb_hash) ||
!isset($swapdate)) {
if ($pid == $TBOPSPID || $pnodes == 0 ||
($pid == "ron" && $eid == "all") ||
!isset($thumb_hash)) {
continue;
}
if ($state == $TB_EXPTSTATE_ACTIVE) {
......@@ -49,8 +52,8 @@ function GENPLIST ($which, $query_result)
" $swapdate" .
"</td>";
$thumbcount++;
if (($thumbcount % 4) == 0) {
$thumbCount++;
if (($thumbCount % 4) == 0) {
echo "</tr><tr>\n";
}
}
......@@ -72,6 +75,7 @@ $query_result =
" e.state='" . $TB_EXPTSTATE_ACTIVE . "' " .
"order by s.swapin_last desc ");
echo "<a NAME=active></a>\n";
if (mysql_num_rows($query_result)) {
GENPLIST("Active Experiments", $query_result);
}
......@@ -87,10 +91,13 @@ $query_result =
"where rs.pnodes-rs.delaynodes>2 and ".
" e.state='" . $TB_EXPTSTATE_SWAPPED . "' " .
"order by s.swapout_last desc ".
"limit 50");
"limit 200");
echo "<a NAME=swapped></a>\n";
if (mysql_num_rows($query_result)) {
GENPLIST("Recently Active Experiments", $query_result);
$thumbCount = 0;
$thumbMax = 80;
GENPLIST("Recently Swapped Out Experiments", $query_result);
}
#
......
......@@ -17,7 +17,9 @@ $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'");
"where state='active' and rs.pnodes > 0 and " .
" e.pid!='emulab-ops' and (e.pid!='ron' and e.eid!='all')");
if (mysql_num_rows($query_result) != 1) {
$active_expts = "ERR";
} else {
......@@ -52,13 +54,15 @@ if (mysql_num_rows($query_result) != 1) {
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</a>
<a href=explist.php3#active>Active</a>
<img src=/new.gif>
</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</a>
<a href=explist.php3#swapped>Swapped</a>
<img src=/new.gif>
</td></tr>
</table>
</center>
......
......@@ -131,7 +131,7 @@ function WRITESIDEBAR() {
if ($rootEmulab) {
WRITESIDEBARBUTTON("Other Emulabs", $TBDOCBASE,
"docwrapper.php3?docname=otheremulabs.html");
WRITESIDEBARBUTTON_COOL("Join Netbed (CD)",
WRITESIDEBARBUTTON("Join Netbed (CD)",
$TBDOCBASE, "cdrom.php");
} else {
WRITESIDEBARBUTTON_ABS("Utah Emulab", $TBDOCBASE,
......
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