Commit 784c702e authored by Kevin Atkinson's avatar Kevin Atkinson

When a run is over changed:
  Template: 10424/23 (Current Run: bt-R54)
to
  Template: 10424/23 (Last Run: bt-R54)
Rather Than displaying
  Template: 10424/23 (Current Run:)

Also changed "Instance Bindings" to "Last Run Bindings" since that makes
much more sense, at least to me. (FS # 128:
https://users.emulab.net/flyspray/?do=details&id=128)
The function to show Instance Bindings still exists so it can easily be
changed back.
parent 0549709f
......@@ -697,7 +697,7 @@ if ($instance &&
($expstate == $TB_EXPTSTATE_ACTIVE ||
$expstate == $TB_EXPTSTATE_PANICED ||
$expstate == $TB_EXPTSTATE_ACTIVATING)) {
$instance->ShowBindings();
$instance->ShowLastRunBindings();
}
#
......
......@@ -871,19 +871,29 @@ function SHOWEXP($pid, $eid, $short = 0, $sortby = "") {
if (! is_null($instance)) {
$guid = $instance->guid();
$vers = $instance->vers();
$runidx = $instance->runidx();
$runid = $instance->GetRunID($runidx);
echo "<tr>
<td>Template: </td>
<td class=\"left\">
<a href='template_show.php?guid=$guid&version=$vers'>
$guid/$vers</a>
(Current Run:
<a href='experimentrun_show.php?guid=$guid".
$guid/$vers</a>";
if ($instance->runidx()) {
$runidx = $instance->runidx();
$runid = $instance->GetRunID($runidx);
echo " (Current Run:
<a href='experimentrun_show.php?guid=$guid".
"&version=$vers&exptidx=$exptidx&runidx=$runidx'>".
"$runid)</a></td>
</tr>\n";
"$runid</a>)</td>";
} else {
$runidx = $instance->LastRunIdx();
$runid = $instance->GetRunID($runidx);
echo " (Last Run:
<a href='experimentrun_show.php?guid=$guid".
"&version=$vers&exptidx=$exptidx&runidx=$runidx'>".
"$runid</a>)</td>";
}
echo "</tr>\n";
}
echo "<tr>
......
......@@ -1223,6 +1223,47 @@ class TemplateInstance
return 1;
}
#
# Display last run bindings in a table
#
function ShowLastRunBindings() {
$exptidx = $this->exptidx();
$runidx = $this->LastRunIdx();
$query_result =
DBQueryWarn("select * from experiment_run_bindings ".
"where exptidx='$exptidx' and runidx='$runidx' ".
"order by name");
if (!mysql_num_rows($query_result))
return 0;
echo "<center>
<h3>Last Run Bindings</h3>
</center>
<table align=center border=1 cellpadding=5 cellspacing=2>\n";
echo "<tr>
<th>Name</th>
<th>Value</th>
</tr>\n";
while ($row = mysql_fetch_array($query_result)) {
$name = $row['name'];
$value = $row['value'];
if (!isset($value)) {
$value = "&nbsp";
}
echo "<tr>
<td>$name</td>
<td>$value</td>
</tr>\n";
}
echo "</table>\n";
return 1;
}
#
# Show the run list for an instance.
#
......
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