Skip to content
This repository was archived by the owner on Aug 31, 2019. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"d3-request": "^1.0.6",
"datatables.net": "^1.10.19",
"file-saver": "^2.0.1",
"inspecjs": "0.0.1",
"js-xlsx": "^0.8.22",
"reprism": "0.0.11",
"v-file-upload": "^3.1.3",
Expand All @@ -33,6 +34,7 @@
"vue-cli": "^2.9.6",
"vue-router": "^3.0.1",
"vuetable-2": "^2.0.0-beta.4",
"vuex": "^3.1.1",
"xlsx": "^0.14.2"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ComplianceChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
updated: function () {
var reload_data = {
unload: true,
columns: store.getCompliance()
columns: [["Data", store.getCompliance()]]
};
this.handler.$emit('dispatch', (chart) => chart.load(reload_data));
},
Expand All @@ -50,7 +50,7 @@
// to init the graph call:
const options = {
data: {
columns: this.activeCompliance,
columns: [["Data", this.activeCompliance]],
type : 'gauge',
},
color: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ControlImpact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
return store.getBindValue();
},
activeImpact: function () {
return store.getImpact();
return store.getSeverityCount();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we are able to load multiple 'evaluations' aka profiles - will we need to add both singular and plural interfaces at some point?

}
},
updated: function () {
var reload_data = {
unload: true,
columns: store.getImpact()
columns: store.getSeverityCount()
};
this.handler.$emit('dispatch', (chart) => chart.load(reload_data));
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/ControlStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
return store.getBindValue();
},
activeStatus: function () {
return store.getStatus();
return store.getStatusCount();
}
},

updated: function () {
var reload_data = {
unload: true,
columns: store.getStatus()
columns: store.getStatusCount()
};
this.handler.$emit('dispatch', (chart) => chart.load(reload_data));
},
Expand Down
9 changes: 1 addition & 8 deletions src/components/CountCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@
return store.getBindValue();
},
count: function () {
var status = store.getStatus();
var val = 0;
for (var i = 0; i < status.length; i++) {
if (status[i][0] == this.title) {
val = status[i][1];
}
}
return val;
return store.getStatusHash()[this.title] || 0;
}
},

Expand Down
11 changes: 5 additions & 6 deletions src/components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,12 @@ export default {
},
getControls: function () {
if (isMounted == true) {
var val = store.getControls();
var controls = store.getFilteredNistControls();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My brain says a function signature like getControlsBy('nist') would be the more general type of interface.

let vm = this;
// Here's the magic to keeping the DataTable in sync.
// It must be cleared, new rows added, then redrawn!
vm.dtHandle.clear();
val.forEach(function (item) {
vm.dtHandle.rows.add($(helpers.rowHtml(item))).draw();
});
controls.forEach(control => vm.dtHandle.rows.add($(helpers.rowHtml(item))).draw());

vm.dtHandle.draw();
}
Expand All @@ -108,7 +106,7 @@ export default {
},
mounted() {
let vm = this;
var val = store.getControls();
var val = store.getFilteredNistControls();
vm.rows = [];
// You should _probably_ check that this is changed data... but we'll skip that for this example.

Expand Down Expand Up @@ -146,7 +144,8 @@ export default {
}
else {
tr.addClass( 'details' );
row.child( helpers.detailsPanel( store.getControl(td.innerHTML) ) ).show();
var control_uid = tr.attr("unique_id");//
row.child( helpers.detailsPanel( store.getControlByUniqueID(control_uid) ) ).show();

// Add to the 'open' array
if ( idx === -1 ) {
Expand Down
1 change: 1 addition & 0 deletions src/components/FileReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
store.reset()
store.setTitle(file.name);
store.parseFile(text, file.name);
store.setShowing("Results");
};
reader.readAsText(file);
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/NavHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default {
},
computed: {
showCaat() {
return store.state.title != ""
return store.getTitle() != ""
}
},
methods: {
Expand All @@ -54,20 +54,20 @@ export default {
return 0;
},
showAbout: function() {
store.state.showing = 'About';
store.setShowing('About');
},
showResults: function() {
store.state.showing = 'Results';
store.setShowing('Results');
},
showSSP: function() {
store.state.showing = 'SSP';
store.setShowing('SSP');
},
exportCaat: function (event) {
event.preventDefault();

var caat = [];
var vulnList = [];
var controls = store.getControls()
var controls = store.getFilteredNistControls()
for (var ind in controls) {
var control = controls[ind];
var field = [];
Expand Down
12 changes: 3 additions & 9 deletions src/components/SspContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
data () {
return {
expand: true,
status: store.getStatus(),
status: store.getStatusHash(),
families: store.getFilteredFamilies(),
store,
}
Expand All @@ -95,7 +95,7 @@
return this.expand == false;
},
compliance_level: function () {
return Math.round(store.state.compliance, 1);
return Math.round(store.getCompliance(), 1);
},
passed: function () {
return this.count('Passed');
Expand All @@ -122,13 +122,7 @@

methods: {
count: function (name) {
var val = 0;
for (var i = 0; i < this.status.length; i++) {
if (this.status[i][0] == name) {
val = this.status[i][1];
}
}
return val;
return this.status[name] || 0;
},
expandAll: function() {
this.expand = false;
Expand Down
Loading