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()
|
$("#loading").hide()
|
||||||
if (campaigns.length > 0) {
|
if (campaigns.length > 0) {
|
||||||
$("#campaignTable").show()
|
$("#campaignTable").show()
|
||||||
campaignTable = $("#campaignTable").DataTable({
|
$("#campaignTableArchive").show()
|
||||||
|
|
||||||
|
campaignTableOriginal = $("#campaignTable").DataTable({
|
||||||
|
columnDefs: [{
|
||||||
|
orderable: false,
|
||||||
|
targets: "no-sort"
|
||||||
|
}],
|
||||||
|
order: [
|
||||||
|
[1, "desc"]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
campaignTableArchive = $("#campaignTableArchive").DataTable({
|
||||||
columnDefs: [{
|
columnDefs: [{
|
||||||
orderable: false,
|
orderable: false,
|
||||||
targets: "no-sort"
|
targets: "no-sort"
|
||||||
|
@ -344,6 +355,11 @@ $(document).ready(function () {
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
$.each(campaigns, function (i, campaign) {
|
$.each(campaigns, function (i, campaign) {
|
||||||
|
campaignTable = campaignTableOriginal
|
||||||
|
if (campaign.status === "Completed") {
|
||||||
|
campaignTable = campaignTableArchive
|
||||||
|
}
|
||||||
|
|
||||||
label = labels[campaign.status] || "label-default";
|
label = labels[campaign.status] || "label-default";
|
||||||
|
|
||||||
//section for tooltips on the status of a campaign to show some quick stats
|
//section for tooltips on the status of a campaign to show some quick stats
|
||||||
|
|
|
@ -12,27 +12,64 @@
|
||||||
<i class="fa fa-plus"></i> New Campaign</button>
|
<i class="fa fa-plus"></i> New Campaign</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="loading">
|
|
||||||
<i class="fa fa-spinner fa-spin fa-4x"></i>
|
<ul class="nav nav-tabs" role="tablist">
|
||||||
</div>
|
<li class="active" role="activeCampaigns"><a href="#activeCampaigns" aria-controls="activeCampaigns" role="tab"
|
||||||
<div id="emptyMessage" class="row" style="display:none;">
|
data-toggle="tab">Active Campaigns</a></li>
|
||||||
<div class="alert alert-info">
|
<li role="archivedCampaigns"><a href="#archivedCampaigns" aria-controls="archivedCampaigns" role="tab"
|
||||||
No campaigns created yet. Let's create one!
|
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>
|
||||||
|
<div id="emptyMessage" class="row" style="display:none;">
|
||||||
|
<div class="alert alert-info">
|
||||||
|
No campaigns created yet. Let's create one!
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<table id="campaignTable" 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 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>
|
|
||||||
<div class="row">
|
|
||||||
<table id="campaignTable" 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 -->
|
<!-- Modal -->
|
||||||
|
|
Loading…
Reference in New Issue