Skip to content

Commit

Permalink
Vulnerabilities batch edit working
Browse files Browse the repository at this point in the history
  • Loading branch information
micabot committed Oct 10, 2014
1 parent a7d7df0 commit 3e0a193
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions views/reports/_attachments/status_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,27 @@ <h2><span class="glyphicon glyphicon-list" title="Status Report"></span></h2>
// Updates all vulns with selected == true
$scope.update = function(vulns, severity, name, desc) {
$scope.vulns = [];
var mod = false;
if(typeof(severity) != "undefined") {
mod = true;
var valid = false;
var severities = [
"unclassified",
"info",
"low",
"med",
"high"
];
severities.forEach(function(s) {
if(severity == s) valid = true;
});
if(!valid) severity = "unclassified";
}
vulns.forEach(function(v) {
v.severity = severity;
v.name = name;
v.desc = desc;
if(v.selected) {
if(mod) v.severity = severity;
if(typeof(name) != "undefined") v.name = name;
if(typeof(desc) != "undefined") v.desc = desc;
statusReport.put($scope.workspace, v);
}
$scope.vulns.push(v);
Expand Down Expand Up @@ -169,18 +185,6 @@ <h2><span class="glyphicon glyphicon-list" title="Status Report"></span></h2>
};

$scope.ok = function() {
var valid = false;
var severities = [
"unclassified",
"info",
"low",
"med",
"high"
];
severities.forEach(function(s) {
if($scope.severity == s) valid = true;
});
if(!valid) $scope.severity = "unclassified";
var res = {
"vulns": $scope.vulns,
"severity": $scope.severity,
Expand Down Expand Up @@ -266,6 +270,7 @@ <h2><span class="glyphicon glyphicon-list" title="Status Report"></span></h2>
vulnsFact.put = function(ws, vuln) {
var url = BASEURL + ws + "/" + vuln.id;
var v = {
"_rev": vuln.rev,
"desc": vuln.desc,
"metadata": vuln.meta,
"name": vuln.name,
Expand Down

0 comments on commit 3e0a193

Please sign in to comment.