Add gzip support to summary page; use passed-in list of tempest runs from django template

This commit is contained in:
Tim Buckley 2015-07-30 12:25:52 -06:00
parent 7ea9bcabec
commit 0f81e65e5f
2 changed files with 24 additions and 17 deletions

View File

@ -76,19 +76,13 @@ function createTable(data, run) {
//@param run_id: The method is passed the latest run_id so it can populate the tables moving backwards
function createTables(run_id) {
for (var i=run_id; i>=0; --i) {
//outer function so callback can use i "synchronously"
function createTables(entries) {
entries.forEach(function(entry) {
//TODO: Sort tables when inserting so they appear in correct order
!function(ii) {
d3.json("tempest_api_tree_" + i + ".json", function(error, data) {
if (error) throw error;
//create a table for the info
createTable(data, ii);
});
}(i)
}
}
d3.json(entry.url, function(error, data) {
if (error) throw error;
//create a table for the info
createTable(data, entry.run);
});
})
}

View File

@ -28,6 +28,19 @@
</div>
</div>
<script>window.addEventListener('load', createTables( {{run_id}} ));</script>
<script>
var tempest_runs = '{{tempest_runs|join:","}}'.split(",");
var urls = [];
for (var run in tempest_runs) {
var url = "tempest_api_tree_" + run + ".json";
if ("{{use_gzip}}" === "True") {
url += ".gz";
}
{% endblock %}
urls.push({ url: url, run: run });
}
window.addEventListener('load', createTables( urls ));
</script>
{% endblock %}