Commit 6cde12e3 authored by Leigh Stoller's avatar Leigh Stoller

Make the status box at the top of the page a 3-way toggle, so that

users (well, Jay), can get to the Current Experiments display.
parent 4dc7c239
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved.
#
require("defs.php3");
......@@ -18,7 +18,7 @@ $this_user = CheckLogin($check_status);
#
# For anonymous users, show experiment stats.
#
function SHOWSTATS()
function SHOWSTATS($mini = 0)
{
$query_result =
DBQueryFatal("select count(*) from experiments as e " .
......@@ -61,7 +61,8 @@ function SHOWSTATS()
}
$freepcs = TBFreePCs();
$output = "<table valign=top align=center width=100% height=100% border=1>
$output = "<table valign=top align=center width=100% height=100%
cellpadding=0 cellspacing=1 border=0>
<tr><th nowrap colspan=2 class='usagetitle'>
Current Experiments</th></tr>
<tr><td class=menuoptusage align=right>$active_expts</td>
......@@ -73,13 +74,15 @@ function SHOWSTATS()
<tr><td align=right class=menuoptusage>$swapped_expts</td>
<td align=left class=menuoptusage>
<a target=_parent href=explist.php3#swapped>Swapped</a>
</td></tr>
<tr><td align=right class=menuoptusage>
</td></tr>";
if (!$mini) {
$output .= "<tr><td align=right class=menuoptusage>
<font size=+1>$freepcs</font></td>
<td align=left class=menuoptusage>
<font size=+1>Free PCs</font></td>
</tr>
</table>\n";
</tr>";
}
$output .= "</table>\n";
return $output;
}
......@@ -220,6 +223,9 @@ function FreeNodeHtml($usagemode = null) {
if ($usagemode == null || $usagemode == "status") {
return ShowStatus();
}
elseif ($usagemode == "stats") {
return SHOWSTATS(1);
}
else {
return SHOWFREENODES();
}
......
......@@ -1216,8 +1216,15 @@ function PAGEFOOTER($view = NULL) {
x_FreeNodeHtml(usagetablemode, FreeNodeHtml_CB);
}
function ToggleUsageTable() {
usagetablemode =
(usagetablemode == "status" ? "freenodes" : "status");
if (usagetablemode == "status") {
usagetablemode = "freenodes";
}
else if (usagetablemode == "freenodes") {
usagetablemode = "stats";
}
else {
usagetablemode = "status";
}
document.cookie = "usagetablemode=" + usagetablemode;
GetFreeNodeHtml();
}
......
......@@ -142,10 +142,24 @@ div#showexpusagefreenodes table td a {
color: #2222BB;
}
.usagetitle {
div#usagefreenodes table tr th.usagetitle,
div#usage table tr th.usagetitle {
color: #fff;
background-color: #222222;
text-align: center;
}
div#usagefreenodes table tr th.usagetitle {
font-size: 8pt;
border: solid 0px
padding-left: 1px;
padding-right: 1px;
padding-top: 0px;
padding-bottom: 0px;
margin: 0px;
border: 0px;
line-height: 12px;
}
div#usage table tr th.usagetitle {
font-size: 10pt;
}
......
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