Commit eb438194 authored by Leigh B. Stoller's avatar Leigh B. Stoller

More nits from Mike. Never ever happy.

parent c0c6e106
...@@ -980,8 +980,8 @@ function SHOWNODES($pid, $eid) { ...@@ -980,8 +980,8 @@ function SHOWNODES($pid, $eid) {
global $SCRIPT_NAME; global $SCRIPT_NAME;
$reserved_result = $reserved_result =
DBQueryFatal("SELECT * FROM reserved WHERE ". DBQueryFatal("select * from reserved as r " .
"eid='$eid' and pid='$pid'"); "where r.eid='$eid' and r.pid='$pid'");
# If this is an expt in emulab-ops, we don't care about vname, # If this is an expt in emulab-ops, we don't care about vname,
# since it won't be defined. But we do want to know when the node # since it won't be defined. But we do want to know when the node
...@@ -1014,29 +1014,30 @@ function SHOWNODES($pid, $eid) { ...@@ -1014,29 +1014,30 @@ function SHOWNODES($pid, $eid) {
<th>Node<br>Status</th> <th>Node<br>Status</th>
<th>Hours<br>Idle[<b>1</b>]</th> <th>Hours<br>Idle[<b>1</b>]</th>
<th>Startup<br>Status[<b>2</b>]</th> <th>Startup<br>Status[<b>2</b>]</th>
<th>Console</th>
<th>SSH</th> <th>SSH</th>
<th>Console</th>
</tr>\n"; </tr>\n";
$sort = "type,priority"; $sort = "n.type,n.priority";
if ($altnodesort==1) { if ($altnodesort==1) {
$sort = "vname"; $sort = "r.vname";
} elseif ($altnodesort==2) { } elseif ($altnodesort==2) {
$sort = "rsrvtime"; $sort = "rsrvtime";
} # Can add other alt sorts here too } # Can add other alt sorts here too
$query_result = $query_result =
DBQueryFatal("SELECT nodes.*,reserved.*,ns.status as nodestatus, ". DBQueryFatal("SELECT r.*,n.*,nt.isvirtnode, ".
"date_format(rsrv_time,\"%Y-%m-%d&nbsp;%T\") as rsrvtime ". " ns.status as nodestatus, ".
"FROM nodes LEFT JOIN node_activity ". " date_format(rsrv_time,\"%Y-%m-%d&nbsp;%T\") as rsrvtime ".
"on nodes.node_id=node_activity.node_id ". "from reserved as r ".
"LEFT JOIN reserved ON nodes.node_id=reserved.node_id ". "left join nodes as n on n.node_id=r.node_id ".
"LEFT JOIN node_status as ns ON ns.node_id=nodes.node_id ". "left join node_types as nt on nt.type=n.type ".
"WHERE reserved.eid=\"$eid\" and reserved.pid=\"$pid\" ". "left join node_status as ns on ns.node_id=r.node_id ".
"WHERE r.eid='$eid' and r.pid='$pid' ".
"ORDER BY $sort"); "ORDER BY $sort");
$stalemark = "<b>?</b>"; $stalemark = "<b>?</b>";
$count = 0;
while ($row = mysql_fetch_array($query_result)) { while ($row = mysql_fetch_array($query_result)) {
$node_id = $row[node_id]; $node_id = $row[node_id];
...@@ -1046,6 +1047,7 @@ function SHOWNODES($pid, $eid) { ...@@ -1046,6 +1047,7 @@ function SHOWNODES($pid, $eid) {
$startstatus = $row[startstatus]; $startstatus = $row[startstatus];
$status = $row[nodestatus]; $status = $row[nodestatus];
$bootstate = $row[eventstate]; $bootstate = $row[eventstate];
$isvirtnode = $row[isvirtnode];
$idlehours = TBGetNodeIdleTime($node_id); $idlehours = TBGetNodeIdleTime($node_id);
$stale = TBGetNodeIdleStale($node_id); $stale = TBGetNodeIdleStale($node_id);
...@@ -1058,6 +1060,11 @@ function SHOWNODES($pid, $eid) { ...@@ -1058,6 +1060,11 @@ function SHOWNODES($pid, $eid) {
if (!$vname) if (!$vname)
$vname = "--"; $vname = "--";
if ($count & 1) {
echo "<tr></tr>\n";
}
$count++;
echo "<tr> echo "<tr>
<td><A href='shownode.php3?node_id=$node_id'>$node_id</a> <td><A href='shownode.php3?node_id=$node_id'>$node_id</a>
</td> </td>
...@@ -1080,12 +1087,17 @@ function SHOWNODES($pid, $eid) { ...@@ -1080,12 +1087,17 @@ function SHOWNODES($pid, $eid) {
echo " <td>$idlestr</td> echo " <td>$idlestr</td>
<td align=center>$startstatus</td>\n"; <td align=center>$startstatus</td>\n";
echo " <td align=center>
<A href='nodetipacl.php3?node_id=$node_id'>
<img src=\"console.gif\" alt=c></A></td>\n";
echo " <td align=center> echo " <td align=center>
<A href='nodessh.php3?node_id=$node_id'> <A href='nodessh.php3?node_id=$node_id'>
<img src=\"ssh.gif\" alt=s></A></td>\n"; <img src=\"ssh.gif\" alt=s></A></td>\n";
if ($isvirtnode) {
echo "<td>&nbsp</td>\n";
}
else {
echo " <td align=center>
<A href='nodetipacl.php3?node_id=$node_id'>
<img src=\"console.gif\" alt=c></A></td>\n";
}
echo "</tr>\n"; echo "</tr>\n";
} }
echo "</table>\n"; echo "</table>\n";
......
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