Commit 4be1e34c authored by Leigh B Stoller's avatar Leigh B Stoller

Show the cluster in dataset listings.

parent 91a4f08f
......@@ -382,7 +382,7 @@ function DatasetList($which, $target)
$results = array();
$query_result =
DBQueryFatal("select v.* from apt_datasets as v ".
DBQueryFatal("select v.*,agg.nickname from apt_datasets as v ".
"left join apt_aggregates as agg ".
"on agg.urn=v.aggregate_urn ".
"$whereclause $orderclause");
......@@ -400,6 +400,7 @@ function DatasetList($which, $target)
$aggregate_urn= $row["aggregate_urn"];
$created = $row["created"];
$expires = $row["expires"];
$cluster = $row["nickname"];
$blob = array();
$blob["uuid"] = $uuid;
......@@ -414,6 +415,7 @@ function DatasetList($which, $target)
$blob["created"] = $created;
$blob["expires"] = ($type != "imdataset" ? $expires : "");
$blob["aggregate_urn"]= $aggregate_urn;
$blob["cluster"] = $cluster;
$results[$uuid] = $blob;
}
......
......@@ -533,6 +533,7 @@ $(function ()
$('#datasets_content')
.html(template({"datasets" : json.value,
"showcluster" : true,
"showuser" : true,
"showproject" : false}));
......@@ -573,6 +574,7 @@ $(function ()
$('#classic_datasets_content_div')
.html(template({"datasets" : json.value,
"showcluster" : false,
"showuser" : true,
"showproject" : false}));
......
......@@ -503,6 +503,7 @@ $(function ()
$('#datasets_content')
.html(template({"datasets" : json.value,
"showcluster" : true,
"showuser" : false,
"showproject" : true}));
......@@ -542,6 +543,7 @@ $(function ()
$('#classic_datasets_content_div')
.html(template({"datasets" : json.value,
"showcluster" : false,
"showuser" : false,
"showproject" : true}));
......
......@@ -121,7 +121,8 @@ $classic_result =
" $whereclause2)) as foo order by name");
$portal_result =
DBQueryFatal("select d.uuid,'dataset' as type from apt_datasets as d ".
DBQueryFatal("select d.uuid,agg.nickname, ".
" 'dataset' as type from apt_datasets as d ".
"left join apt_aggregates as agg on agg.urn=d.aggregate_urn ".
"$joinclause3 ".
"$whereclause3 order by d.dataset_id");
......@@ -132,7 +133,7 @@ echo "<div class='row'>
col-sm-12 col-sm-offset-0
col-xs-12 col-xs-offset-0'>\n";
function SPITTABLE($which, $results) {
function SPITTABLE($which, $results, $where) {
global $all,$embedded;
if ($which == "main") {
......@@ -147,8 +148,11 @@ function SPITTABLE($which, $results) {
echo " <th>Creator</th>";
}
echo " <th>Project</th>
<th>Type</th>
<th>State</th>
<th>Type</th>\n";
if ($where == "portal") {
echo " <th>Cluster</th>\n";
}
echo " <th>State</th>
<th>Size</th>
<th>Expires</th>
</tr>
......@@ -198,8 +202,12 @@ function SPITTABLE($which, $results) {
$creator</a></td>";
}
echo "<td><a href='show-project.php?project=$pid'>$pid</a></td>
<td>$dtype</td>
<td>$state</td>
<td>$dtype</td>\n";
if ($where == "portal") {
$cluster = $row["nickname"];
echo "<td>$cluster</th>";
}
echo " <td>$state</td>
<td>$size MiB</td>
<td class='format-date'>$expires</td>
</tr>\n";
......@@ -218,7 +226,7 @@ if ($embedded) {
echo $message;
}
else {
SPITTABLE("main", $classic_result);
SPITTABLE("main", $classic_result, "classic");
}
}
else {
......@@ -226,12 +234,12 @@ else {
echo $message;
}
else {
SPITTABLE("main", $portal_result);
SPITTABLE("main", $portal_result, "portal");
}
if (mysql_num_rows($classic_result)) {
echo "<br>\n";
echo "<center><h4>Classic Emulab Datasets</h4></center>\n";
SPITTABLE("classic", $classic_result);
SPITTABLE("classic", $classic_result, "classic");
echo "<br>\n";
}
}
......
......@@ -6,6 +6,7 @@
<% if (showuser) { %><th>Creator</th><% } %>
<% if (showproject) { %><th>Project</th><% } %>
<th>Type</th>
<% if (showcluster) { %><th>Cluster</th><% } %>
<th>Created</th>
<th>Expires</th>
</tr>
......@@ -26,6 +27,7 @@
<%- value.pid %></a></td>
<% } %>
<td><%- value.type %></td>
<% if (showcluster) { %><td><%- value.cluster %></td><% } %>
<td class="format-date"><%- value.created %></td>
<td class="format-date"><%- value.expires %></td>
</tr>
......
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