Added logging output to sunburst
This commit is contained in:
parent
e216d42597
commit
923b153b63
|
@ -1,9 +1,65 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var originalDetailsContent = null;
|
||||
|
||||
function addDialogButton(parentID) {
|
||||
var detailsCache = null;
|
||||
var detailsInProgress = false;
|
||||
var detailsWaiting = [];
|
||||
var runId = null;
|
||||
|
||||
var loadDetails = function(callback) {
|
||||
if (detailsCache === null) {
|
||||
detailsWaiting.push(callback);
|
||||
|
||||
if (!detailsInProgress) {
|
||||
var url = "tempest_api_details_" + runId + ".json";
|
||||
if ("{{use_gzip}}" === "True") {
|
||||
url += ".gz";
|
||||
}
|
||||
|
||||
detailsInProgress = true;
|
||||
|
||||
d3.json(url, function(error, data) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
detailsCache = data;
|
||||
detailsWaiting.forEach(function(cb) {
|
||||
cb(detailsCache);
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
callback(detailsCache);
|
||||
}
|
||||
};
|
||||
|
||||
var showDetails = function(item) {
|
||||
var parent = $("#details-dialog");
|
||||
|
||||
loadDetails(function(details) {
|
||||
if (!details.hasOwnProperty(item.name_full)) {
|
||||
console.log("Details not found for item:", item.name_full);
|
||||
return;
|
||||
}
|
||||
|
||||
if (originalDetailsContent === null) {
|
||||
originalDetailsContent = parent.html();
|
||||
}
|
||||
|
||||
parent.empty();
|
||||
for (var prop in details[item.name_full]) {
|
||||
$("<h3>").text(prop).appendTo(parent);
|
||||
$("<pre>").text(details[item.name_full][prop]).appendTo(parent);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function addDialogButton(parentID, run_id) {
|
||||
//parentID: A string contiaining the parent div id to which the button will be appended
|
||||
runId=run_id;
|
||||
var button = $('<button/>',
|
||||
{
|
||||
text: 'View Log',
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var runId = null;
|
||||
|
||||
function populateTable(d, textColor) {
|
||||
var oldtbl = document.getElementById("result-table-div");
|
||||
oldtbl.innerHTML = "";
|
||||
|
@ -34,6 +36,8 @@ function populateTable(d, textColor) {
|
|||
}
|
||||
document.getElementById("result-table-div").appendChild(tbl);
|
||||
document.getElementById("table-heading").innerHTML=d.name;
|
||||
addDialogButton("#result-table-div",runId);
|
||||
showDetails(d);
|
||||
}
|
||||
else {
|
||||
for (var j in d.children) {
|
||||
|
@ -100,7 +104,8 @@ function displayFailingTests(d) {
|
|||
}
|
||||
|
||||
|
||||
function createSunburst(url) {
|
||||
function createSunburst(url, run_id) {
|
||||
runId = run_id;
|
||||
|
||||
var width = 700,
|
||||
height = 500,
|
|
@ -6,11 +6,15 @@
|
|||
|
||||
{% block head-extra %}
|
||||
<!-- Scripts for visualization-->
|
||||
<script src="{% static 'js/visuals.js' %}"></script>
|
||||
<script src="{% static 'js/sunburst.js' %}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div id="details-dialog" title="Details Output">
|
||||
<p>This is some details output.</p>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">Results from Run #{{run_id}}</h1>
|
||||
|
@ -68,14 +72,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
$("#details-dialog").hide();
|
||||
var url = "tempest_api_tree_{{run_id}}.json";
|
||||
if ("{{use_gzip}}" === "True") {
|
||||
url += ".gz";
|
||||
}
|
||||
|
||||
createSunburst( url );
|
||||
createSunburst( url, {{run_id}} );
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
|
|
|
@ -70,20 +70,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-file-text fa-fw"></i> Log Output
|
||||
</div>
|
||||
|
||||
<div id="timeline-details" class="panel-body">
|
||||
<em>Click an item to view log details.</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="{% static 'js/timeline.js' %}"></script>
|
||||
<script>
|
||||
var originalInfoContent = null;
|
||||
|
|
Loading…
Reference in New Issue