Commit 70f32cd4 authored by Leigh Stoller's avatar Leigh Stoller

Add outstanding extension requests to the dashboard.

parent 29f57554
......@@ -292,6 +292,37 @@ function Do_GetStats()
}
$dashboard["error_details"] = $error_details;
#
# Experiments waiting for extensions from an administrator
#
$extension_details = array();
$query_result =
DBQueryFatal("select a.*,s.expires, ".
" (UNIX_TIMESTAMP(now()) > ".
" UNIX_TIMESTAMP(s.expires)) as expired ".
" from apt_instances as a ".
"left join geni.geni_slices as s on ".
" s.uuid=a.slice_uuid ".
"where a.extension_requested=1 order by a.creator");
while ($row = mysql_fetch_array($query_result)) {
$name = $row["name"];
$uuid = $row["uuid"];
$pid = $row["pid"];
$expires = $row["expires"];
$created = $row["created"];
$creator = $row["creator"];
$extension_details[$uuid] = array("name" => $name,
"uuid" => $uuid,
"pid" => $pid,
"creator" => $creator,
"created" => $created,
"expires" => $expires);
}
$dashboard["extension_requests"] = $extension_details;
SPITAJAX_RESPONSE($dashboard);
}
......
......@@ -164,7 +164,8 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
event.preventDefault();
if (isfadmin) {
if ($('#extension_history').length) {
$("#extend_history").text($('#extension_history').text());
$("#fadmin_extend_history")
.text($('#extension_history').text());
sup.ShowModal("#extend_history_modal");
}
return;
......
......@@ -212,6 +212,40 @@
</div>
</div>
</div>
<div class='row'>
<div class='col-sm-10 col-sm-offset-1'>
<div class='panel panel-default' id='extension-requests-panel'>
<div class="panel-heading">
<h5><center>Outstanding Extension Requests</center></h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class="table table-condensed table-bordered table-dashboard">
<thead>
<tr>
<th>Name</th>
<th>Creator</th>
<th>Project</th>
<th>Created</th>
<th>Expires</th>
</tr>
</thead>
<tbody>
<% _.each(dashboard.extension_requests, function(value, key) { %>
<tr>
<td><a href="status.php?uuid=<%- value.uuid %>">
<%- value.name %></a></td>
<td><%- value.creator %></td>
<td><%- value.pid %></td>
<td class="format-date"><%- value.created %></td>
<td class="format-date"><%- value.expires %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='row'>
<div class='col-sm-10 col-sm-offset-1'>
<div class='panel panel-default' id='error-details-panel'>
......
......@@ -423,7 +423,7 @@
</h5>
</div>
<div class='modal-body'>
<pre id="extend_history"></pre>
<pre id="fadmin_extend_history"></pre>
</div>
</div>
</div>
......
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