mirror of https://github.com/gophish/gophish
Added datatables sorting for dashboard campaigns. Fixes #166. Also formatting fixes.
parent
3798896042
commit
77e38b6c72
|
@ -14,7 +14,7 @@ function deleteCampaign(idx) {
|
||||||
api.campaignId.delete(campaigns[idx].id)
|
api.campaignId.delete(campaigns[idx].id)
|
||||||
.success(function(data) {
|
.success(function(data) {
|
||||||
successFlash(data.message)
|
successFlash(data.message)
|
||||||
location.reload()
|
location.reload()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,12 +51,13 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
var average = 0
|
var average = 0
|
||||||
campaignTable = $("#campaignTable").DataTable({
|
campaignTable = $("#campaignTable").DataTable({
|
||||||
columnDefs: [
|
columnDefs: [{
|
||||||
{ orderable: false, targets: "no-sort" }
|
orderable: false,
|
||||||
]
|
targets: "no-sort"
|
||||||
});
|
}]
|
||||||
|
});
|
||||||
$.each(campaigns, function(i, campaign) {
|
$.each(campaigns, function(i, campaign) {
|
||||||
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY h:mm:ss a')
|
var campaign_date = moment(campaign.created_date).format('MMMM Do YYYY, h:mm:ss a')
|
||||||
var label = labels[campaign.status] || "label-default";
|
var label = labels[campaign.status] || "label-default";
|
||||||
// Add it to the table
|
// Add it to the table
|
||||||
campaignTable.row.add([
|
campaignTable.row.add([
|
||||||
|
|
Loading…
Reference in New Issue