Commit 9df58328 authored by Leigh Stoller's avatar Leigh Stoller

Reformat the free pcs table slightly, as per Mike's suggestion.

parent 38463b50
......@@ -123,10 +123,12 @@ function SHOWFREENODES()
}
PAGEBEGINNING("Free Node Summary", 1, 1);
$freepcs = TBFreePCs();
$reloading = TBReloadingPCs();
echo "<table valign=top align=center width=100% height=100% border=1>
<tr><td nowrap colspan=4 class=contentheader
bgcolor='#E1EAEA' align=center>
<font size=-1>Free PCs</font></td></tr>\n";
<tr><td nowrap colspan=4 class=menuoptusage align=center>
<b>$freepcs Free PCs</b></td></tr>\n";
$pccount = count($freecounts);
$newrow = 1;
......@@ -156,10 +158,10 @@ function SHOWFREENODES()
<td class=menuoptusage>&nbsp</td></tr>\n";
}
}
$freepcs = TBFreePCs();
echo "<tr>
<td class=menuoptusage colspan=4 align=center>
<b>$freepcs Free PCs</b></td>
<b>$reloading PCs reloading</b></td>
</tr>\n";
echo "</table>";
}
......
......@@ -9,6 +9,9 @@ $TBOPSPID = "emulab-ops";
$NODEDEAD_PID = $TBOPSPID;
$NODEDEAD_EID = "hwdown";
$FIRSTUSER = "elabman";
$NODERELOADING_PID = $TBOPSPID;
$NODERELOADING_EID = "reloading";
$NODERELOADPENDING_EID = "reloadpending";
# All these constants need to go at some point, replaced by data from
# the regex table.
......@@ -1501,6 +1504,26 @@ function TBUserPCs($uid)
return mysql_num_rows($query_result);
}
#
# Number of PCs reloading.
#
function TBReloadingPCs()
{
global $NODERELOADING_PID, $NODERELOADING_EID, $NODERELOADPENDING_EID;
$query_result =
DBQueryFatal("select count(*) from reserved ".
"where pid='$NODERELOADING_PID' and ".
" (eid='$NODERELOADING_EID' or ".
" eid='$NODERELOADPENDING_EID')");
if (mysql_num_rows($query_result) == 0) {
return 0;
}
$row = mysql_fetch_row($query_result);
return $row[0];
}
function TBExptLogFile($pid, $eid)
{
$query_result =
......
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