mirror of https://github.com/gophish/gophish
Added table for displaying submitted data.
parent
528d8525b1
commit
99da20abc0
|
@ -445,3 +445,6 @@ table.dataTable thead .sorting_desc:after {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
.timeline-event-table{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ var statuses = {
|
||||||
label: "label-default",
|
label: "label-default",
|
||||||
icon: "fa-times"
|
icon: "fa-times"
|
||||||
},
|
},
|
||||||
"Submitted Data":{
|
"Submitted Data": {
|
||||||
slice: "ct-slice-donut-clicked",
|
slice: "ct-slice-donut-clicked",
|
||||||
legend: "ct-legend-clicked",
|
legend: "ct-legend-clicked",
|
||||||
label: "label-danger",
|
label: "label-danger",
|
||||||
|
@ -83,14 +83,16 @@ function exportAsCSV(scope) {
|
||||||
exportHTML = $("#exportButton").html()
|
exportHTML = $("#exportButton").html()
|
||||||
var csvScope = null
|
var csvScope = null
|
||||||
switch (scope) {
|
switch (scope) {
|
||||||
case "results":
|
case "results":
|
||||||
csvScope = campaign.results
|
csvScope = campaign.results
|
||||||
break;
|
break;
|
||||||
case "events":
|
case "events":
|
||||||
csvScope = campaign.timeline
|
csvScope = campaign.timeline
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
if (!csvScope) {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (!csvScope){return}
|
|
||||||
$("#exportButton").html('<i class="fa fa-spinner fa-spin"></i>')
|
$("#exportButton").html('<i class="fa fa-spinner fa-spin"></i>')
|
||||||
var csvString = Papa.unparse(csvScope, {})
|
var csvString = Papa.unparse(csvScope, {})
|
||||||
var csvData = new Blob([csvString], {
|
var csvData = new Blob([csvString], {
|
||||||
|
@ -129,22 +131,24 @@ function renderTimeline(data) {
|
||||||
' <i class="fa ' + statuses[event.message].icon + '"></i></div>' +
|
' <i class="fa ' + statuses[event.message].icon + '"></i></div>' +
|
||||||
' <div class="timeline-message">' + event.message +
|
' <div class="timeline-message">' + event.message +
|
||||||
' <span class="timeline-date">' + moment(event.time).format('MMMM Do YYYY h:mm') + '</span>'
|
' <span class="timeline-date">' + moment(event.time).format('MMMM Do YYYY h:mm') + '</span>'
|
||||||
if (event.details) {
|
if (event.details) {
|
||||||
results += '<div class="timeline-event-details"><i class="fa fa-caret-right"></i> View Details</div>'
|
results += '<div class="timeline-event-details"><i class="fa fa-caret-right"></i> View Details</div>'
|
||||||
results += '<div class="timeline-event-table">'
|
results += '<div class="timeline-event-table">'
|
||||||
results += ' <table class="table table-condensed table-bordered table-striped">'
|
results += ' <table class="table table-condensed table-bordered table-striped">'
|
||||||
results += ' <thead><tr><th>Parameter</th><th>Value(s)</tr></thead><tbody>'
|
results += ' <thead><tr><th>Parameter</th><th>Value(s)</tr></thead><tbody>'
|
||||||
details = JSON.parse(event.details)
|
details = JSON.parse(event.details)
|
||||||
$.each(Object.keys(details.payload), function(i, param){
|
$.each(Object.keys(details.payload), function(i, param) {
|
||||||
if (param == "rid") { return true; }
|
if (param == "rid") {
|
||||||
results += ' <tr>'
|
return true;
|
||||||
results += ' <td>' + param + '</td>'
|
}
|
||||||
results += ' <td>' + details.payload[param] + '</td>'
|
results += ' <tr>'
|
||||||
results += ' </tr>'
|
results += ' <td>' + param + '</td>'
|
||||||
})
|
results += ' <td>' + details.payload[param] + '</td>'
|
||||||
results += ' </tbody></table>'
|
results += ' </tr>'
|
||||||
results += '</div>'
|
})
|
||||||
}
|
results += ' </tbody></table>'
|
||||||
|
results += '</div>'
|
||||||
|
}
|
||||||
results += '</div></div>'
|
results += '</div></div>'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -161,6 +165,20 @@ $(document).ready(function() {
|
||||||
$("#page-title").text("Results for " + c.name)
|
$("#page-title").text("Results for " + c.name)
|
||||||
// Setup tooltips
|
// Setup tooltips
|
||||||
$('[data-toggle="tooltip"]').tooltip()
|
$('[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
|
// Setup our graphs
|
||||||
var timeline_data = {
|
var timeline_data = {
|
||||||
series: [{
|
series: [{
|
||||||
|
|
Loading…
Reference in New Issue