mirror of https://github.com/gophish/gophish
parent
6acbac26f5
commit
3bbd6b7ca1
|
@ -22,6 +22,7 @@ var Logger = log.New(os.Stdout, " ", log.Ldate|log.Ltime|log.Lshortfile)
|
||||||
const (
|
const (
|
||||||
CAMPAIGN_IN_PROGRESS string = "In progress"
|
CAMPAIGN_IN_PROGRESS string = "In progress"
|
||||||
CAMPAIGN_QUEUED string = "Queued"
|
CAMPAIGN_QUEUED string = "Queued"
|
||||||
|
CAMPAIGN_EMAILS_SENT string = "Emails Sent"
|
||||||
CAMPAIGN_COMPLETE string = "Completed"
|
CAMPAIGN_COMPLETE string = "Completed"
|
||||||
EVENT_SENT string = "Email Sent"
|
EVENT_SENT string = "Email Sent"
|
||||||
EVENT_OPENED string = "Email Opened"
|
EVENT_OPENED string = "Email Opened"
|
||||||
|
|
|
@ -26,6 +26,11 @@ var statuses = {
|
||||||
slice: "ct-slice-donut-error",
|
slice: "ct-slice-donut-error",
|
||||||
legend: "ct-legend-error",
|
legend: "ct-legend-error",
|
||||||
label: "label-default"
|
label: "label-default"
|
||||||
|
},
|
||||||
|
"Unknown" : {
|
||||||
|
slice: "ct-slice-donut-error",
|
||||||
|
legend: "ct-legend-error",
|
||||||
|
label: "label-default"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ var labels = {
|
||||||
"In progress" : "label-primary",
|
"In progress" : "label-primary",
|
||||||
"Queued" : "label-info",
|
"Queued" : "label-info",
|
||||||
"Completed" : "label-success",
|
"Completed" : "label-success",
|
||||||
|
"Emails Sent" : "label-success",
|
||||||
"Error" : "label-danger"
|
"Error" : "label-danger"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
var campaigns = []
|
var campaigns = []
|
||||||
|
// labels is a map of campaign statuses to
|
||||||
|
// CSS classes
|
||||||
|
var labels = {
|
||||||
|
"In progress" : "label-primary",
|
||||||
|
"Queued" : "label-info",
|
||||||
|
"Completed" : "label-success",
|
||||||
|
"Emails Sent" : "label-success",
|
||||||
|
"Error" : "label-danger"
|
||||||
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
api.campaigns.get()
|
api.campaigns.get()
|
||||||
|
@ -27,11 +36,12 @@ $(document).ready(function(){
|
||||||
campaignTable = $("#campaignTable").DataTable();
|
campaignTable = $("#campaignTable").DataTable();
|
||||||
$.each(campaigns, function(i, campaign){
|
$.each(campaigns, function(i, campaign){
|
||||||
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY h:mm')
|
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY h:mm')
|
||||||
|
var label = labels[campaign.status] || "label-default";
|
||||||
// Add it to the table
|
// Add it to the table
|
||||||
campaignTable.row.add([
|
campaignTable.row.add([
|
||||||
campaign.name,
|
campaign.name,
|
||||||
campaign_date,
|
campaign_date,
|
||||||
campaign.status,
|
"<span class=\"label " + label + "\">" + campaign.status + "</span>",
|
||||||
"<div class='pull-right'><a class='btn btn-primary' href='/campaigns/" + campaign.id + "'>\
|
"<div class='pull-right'><a class='btn btn-primary' href='/campaigns/" + campaign.id + "'>\
|
||||||
<i class='fa fa-bar-chart'></i>\
|
<i class='fa fa-bar-chart'></i>\
|
||||||
</a>\
|
</a>\
|
||||||
|
@ -91,7 +101,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
$chart.on('mouseenter', '.ct-point', function() {
|
$chart.on('mouseenter', '.ct-point', function() {
|
||||||
var $point = $(this)
|
var $point = $(this)
|
||||||
value = $point.attr('ct:value')
|
value = $point.attr('ct:value') || 0
|
||||||
cidx = $point.attr('ct:meta')
|
cidx = $point.attr('ct:meta')
|
||||||
$toolTip.html(campaigns[cidx].name + '<br>' + "Successes: " + value.toString() + "%").show();
|
$toolTip.html(campaigns[cidx].name + '<br>' + "Successes: " + value.toString() + "%").show();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue