Skip to content

Commit

Permalink
#4 finalizing the ssytem grouping in reports and listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale Bingham authored and Dale Bingham committed Feb 23, 2019
1 parent 5674e2d commit e413f94
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 24 deletions.
1 change: 0 additions & 1 deletion buildDockerImage.sh

This file was deleted.

28 changes: 24 additions & 4 deletions charts.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ <h5><small>Help and Support</small></h5>
<a href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a class="active" href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand All @@ -122,7 +122,7 @@ <h5><small>Help and Support</small></h5>
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container-fluid">
<div class="container-fluid">
<div class="row">
<div class="col-xl-12">
<div class="breadcrumb-holder">
Expand All @@ -136,7 +136,26 @@ <h1 class="main-title float-left">Reports</h1>
</div>
</div>
<!-- end row -->

<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="card mb-3">
<div class="card-header">
<h3><i class="fa fa-filter"></i> Filters</h3>
</div>
<div class="card-body">
<div class="checklistSystemsList">
<form class="form-inline">
<label class="checklistSystemsListLabel" id="checklistSystemsListLabel" for="checklistSystemFilter">System Filter</label>
<select class="form-control" id="checklistSystemFilter" onchange="getReportsBySystem();">
<option value="All">All</option>
</select>
</form>
</div>
</div><!-- end card body -->
</div><!-- end card-->
</div>
</div><!-- end row-->

<div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
<div class="card mb-3">
Expand Down Expand Up @@ -225,6 +244,7 @@ <h1 class="main-title float-left">Reports</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>

<script>
getChecklistSystemsForReportFilter();
getChecklistTypeBreakdown();
// });
</script>
Expand Down
4 changes: 2 additions & 2 deletions checklists.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ <h5><small>Help and Support</small></h5>
<a href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a class="active" href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a class="active" href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ <h5><small>Help and Support</small></h5>
<a class="active" href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand Down
25 changes: 21 additions & 4 deletions js/openstig.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function updateSingleChecklist(id) {
formData.append("type",$("#frmChecklistType").val());
formData.append("title",$("#frmChecklistTitle").val());
formData.append("description",$("#frmChecklistDescription").val());
if (frmChecklistSystemText.val().trim().length > 0)
if ($("#frmChecklistSystemText").val().trim().length > 0)
formData.append("system",$("#frmChecklistSystemText").val());
else
formData.append("system",$("#frmChecklistSystem").val());
Expand Down Expand Up @@ -575,9 +575,12 @@ function viewVulnDetails(vulnId) {
/************************************
* Reports Functions
***********************************/
// export with myLineChart.toBase64Image();
async function getChecklistTypeBreakdown() {
let response = await fetch(readAPI + "/counttype");
async function getChecklistTypeBreakdown(system) {
var url = readAPI + "/counttype";
// if they pass in the system use it after encoding it
if (system && system.length > 0 && system != "All")
url += "?system=" + encodeURIComponent(system);
let response = await fetch(url);
if (response.ok) {
var data = await response.json()
var ctx3 = document.getElementById("chartChecklistTypeBreakdown").getContext('2d');
Expand Down Expand Up @@ -614,7 +617,21 @@ async function getChecklistTypeBreakdown() {
chartSeverity.update();
}
}
// the system dropdown on the Reports page
async function getChecklistSystemsForReportFilter() {
var data = await getChecklistSystems();
// for each data add to the upload checklistSystem
$.each(data, function (index, value) {
$('#checklistSystemFilter').append($('<option/>', {
value: value,
text : value
}));
});

}
async function getReportsBySystem() {
await getChecklistTypeBreakdown($("#checklistSystemFilter").val());
}
/************************************
Generic Functions
************************************/
Expand Down
8 changes: 4 additions & 4 deletions single-checklist.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ <h5><small>Help and Support</small></h5>
<a href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a class="active" href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a class="active" href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand Down Expand Up @@ -174,7 +174,7 @@ <h3 id="checklistTitle" class="float-left"> </h3>
</div>
</div><!-- end row-->
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-2 col-lg-2 col-xl-2">
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-2 col-xl-2">
<div class="card mb-3">
<div class="card-header">
<h3><i class="fa fa-folder-open-o"></i> Vuln Ids</h3>
Expand All @@ -185,7 +185,7 @@ <h3><i class="fa fa-folder-open-o"></i> Vuln Ids</h3>
</div>
</div>
</div><!-- end card-->
<div class="col-xs-12 col-sm-12 col-md-10 col-lg-10 col-xl-10">
<div class="col-xs-12 col-sm-12 col-md-8 col-lg-10 col-xl-10">
<div class="card mb-3">
<div class="card-header">
<h3><i class="fa fa-folder-open-o"></i> Vulnerability Details</h3>
Expand Down
4 changes: 2 additions & 2 deletions single-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ <h5><small>Help and Support</small></h5>
<a href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a class="active" href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a class="active" href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand Down
6 changes: 3 additions & 3 deletions templates.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ <h5><small>Help and Support</small></h5>
<a href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a class="active" href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a class="active" href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand Down Expand Up @@ -140,7 +140,7 @@ <h1 class="main-title float-left">Templates</h1>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="card mb-3">
<div class="card-header">
<h3><i class="fa fa-table"></i> My Templates (starting point for Checklists)</h3>
<h3><i class="fa fa-list"></i> My Templates (starting point for Checklists)</h3>
</div>
<div class="card-body">
<div id="tblChecklistListing"></div>
Expand Down
4 changes: 2 additions & 2 deletions upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ <h5><small>Help and Support</small></h5>
<a href="index.html"><i class="fa fa-fw fa-dashboard"></i><span> Dashboard </span> </a>
</li>
<li class="submenu">
<a href="checklists.html"><i class="fa fa-fw fa-bars"></i><span> Checklists </span> </a>
<a href="checklists.html"><i class="fa fa-fw fa-table"></i><span> Checklists </span> </a>
</li>
<li class="submenu">
<a href="templates.html"><i class="fa fa-fw fa-bars"></i><span> Templates </span> </a>
<a href="templates.html"><i class="fa fa-fw fa-list"></i><span> Templates </span> </a>
</li>
<li class="submenu">
<a href="charts.html"><i class="fa fa-fw fa-area-chart"></i><span> Reports </span> </a>
Expand Down

0 comments on commit e413f94

Please sign in to comment.