Skip to content
Snippets Groups Projects
Commit d6547f36 authored by Mac Newbold's avatar Mac Newbold
Browse files

Change default idledays from 3 to 2, and don't show the swap request button if...

Change default idledays from 3 to 2, and don't show the swap request button if the expt is marked unswappable. (I'll mark things unswappable as necessary for special expts, even if the original creator doesn't.
parent 6d53addf
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ if (! isset($showtype)) ...@@ -22,7 +22,7 @@ if (! isset($showtype))
if (! isset($sortby)) if (! isset($sortby))
$sortby = "normal"; $sortby = "normal";
if (! isset($minidledays)) if (! isset($minidledays))
$minidledays = "3"; $minidledays = "2";
echo "<b>Show: echo "<b>Show:
<a href='showexp_list.php3?showtype=active&sortby=$sortby'>active</a>, <a href='showexp_list.php3?showtype=active&sortby=$sortby'>active</a>,
...@@ -91,7 +91,7 @@ if ($isadmin) { ...@@ -91,7 +91,7 @@ if ($isadmin) {
$clause = ""; $clause = "";
$experiments_result = $experiments_result =
DBQueryFatal("select pid,eid,expt_head_uid,expt_name,state, ". DBQueryFatal("select pid,eid,expt_head_uid,expt_name,state,swappable,".
"date_format(expt_swapped,\"%Y-%m-%d\") as d, ". "date_format(expt_swapped,\"%Y-%m-%d\") as d, ".
"(to_days(now())-to_days(expt_swapped)) as lastswap ". "(to_days(now())-to_days(expt_swapped)) as lastswap ".
"from experiments as e $clause ". "from experiments as e $clause ".
...@@ -169,6 +169,7 @@ kernel or logging into the nodes in a way that lastlogins can't detect.<p>\n"; ...@@ -169,6 +169,7 @@ kernel or logging into the nodes in a way that lastlogins can't detect.<p>\n";
$daysidle=0; $daysidle=0;
if ($isadmin) { if ($isadmin) {
$swappable= $row[swappable];
$foo = "&nbsp;"; $foo = "&nbsp;";
if ($lastexpnodelogins = TBExpUidLastLogins($pid, $eid)) { if ($lastexpnodelogins = TBExpUidLastLogins($pid, $eid)) {
$daysidle=$lastexpnodelogins["daysidle"]; $daysidle=$lastexpnodelogins["daysidle"];
...@@ -182,10 +183,16 @@ kernel or logging into the nodes in a way that lastlogins can't detect.<p>\n"; ...@@ -182,10 +183,16 @@ kernel or logging into the nodes in a way that lastlogins can't detect.<p>\n";
} }
} }
if ($idle) $foo .= "</td><td align=center>$daysidle</td> if ($idle) {
<td align=center valign=center> $foo .= "</td><td align=center>$daysidle</td>\n";
if ($swappable) {
$foo .="<td align=center valign=center>
<a href=\"request_swapexp.php3?pid=$pid&eid=$eid\"> <a href=\"request_swapexp.php3?pid=$pid&eid=$eid\">
<img src=\"redball.gif\"></a>"; <img src=\"redball.gif\"></a>\n";
} else {
$foo .="<td>&nbsp;</td>\n";
}
}
$usage_query = $usage_query =
DBQueryFatal("select nt.class, count(*) from reserved as r ". DBQueryFatal("select nt.class, count(*) from reserved as r ".
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment