mirror of https://github.com/gophish/gophish
Add Archived Campaigns View (#1367)
* Adding archived view for campaigns (#1334) * Formatted the code, did some very minor cleanup, and rebuilt the minified JS Closes #448pull/1386/head
parent
ba8ceb81da
commit
3cec2dabbf
File diff suppressed because one or more lines are too long
|
@ -334,7 +334,18 @@ $(document).ready(function () {
|
|||
$("#loading").hide()
|
||||
if (campaigns.length > 0) {
|
||||
$("#campaignTable").show()
|
||||
campaignTable = $("#campaignTable").DataTable({
|
||||
$("#campaignTableArchive").show()
|
||||
|
||||
campaignTableOriginal = $("#campaignTable").DataTable({
|
||||
columnDefs: [{
|
||||
orderable: false,
|
||||
targets: "no-sort"
|
||||
}],
|
||||
order: [
|
||||
[1, "desc"]
|
||||
]
|
||||
});
|
||||
campaignTableArchive = $("#campaignTableArchive").DataTable({
|
||||
columnDefs: [{
|
||||
orderable: false,
|
||||
targets: "no-sort"
|
||||
|
@ -344,6 +355,11 @@ $(document).ready(function () {
|
|||
]
|
||||
});
|
||||
$.each(campaigns, function (i, campaign) {
|
||||
campaignTable = campaignTableOriginal
|
||||
if (campaign.status === "Completed") {
|
||||
campaignTable = campaignTableArchive
|
||||
}
|
||||
|
||||
label = labels[campaign.status] || "label-default";
|
||||
|
||||
//section for tooltips on the status of a campaign to show some quick stats
|
||||
|
|
|
@ -12,6 +12,18 @@
|
|||
<i class="fa fa-plus"></i> New Campaign</button>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active" role="activeCampaigns"><a href="#activeCampaigns" aria-controls="activeCampaigns" role="tab"
|
||||
data-toggle="tab">Active Campaigns</a></li>
|
||||
<li role="archivedCampaigns"><a href="#archivedCampaigns" aria-controls="archivedCampaigns" role="tab"
|
||||
data-toggle="tab">Archived Campaigns</a></li>
|
||||
</ul>
|
||||
</br>
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="activeCampaigns">
|
||||
<div id="flashes" class="row"></div>
|
||||
|
||||
<div id="loading">
|
||||
<i class="fa fa-spinner fa-spin fa-4x"></i>
|
||||
</div>
|
||||
|
@ -35,6 +47,31 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane" id="archivedCampaigns">
|
||||
</br>
|
||||
<div id="emptyMessage" class="row" style="display:none;">
|
||||
</br>
|
||||
<div class="alert alert-info">
|
||||
No archived campaigns.
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<table id="campaignTableArchive" class="table" style="display:none;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">Name</th>
|
||||
<th class="col-md-4">Created Date</th>
|
||||
<th class="col-md-2">Status</th>
|
||||
<th class="col-md-3 no-sort"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
|
|
Loading…
Reference in New Issue