All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 29ca24eb authored by Leigh B. Stoller's avatar Leigh B. 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"); ...@@ -9,22 +9,24 @@ include("defs.php3");
# #
# Standard Testbed Header # 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. # We let anyone access this page. No details are leaked out, hopefully.
# #
$thumbCount = 0; $thumbCount = 0;
$thumbMax = 0;
function GENPLIST ($which, $query_result) 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 "<center><h3>$which</h3></center>\n";
echo "<table border=2 cols=4 cellpadding=2 echo "<table border=2 cols=4 cellpadding=2
cellspacing=2 align=center><tr>"; 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"]; $pid = $row["pid"];
$eid = $row["eid"]; $eid = $row["eid"];
$pnodes = $row["pnodes"]; $pnodes = $row["pnodes"];
...@@ -32,8 +34,9 @@ function GENPLIST ($which, $query_result) ...@@ -32,8 +34,9 @@ function GENPLIST ($which, $query_result)
$swapdate = $row["swapdate"]; $swapdate = $row["swapdate"];
$state = $row["state"]; $state = $row["state"];
if ($pid == $TBOPSPID || $pnodes == 0 || !isset($thumb_hash) || if ($pid == $TBOPSPID || $pnodes == 0 ||
!isset($swapdate)) { ($pid == "ron" && $eid == "all") ||
!isset($thumb_hash)) {
continue; continue;
} }
if ($state == $TB_EXPTSTATE_ACTIVE) { if ($state == $TB_EXPTSTATE_ACTIVE) {
...@@ -49,8 +52,8 @@ function GENPLIST ($which, $query_result) ...@@ -49,8 +52,8 @@ function GENPLIST ($which, $query_result)
" $swapdate" . " $swapdate" .
"</td>"; "</td>";
$thumbcount++; $thumbCount++;
if (($thumbcount % 4) == 0) { if (($thumbCount % 4) == 0) {
echo "</tr><tr>\n"; echo "</tr><tr>\n";
} }
} }
...@@ -72,6 +75,7 @@ $query_result = ...@@ -72,6 +75,7 @@ $query_result =
" e.state='" . $TB_EXPTSTATE_ACTIVE . "' " . " e.state='" . $TB_EXPTSTATE_ACTIVE . "' " .
"order by s.swapin_last desc "); "order by s.swapin_last desc ");
echo "<a NAME=active></a>\n";
if (mysql_num_rows($query_result)) { if (mysql_num_rows($query_result)) {
GENPLIST("Active Experiments", $query_result); GENPLIST("Active Experiments", $query_result);
} }
...@@ -87,10 +91,13 @@ $query_result = ...@@ -87,10 +91,13 @@ $query_result =
"where rs.pnodes-rs.delaynodes>2 and ". "where rs.pnodes-rs.delaynodes>2 and ".
" e.state='" . $TB_EXPTSTATE_SWAPPED . "' " . " e.state='" . $TB_EXPTSTATE_SWAPPED . "' " .
"order by s.swapout_last desc ". "order by s.swapout_last desc ".
"limit 50"); "limit 200");
echo "<a NAME=swapped></a>\n";
if (mysql_num_rows($query_result)) { 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 = ...@@ -17,7 +17,9 @@ $query_result =
DBQueryFatal("select count(*) from experiments as e " . DBQueryFatal("select count(*) from experiments as e " .
"left join experiment_stats as s on s.exptidx=e.idx " . "left join experiment_stats as s on s.exptidx=e.idx " .
"left join experiment_resources as rs on rs.idx=s.rsrcidx ". "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) { if (mysql_num_rows($query_result) != 1) {
$active_expts = "ERR"; $active_expts = "ERR";
} else { } else {
...@@ -52,13 +54,15 @@ if (mysql_num_rows($query_result) != 1) { ...@@ -52,13 +54,15 @@ if (mysql_num_rows($query_result) != 1) {
Current Experiments</th></tr> Current Experiments</th></tr>
<tr><td align="right" class="menuopt"><?php echo $active_expts ?></td> <tr><td align="right" class="menuopt"><?php echo $active_expts ?></td>
<td align="left" class="menuopt"> <td align="left" class="menuopt">
<a href=explist.php3>Active</a> <a href=explist.php3#active>Active</a>
<img src=/new.gif>
</td></tr> </td></tr>
<tr><td align="right" class="menuopt"><?php echo $idle_expts ?></td> <tr><td align="right" class="menuopt"><?php echo $idle_expts ?></td>
<td align="left" class="menuopt">Idle</td></tr> <td align="left" class="menuopt">Idle</td></tr>
<tr><td align="right" class="menuopt"><?php echo $swapped_expts ?></td> <tr><td align="right" class="menuopt"><?php echo $swapped_expts ?></td>
<td align="left" class="menuopt"> <td align="left" class="menuopt">
<a href=explist.php3>Swapped</a> <a href=explist.php3#swapped>Swapped</a>
<img src=/new.gif>
</td></tr> </td></tr>
</table> </table>
</center> </center>
......
...@@ -131,7 +131,7 @@ function WRITESIDEBAR() { ...@@ -131,7 +131,7 @@ function WRITESIDEBAR() {
if ($rootEmulab) { if ($rootEmulab) {
WRITESIDEBARBUTTON("Other Emulabs", $TBDOCBASE, WRITESIDEBARBUTTON("Other Emulabs", $TBDOCBASE,
"docwrapper.php3?docname=otheremulabs.html"); "docwrapper.php3?docname=otheremulabs.html");
WRITESIDEBARBUTTON_COOL("Join Netbed (CD)", WRITESIDEBARBUTTON("Join Netbed (CD)",
$TBDOCBASE, "cdrom.php"); $TBDOCBASE, "cdrom.php");
} else { } else {
WRITESIDEBARBUTTON_ABS("Utah Emulab", $TBDOCBASE, 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