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>
|
||||
</td>
|
||||
<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>
|
||||
<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
|
||||
}
|
||||
|
||||
feature_vulnerabilities = []
|
||||
feature_vulnerabilities = [];
|
||||
|
||||
if (feature.Vulnerabilities) {
|
||||
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) {
|
||||
score = vuln.Metadata.NVD.CVSSv2.Score;
|
||||
severity = VulnerabilityService.getSeverityForCVSS(score);
|
||||
}
|
||||
|
||||
var imageId = feature.AddedBy.split('.')[0];
|
||||
|
@ -190,25 +192,25 @@ angular.module('quay').directive('imageVulnerabilityView', function () {
|
|||
feature_vulnerabilities.push(vuln_obj)
|
||||
$scope.securityVulnerabilities.push(vuln_obj);
|
||||
|
||||
if (severityMap[vuln.Severity] == undefined) {
|
||||
severityMap[vuln.Severity] = 0;
|
||||
if (severityMap[severity['index']] == undefined) {
|
||||
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);
|
||||
});
|
||||
|
||||
var levels = VulnerabilityService.getLevels();
|
||||
for (var i = 0; i < levels.length; ++i) {
|
||||
if (severityMap[levels[i].title]) {
|
||||
if (severityMap[levels[i]['index']]) {
|
||||
$scope.priorityBreakdown.push({
|
||||
'label': levels[i].title,
|
||||
'value': severityMap[levels[i].title],
|
||||
'color': levels[i].color,
|
||||
'value': severityMap[levels[i]['index']],
|
||||
'color': levels[i].color
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ angular.module('quay').factory('ImageMetadataService', ['UtilService', function(
|
|||
if (!command) { return ''; }
|
||||
|
||||
// ["/bin/sh", "-c", "#(nop) RUN foo"]
|
||||
var commandPrefix = '#(nop)'
|
||||
var commandPrefix = '#(nop)';
|
||||
|
||||
if (command.length != 3) { 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;
|
||||
return classes
|
||||
return classes;
|
||||
};
|
||||
|
||||
vulnService.getVectorOptions = function(vectorString) {
|
||||
|
|
Reference in a new issue