Commit 329753a5 authored by Leigh Stoller's avatar Leigh Stoller

Fix up the dates, I just noticed they are displaying in the Mountain

zone, not the local time zone.
parent 6878cecf
<?php
#
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -117,7 +117,7 @@ function Do_GetStats()
$creator = $row["creator"];
$creator_idx = $row["creator_idx"];
$pcount = $row["physnode_count"];
$created = $row["created"];
$created = DateStringGMT($row["created"]);
$profile_uuid = $row["profile_uuid"];
$profile_name = $row["profile_name"];
$aggregate_urn= $row["aggregate_urn"];
......@@ -230,7 +230,7 @@ function Do_GetStats()
$logfileid = $row["logfileid"];
$active = $row["active"] ? 1 : 0;
$uuid = $row["uuid"];
$created = $row["created"];
$created = DateStringGMT($row["created"]);
$creator = $row["creator"];
$message = $row["exitmessage"];
$reason = $exitcode;
......@@ -310,8 +310,8 @@ function Do_GetStats()
$name = $row["name"];
$uuid = $row["uuid"];
$pid = $row["pid"];
$expires = $row["expires"];
$created = $row["created"];
$expires = DateStringGMT($row["expires"]);
$created = DateStringGMT($row["created"]);
$creator = $row["creator"];
$extension_details[$uuid] = array("name" => $name,
......@@ -322,7 +322,52 @@ function Do_GetStats()
"expires" => $expires);
}
$dashboard["extension_requests"] = $extension_details;
#
# List of all locked down experiments.
#
$lockdown = array();
$query_result =
DBQueryFatal("select i.name,i.uuid,i.creator,i.creator_idx,".
" i.physnode_count,i.created,i.aggregate_urn,s.expires, ".
" p.uuid as profile_uuid,p.name as profile_name ".
"from apt_instances as i ".
"left join apt_profiles as p on ".
" p.profileid=i.profile_id ".
"left join geni.geni_slices as s on ".
" s.uuid=i.slice_uuid ".
"where i.admin_lockdown!=0 ".
"order by created desc");
while ($row = mysql_fetch_array($query_result)) {
$name = $row["name"];
$uuid = $row["uuid"];
$creator = $row["creator"];
$creator_idx = $row["creator_idx"];
$pcount = $row["physnode_count"];
$created = DateStringGMT($row["created"]);
$expires = DateStringGMT($row["expires"]);
$profile_uuid = $row["profile_uuid"];
$profile_name = $row["profile_name"];
$aggregate_urn= $row["aggregate_urn"];
$cluster = "N/A";
if ($aggregate_urn && $aggregate_urn != "") {
$cluster = $urn_mapping[$aggregate_urn];
}
$lockdown[$uuid] = array("uuid" => $uuid,
"name" => $name,
"creator_idx" => $creator_idx,
"creator" => $creator,
"physnode_count" => $pcount,
"created" => $created,
"expires" => $expires,
"cluster" => $cluster,
"profile_uuid" => $profile_uuid,
"profile_name" => $profile_name);
}
$dashboard["lockdown"] = $lockdown;
SPITAJAX_RESPONSE($dashboard);
}
......
......@@ -45,6 +45,19 @@ function (_, sup, moment, dashboardString)
.format("MMM D h:mm A"));
}
});
$('.format-date-month').each(function() {
var date = $.trim($(this).html());
if (date != "") {
$(this).html(moment($(this).html())
.format("ll"));
}
});
$('.format-date-relative').each(function() {
var date = $.trim($(this).html());
if (date != "") {
$(this).html(moment($(this).html()).fromNow());
}
});
$('[data-toggle="popover"]').popover({
trigger: 'hover',
placement: 'auto',
......@@ -65,7 +78,7 @@ function (_, sup, moment, dashboardString)
function UpdateTimes()
{
$('.format-date-relative').each(function() {
$('.format-date-last-refresh').each(function() {
var date = $(this).data("time");
if (date != "") {
$(this).html(moment(date).fromNow());
......
......@@ -302,8 +302,53 @@
</div>
</div>
</div>
<div class='row'>
<div class='col-sm-10 col-sm-offset-1'>
<div class='panel panel-default' id='experiments-lockdown-panel'>
<div class="panel-heading">
<h5><center>Locked Down Experiments</center></h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class="table table-condensed table-bordered table-dashboard"
id='experiments-lockdown-table'>
<thead>
<tr>
<th>Name</th>
<th>Creator</th>
<th>Profile</th>
<th>Cluster</th>
<th>PCs</th>
<th>Created</th>
<th>Expires</th>
</tr>
</thead>
<tbody>
<% _.each(dashboard.lockdown, function(value, key) { %>
<tr>
<td><a href="status.php?uuid=<%- value.uuid %>">
<%- value.name %></a></td>
<% if (!isadmin) { %>
<td><%- value.creator %></td>
<% } %>
<% if (isadmin) { %>
<td><a href="https://www.emulab.net/showuser.php3?user=<%- value.creator_idx %>"><%- value.creator %></a></td>
<% } %>
<td><a href="show-profile.php?uuid=<%- value.profile_uuid %>">
<%- value.profile_name %></a></td>
<td><%- value.cluster %></td>
<td><%- value.physnode_count %></td>
<td class="format-date-month"><%- value.created %></td>
<td class="format-date-relative"><%- value.expires %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='row'>
<div class="col-xs-4">
Last updated: <span class="format-date-relative" id="last-refresh"></span>
Last updated: <span class="format-date-last-refresh" id="last-refresh"></span>
</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