Commit 7bd58a1e authored by Leigh Stoller's avatar Leigh Stoller

For Mike, add the cluster list to the profile activity page.

parent 13bb57a9
<?php
#
# Copyright (c) 2000-2014, 2017 University of Utah and the Flux Group.
# Copyright (c) 2000-2018 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -59,6 +59,7 @@ $query1_result =
" i.uuid,i.profile_version,i.created,'' as destroyed, ".
" i.creator,p.uuid as profile_uuid,u.email,".
" GROUP_CONCAT(ia.public_url) as public_urls, ".
" GROUP_CONCAT(aa.abbreviation) as clusters, ".
" i.slice_uuid,f.exitmessage,f.exitcode ".
" from apt_instances as i ".
"left join apt_instance_failures as f ".
......@@ -69,6 +70,7 @@ $query1_result =
" p.profileid=i.profile_id and ".
" p.version=i.profile_version ".
"left join geni.geni_users as u on u.uuid=i.creator_uuid ".
"left join apt_aggregates as aa on aa.urn=ia.aggregate_urn ".
"where i.profile_id='$profileid' ".
"group by i.uuid order by i.created desc");
......@@ -77,6 +79,7 @@ $query2_result =
" h.uuid,h.profile_version,h.created,h.destroyed, ".
" h.creator,p.uuid as profile_uuid,u.email, ".
" GROUP_CONCAT(ia.public_url) as public_urls, ".
" GROUP_CONCAT(aa.abbreviation) as clusters, ".
" h.slice_uuid,f.exitmessage,f.exitcode ".
" from apt_instance_history as h ".
"left join apt_instance_failures as f ".
......@@ -87,6 +90,7 @@ $query2_result =
" p.profileid=h.profile_id and ".
" p.version=h.profile_version ".
"left join geni.geni_users as u on u.uuid=h.creator_uuid ".
"left join apt_aggregates as aa on aa.urn=ia.aggregate_urn ".
"where h.profile_id='$profileid' ".
"group by h.uuid order by h.created desc");
......@@ -111,6 +115,7 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$exitcode = $row["exitcode"];
$public_urls= $row["public_urls"];
$slice_uuid= $row["slice_uuid"];
$clusters = $row["clusters"];
# If a guest user, use email instead.
if (isset($email)) {
$creator = $email;
......@@ -135,6 +140,7 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$instance["creator"] = $creator;
$instance["created"] = $created;
$instance["destroyed"] = $destroyed;
$instance["clusters"] = ($clusters ? $clusters : "n/a");
if (ISADMIN()) {
$instance["public_urls"] = $public_urls;
}
......
......@@ -10,6 +10,7 @@
<th>Creator</th>
<th>Created</th>
<th>Destroyed</th>
<th>Clusters</th>
<th>Error</th>
<% if (window.ISADMIN) { %>
<th>Logs</th>
......@@ -29,8 +30,9 @@
<td><a href='status.php?uuid=<%- instance.uuid %>' target="_blank">
<span class="glyphicon glyphicon-eye-open"></span></a></td>
<% } else { %>
<td><%- instance.destroyed %></td>
<td><%- instance.destroyed %></td>
<% } %>
<td><%- instance.clusters %></td>
<td class="text-danger">
<% if (_.has(instance, "iserror")) { %>
<% if (_.has(instance, "error_message")) { %>
......
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