Commit 9df58328 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

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

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