Small JS fixes
This commit is contained in:
parent
ae9140caae
commit
58ccda6590
4 changed files with 14 additions and 12 deletions
|
@ -105,7 +105,7 @@
|
||||||
<span class="fixed-in-version" bo-if="vuln.fixedInVersion" bo-text="vuln.fixedInVersion"></span>
|
<span class="fixed-in-version" bo-if="vuln.fixedInVersion" bo-text="vuln.fixedInVersion"></span>
|
||||||
</td>
|
</td>
|
||||||
<td class="double-col image-col hidden-xs hidden-sm hidden-md">
|
<td class="double-col image-col hidden-xs hidden-sm hidden-md">
|
||||||
<span data-title="{{ vuln.imageCommand }}" bs-tooltip>
|
<span data-title="{{ vuln.imageCommand }}" data-container="body" bs-tooltip>
|
||||||
<span class="dockerfile-command" command="vuln.imageCommand"></span>
|
<span class="dockerfile-command" command="vuln.imageCommand"></span>
|
||||||
</span>
|
</span>
|
||||||
<a href="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ vuln.imageId }}"><i class="fa fa-archive"></i></a>
|
<a href="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ vuln.imageId }}"><i class="fa fa-archive"></i></a>
|
||||||
|
|
|
@ -157,13 +157,15 @@ angular.module('quay').directive('imageVulnerabilityView', function () {
|
||||||
'addedBy': feature.AddedBy
|
'addedBy': feature.AddedBy
|
||||||
}
|
}
|
||||||
|
|
||||||
feature_vulnerabilities = []
|
feature_vulnerabilities = [];
|
||||||
|
|
||||||
if (feature.Vulnerabilities) {
|
if (feature.Vulnerabilities) {
|
||||||
feature.Vulnerabilities.forEach(function(vuln) {
|
feature.Vulnerabilities.forEach(function(vuln) {
|
||||||
var score = VulnerabilityService.LEVELS[vuln['Severity']]['score'];
|
var severity = VulnerabilityService.LEVELS[vuln['Severity']];
|
||||||
|
var score = severity.score;
|
||||||
if (vuln.Metadata && vuln.Metadata.NVD && vuln.Metadata.NVD.CVSSv2 && vuln.Metadata.NVD.CVSSv2.Score) {
|
if (vuln.Metadata && vuln.Metadata.NVD && vuln.Metadata.NVD.CVSSv2 && vuln.Metadata.NVD.CVSSv2.Score) {
|
||||||
score = vuln.Metadata.NVD.CVSSv2.Score;
|
score = vuln.Metadata.NVD.CVSSv2.Score;
|
||||||
|
severity = VulnerabilityService.getSeverityForCVSS(score);
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageId = feature.AddedBy.split('.')[0];
|
var imageId = feature.AddedBy.split('.')[0];
|
||||||
|
@ -190,25 +192,25 @@ angular.module('quay').directive('imageVulnerabilityView', function () {
|
||||||
feature_vulnerabilities.push(vuln_obj)
|
feature_vulnerabilities.push(vuln_obj)
|
||||||
$scope.securityVulnerabilities.push(vuln_obj);
|
$scope.securityVulnerabilities.push(vuln_obj);
|
||||||
|
|
||||||
if (severityMap[vuln.Severity] == undefined) {
|
if (severityMap[severity['index']] == undefined) {
|
||||||
severityMap[vuln.Severity] = 0;
|
severityMap[severity['index']] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
severityMap[vuln.Severity]++;
|
severityMap[severity['index']]++;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
feature_obj['vulnerabilities'] = feature_vulnerabilities
|
feature_obj['vulnerabilities'] = feature_vulnerabilities;
|
||||||
$scope.securityFeatures.push(feature_obj);
|
$scope.securityFeatures.push(feature_obj);
|
||||||
});
|
});
|
||||||
|
|
||||||
var levels = VulnerabilityService.getLevels();
|
var levels = VulnerabilityService.getLevels();
|
||||||
for (var i = 0; i < levels.length; ++i) {
|
for (var i = 0; i < levels.length; ++i) {
|
||||||
if (severityMap[levels[i].title]) {
|
if (severityMap[levels[i]['index']]) {
|
||||||
$scope.priorityBreakdown.push({
|
$scope.priorityBreakdown.push({
|
||||||
'label': levels[i].title,
|
'label': levels[i].title,
|
||||||
'value': severityMap[levels[i].title],
|
'value': severityMap[levels[i]['index']],
|
||||||
'color': levels[i].color,
|
'color': levels[i].color
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ angular.module('quay').factory('ImageMetadataService', ['UtilService', function(
|
||||||
if (!command) { return ''; }
|
if (!command) { return ''; }
|
||||||
|
|
||||||
// ["/bin/sh", "-c", "#(nop) RUN foo"]
|
// ["/bin/sh", "-c", "#(nop) RUN foo"]
|
||||||
var commandPrefix = '#(nop)'
|
var commandPrefix = '#(nop)';
|
||||||
|
|
||||||
if (command.length != 3) { return ''; }
|
if (command.length != 3) { return ''; }
|
||||||
if (command[0] != '/bin/sh' || command[1] != '-c') { return ''; }
|
if (command[0] != '/bin/sh' || command[1] != '-c') { return ''; }
|
||||||
|
|
|
@ -75,7 +75,7 @@ angular.module('quay').factory('VulnerabilityService', ['Config', function(Confi
|
||||||
}
|
}
|
||||||
|
|
||||||
classes += option.severity;
|
classes += option.severity;
|
||||||
return classes
|
return classes;
|
||||||
};
|
};
|
||||||
|
|
||||||
vulnService.getVectorOptions = function(vectorString) {
|
vulnService.getVectorOptions = function(vectorString) {
|
||||||
|
|
Reference in a new issue