Added table for displaying submitted data.

pull/123/head
Jordan Wright 2016-02-02 22:49:30 -06:00
parent 528d8525b1
commit 99da20abc0
2 changed files with 45 additions and 24 deletions

3
static/css/main.css vendored
View File

@ -445,3 +445,6 @@ table.dataTable thead .sorting_desc:after {
margin-top: 10px;
margin-bottom: 10px;
}
.timeline-event-table{
display:none;
}

View File

@ -90,7 +90,9 @@ function exportAsCSV(scope) {
csvScope = campaign.timeline
break;
}
if (!csvScope){return}
if (!csvScope) {
return
}
$("#exportButton").html('<i class="fa fa-spinner fa-spin"></i>')
var csvString = Papa.unparse(csvScope, {})
var csvData = new Blob([csvString], {
@ -136,7 +138,9 @@ function renderTimeline(data) {
results += ' <thead><tr><th>Parameter</th><th>Value(s)</tr></thead><tbody>'
details = JSON.parse(event.details)
$.each(Object.keys(details.payload), function(i, param) {
if (param == "rid") { return true; }
if (param == "rid") {
return true;
}
results += ' <tr>'
results += ' <td>' + param + '</td>'
results += ' <td>' + details.payload[param] + '</td>'
@ -161,6 +165,20 @@ $(document).ready(function() {
$("#page-title").text("Results for " + c.name)
// Setup tooltips
$('[data-toggle="tooltip"]').tooltip()
// Setup viewing the details of a result
$("#resultsTable").on("click", ".timeline-event-details", function() {
// Show the parameters
payloadTable = $(this).parent().find(".timeline-event-table")
if (payloadTable.is(":visible")) {
$(this).find("i").removeClass("fa-caret-down")
$(this).find("i").addClass("fa-caret-right")
payloadTable.hide()
} else {
$(this).find("i").removeClass("fa-caret-right")
$(this).find("i").addClass("fa-caret-down")
payloadTable.show()
}
})
// Setup our graphs
var timeline_data = {
series: [{