mirror of https://github.com/gophish/gophish
Update campaign_results.min.js
parent
54781b920b
commit
2541c7190b
|
@ -198,6 +198,8 @@ function completeCampaign() {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exports campaign results as a CSV file
|
||||||
function exportAsCleanCSV(scope) {
|
function exportAsCleanCSV(scope) {
|
||||||
var csvScope = null;
|
var csvScope = null;
|
||||||
var filename = campaign.name + ' - ' + capitalize(scope) + '.csv';
|
var filename = campaign.name + ' - ' + capitalize(scope) + '.csv';
|
||||||
|
@ -289,44 +291,40 @@ function exportAsCleanCSV(scope) {
|
||||||
// exportAsCSV('events');
|
// exportAsCSV('events');
|
||||||
// exportAsCSV('cleanresults'); // Add this line to export clean results
|
// exportAsCSV('cleanresults'); // Add this line to export clean results
|
||||||
|
|
||||||
|
function exportAsCSV(scope) {
|
||||||
// Exports campaign results as a CSV file
|
exportHTML = $("#exportButton").html()
|
||||||
exportAsCSV(scope) {
|
var csvScope = null
|
||||||
exportHTML = $("#exportButton").html();
|
var filename = campaign.name + ' - ' + capitalize(scope) + '.csv'
|
||||||
var csvScope = null;
|
switch (scope) {
|
||||||
var filename = campaign.name + " - " + capitalize(scope) + ".csv";
|
case "results":
|
||||||
|
csvScope = campaign.results
|
||||||
switch (scope) {
|
break;
|
||||||
case "results":
|
case "events":
|
||||||
csvScope = campaign.results;
|
csvScope = campaign.timeline
|
||||||
break;
|
break;
|
||||||
case "events":
|
}
|
||||||
csvScope = campaign.timeline;
|
if (!csvScope) {
|
||||||
break;
|
return
|
||||||
}
|
}
|
||||||
|
$("#exportButton").html('<i class="fa fa-spinner fa-spin"></i>')
|
||||||
if (!csvScope) {
|
var csvString = Papa.unparse(csvScope, {
|
||||||
return;
|
'escapeFormulae': true
|
||||||
}
|
})
|
||||||
|
var csvData = new Blob([csvString], {
|
||||||
$("#exportButton").html('<i class="fa fa-spinner fa-spin"></i>');
|
type: 'text/csv;charset=utf-8;'
|
||||||
|
});
|
||||||
var csvString = Papa.unparse(csvScope, { escapeFormulae: true });
|
if (navigator.msSaveBlob) {
|
||||||
var csvData = new Blob([csvString], { type: "text/csv;charset=utf-8;" });
|
navigator.msSaveBlob(csvData, filename);
|
||||||
|
} else {
|
||||||
if (navigator.msSaveBlob) {
|
var csvURL = window.URL.createObjectURL(csvData);
|
||||||
navigator.msSaveBlob(csvData, filename);
|
var dlLink = document.createElement('a');
|
||||||
} else {
|
dlLink.href = csvURL;
|
||||||
var csvURL = window.URL.createObjectURL(csvData);
|
dlLink.setAttribute('download', filename)
|
||||||
var dlLink = document.createElement("a");
|
document.body.appendChild(dlLink)
|
||||||
dlLink.href = csvURL;
|
dlLink.click();
|
||||||
dlLink.setAttribute("download", filename);
|
document.body.removeChild(dlLink)
|
||||||
document.body.appendChild(dlLink);
|
}
|
||||||
dlLink.click();
|
$("#exportButton").html(exportHTML)
|
||||||
document.body.removeChild(dlLink);
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#exportButton").html(exportHTML);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function replay(event_idx) {
|
function replay(event_idx) {
|
||||||
|
|
Loading…
Reference in New Issue