All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 0ce8d91f authored by Leigh B Stoller's avatar Leigh B Stoller

Show activity button on the show-profile page, admins only. Add a

column on the profile activity page to link to the log files. This is
imperfect, turns out we do not save the publicid in the CM history
tables, so have lost the ability for public access to terminated slices
(there is no way to look up a terminated slice by publicid). Admins can
see them though, using the slice_uuid since red-dot is allowed to do
that.
parent 0ae9f4e1
<?php
#
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
# Copyright (c) 2000-2014, 2017 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -56,25 +56,31 @@ $instances = array();
#
$query1_result =
DBQueryFatal("select i.uuid,i.profile_version,i.created,'' as destroyed, ".
" i.creator,p.uuid as profile_uuid,u.email ".
" i.creator,p.uuid as profile_uuid,u.email,ia.public_url, ".
" i.slice_uuid ".
" from apt_instances as i ".
"left join apt_instance_aggregates as ia ".
" on ia.uuid=i.uuid ".
"left join apt_profile_versions as p on ".
" p.profileid=i.profile_id and ".
" p.version=i.profile_version ".
"left join geni.geni_users as u on u.uuid=i.creator_uuid ".
"where i.profile_id='$profileid' ".
"order by i.created desc");
"group by i.uuid order by i.created desc");
$query2_result =
DBQueryFatal("select h.uuid,h.profile_version,h.created,h.destroyed, ".
" h.creator,p.uuid as profile_uuid,u.email ".
" h.creator,p.uuid as profile_uuid,u.email,ia.public_url, ".
" h.slice_uuid ".
" from apt_instance_history as h ".
"left join apt_instance_aggregate_history as ia ".
" on ia.uuid=h.uuid ".
"left join apt_profile_versions as p on ".
" p.profileid=h.profile_id and ".
" p.version=h.profile_version ".
"left join geni.geni_users as u on u.uuid=h.creator_uuid ".
"where h.profile_id='$profileid' ".
"order by h.created desc");
"group by h.uuid order by h.created desc");
if (mysql_num_rows($query1_result) == 0 &&
mysql_num_rows($query2_result) == 0) {
......@@ -92,11 +98,19 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$destroyed = $row["destroyed"];
$creator = $row["creator"];
$email = $row["email"];
$public_url= $row["public_url"];
$slice_uuid= $row["slice_uuid"];
# If a guest user, use email instead.
if (isset($email)) {
$creator = $email;
}
#
# If the slice is gone, the public url needs to be replaced.
#
if ($destroyed != "" && preg_match("/publicid=\w*/", $public_url)) {
$public_url = "https://" . parse_url($public_url, PHP_URL_HOST) .
"/showslicelogs.php?slice_uuid=" . $slice_uuid;
}
$instance = array();
$instance["uuid"] = $uuid;
$instance["p_uuid"] = $puuid;
......@@ -104,6 +118,7 @@ foreach (array($query1_result, $query2_result) as $query_result) {
$instance["creator"] = $creator;
$instance["created"] = $created;
$instance["destroyed"] = $destroyed;
$instance["public_url"] = $public_url;
$instances[] = $instance;
}
}
......
......@@ -10,6 +10,7 @@
<th>Creator</th>
<th>Created</th>
<th>Destroyed</th>
<th>Logs</th>
</tr>
</thead>
<tbody>
......@@ -22,6 +23,8 @@
<td><%- instance.creator %></td>
<td><%- instance.created %></td>
<td><%- instance.destroyed %></td>
<td><a href='<%- instance.public_url %>' target="_blank">
<span class="glyphicon glyphicon-link"></span></a></td>
</tr>
<% }); %>
</tbody>
......
......@@ -87,6 +87,14 @@
type='button'>Version History
</a>
<% } %>
<% if (isadmin) { %>
<a class='btn btn-info btn-xs pull-left'
id='profile_history_button'
style='margin-right: 10px; font-size: 12px'
href='profile-activity.php?uuid=<%= profile_uuid %>'
type='button'>Activity
</a>
<% } %>
</div>
</div>
<% if (fromrepo) { %>
......@@ -118,6 +126,12 @@
<td>Est. Size:</td>
<td class="commit-size"></td>
</tr>
<% if (isadmin) { %>
<tr>
<td>RepoName:</td>
<td class="commit-reponame" style="font-size: 60%;"></td>
</tr>
<% } %>
<tr>
<td>Log:</td>
<td class="commit-log">
......
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