Commit 251f3d0c authored by Leigh B Stoller's avatar Leigh B Stoller

Add cluster and profile to recent errors and recent experiments.

Shrunk the padding and font to try and get things to fit better.
parent e468be6f
......@@ -39,7 +39,7 @@ $scales = array("Day" => (24 * 3600),
#
function Do_GetStats()
{
global $scales, $geni_response_codes;
global $scales, $geni_response_codes, $urn_mapping;
$started = array();
$errors = array();
......@@ -99,9 +99,12 @@ function Do_GetStats()
$latest = array();
$query_result =
DBQueryFatal("select name,uuid,creator,creator_idx,".
" physnode_count,created ".
"from apt_instances ".
DBQueryFatal("select i.name,i.uuid,i.creator,i.creator_idx,".
" i.physnode_count,i.created,i.aggregate_urn, ".
" 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 ".
"order by created desc limit 5");
while ($row = mysql_fetch_array($query_result)) {
$name = $row["name"];
......@@ -110,12 +113,23 @@ function Do_GetStats()
$creator_idx = $row["creator_idx"];
$pcount = $row["physnode_count"];
$created = $row["created"];
$profile_uuid = $row["profile_uuid"];
$profile_name = $row["profile_name"];
$aggregate_urn= $row["aggregate_urn"];
$cluster = "N/A";
$latest[$name] = array("uuid" => $uuid,
if ($aggregate_urn && $aggregate_urn != "") {
$cluster = $urn_mapping[$aggregate_urn];
}
$latest[$uuid] = array("uuid" => $uuid,
"name" => $name,
"creator_idx" => $creator_idx,
"creator" => $creator,
"physnode_count" => $pcount,
"created" => $created);
"created" => $created,
"cluster" => $cluster,
"profile_uuid" => $profile_uuid,
"profile_name" => $profile_name);
}
$dashboard["latest"] = $latest;
......@@ -190,12 +204,16 @@ function Do_GetStats()
$query_result =
DBQueryFatal("select f.name,exitcode,f.created,f.public_url,f.uuid,".
" IF(i.uuid,1,0) as active,f.exitmessage ".
" IF(i.uuid,1,0) as active,f.exitmessage, ".
" p.uuid as profile_uuid,p.name as profile_name, ".
" h.aggregate_urn ".
"from apt_instance_failures as f ".
"left join apt_instances as i on ".
" i.uuid=f.uuid ".
"left join apt_instance_history as h on ".
" h.uuid=f.uuid ".
"left join apt_profiles as p on ".
" p.profileid=f.profile_id ".
"order by f.created desc limit 10");
while ($row = mysql_fetch_array($query_result)) {
......@@ -207,10 +225,17 @@ function Do_GetStats()
$created = $row["created"];
$message = $row["exitmessage"];
$reason = $exitcode;
$profile_uuid = $row["profile_uuid"];
$profile_name = $row["profile_name"];
$aggregate_urn= $row["aggregate_urn"];
$cluster = "N/A";
if ($exitcode >= 0 && $exitcode <= count($geni_response_codes)) {
$reason = $geni_response_codes[$exitcode];
}
if ($aggregate_urn && $aggregate_urn != "") {
$cluster = $urn_mapping[$aggregate_urn];
}
$error_details[$uuid] = array("name" => $name,
"uuid" => $uuid,
"exitcode" => $exitcode,
......@@ -218,7 +243,11 @@ function Do_GetStats()
"created" => $created,
"reason" => $reason,
"message" => $message,
"url" => $url);
"url" => $url,
"cluster" => $cluster,
"profile_uuid" => $profile_uuid,
"profile_name" => $profile_name);
}
$dashboard["error_details"] = $error_details;
......
<style>
.panel {
font-size: 80%;
}
.panel-body-dashboard {
padding: 5px;
padding: 2px;
}
.table-dashboard {
margin: 1px;
......@@ -8,9 +11,20 @@
.popover{
max-width: 800px;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 2px;
}
.panel-heading {
padding: 5px;
}
</style>
<div class='row'>
<div class='col-sm-6'>
<div class='col-sm-5'>
<div class='panel panel-default' id='experiments-started-panel'>
<div class="panel-heading">
<h5><center>Experiment Activity</center></h5>
......@@ -62,7 +76,7 @@
</div>
</div>
</div>
<div class='col-sm-6'>
<div class='col-sm-7'>
<div class='panel panel-default' id='experiments-latest-panel'>
<div class="panel-heading">
<h5><center>Latest Experiments</center></h5>
......@@ -74,7 +88,9 @@
<tr>
<th>Name</th>
<th>Creator</th>
<th>Nodes</th>
<th>Profile</th>
<th>Cluster</th>
<th>PCs</th>
<th>Created</th>
</tr>
</thead>
......@@ -82,14 +98,17 @@
<% _.each(dashboard.latest, function(value, key) { %>
<tr>
<% if (!isadmin) { %>
<td><%- key %></td>
<td><%- value.name %></td>
<td><%- value.creator %></td>
<% } %>
<% if (isadmin) { %>
<td><a href="status.php?uuid=<%- value.uuid %>">
<%- key %></a></td>
<%- value.name %></a></td>
<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"><%- value.created %></td>
</tr>
......@@ -107,7 +126,7 @@
<h5><center>Heaviest Users (Current)</center></h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class="table table-condensed table-bordered"
<table class="table table-condensed table-bordered table-dashboard"
id='experiments-latest-table'>
<thead>
<tr>
......@@ -140,7 +159,7 @@
<h5><center>Heaviest Projects (Current)</center></h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class="table table-condensed table-bordered"
<table class="table table-condensed table-bordered table-dashboard"
id='experiments-latest-table'>
<thead>
<tr>
......@@ -173,7 +192,7 @@
<h5><center>Popular Profiles (Epoch)</center></h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class="table table-condensed table-bordered">
<table class="table table-condensed table-bordered table-dashboard">
<thead>
<tr>
<th>Name</th>
......@@ -195,17 +214,19 @@
</div>
</div>
<div class='row'>
<div class='col-sm-8 col-sm-offset-2'>
<div class='col-sm-10 col-sm-offset-1'>
<div class='panel panel-default' id='error-details-panel'>
<div class="panel-heading">
<h5><center>Recent Errors (Details)</center></h5>
</div>
<div class='panel-body panel-body-dashboard'>
<table class="table table-condensed table-bordered">
<table class="table table-condensed table-bordered table-dashboard">
<thead>
<tr>
<th>Name</th>
<th>When</th>
<th>Profile</th>
<th>Cluster</th>
<th>Reason (Code)</th>
<th>Log</th>
</tr>
......@@ -220,6 +241,9 @@
<td><%- value.name %></td>
<% } %>
<td class="format-date"><%- value.created %></td>
<td><a href="show-profile.php?uuid=<%- value.profile_uuid %>">
<%- value.profile_name %></a></td>
<td><%- value.cluster %></td>
<% if (value.message && value.message != "") { %>
<td><span style="text-decoration: underline;"
data-toggle='popover'
......
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