Fix handling of non-features from Clair and other small UI fixes
This commit is contained in:
parent
5b7d6b0638
commit
65037ac5e1
8 changed files with 95 additions and 17 deletions
|
@ -171,8 +171,11 @@ angular.module('quay').directive('repoPanelTags', function () {
|
|||
'index': 100000
|
||||
};
|
||||
|
||||
var hasFeatures = false;
|
||||
if (resp.data && resp.data.Layer && resp.data.Layer.Features) {
|
||||
resp.data.Layer.Features.forEach(function(feature) {
|
||||
hasFeatures = true;
|
||||
|
||||
if (feature.Vulnerabilities) {
|
||||
feature.Vulnerabilities.forEach(function(vuln) {
|
||||
if (VulnerabilityService.LEVELS[vuln.Severity].index == 0) {
|
||||
|
@ -197,6 +200,7 @@ angular.module('quay').directive('repoPanelTags', function () {
|
|||
}
|
||||
|
||||
imageData.hasVulnerabilities = !!vulnerabilities.length;
|
||||
imageData.hasFeatures = hasFeatures;
|
||||
imageData.vulnerabilities = vulnerabilities;
|
||||
imageData.highestVulnerability = highest;
|
||||
}
|
||||
|
|
|
@ -132,7 +132,11 @@ angular.module('quay').directive('imageFeatureView', function () {
|
|||
|
||||
if (data && data.Layer && data.Layer.Features) {
|
||||
data.Layer.Features.forEach(function(feature) {
|
||||
var imageId = feature.AddedBy.split('.')[0];
|
||||
var imageId = null;
|
||||
if (feature.AddedBy) {
|
||||
imageId = feature.AddedBy.split('.')[0];
|
||||
}
|
||||
|
||||
feature_obj = {
|
||||
'name': feature.Name,
|
||||
'namespace': feature.Namespace,
|
||||
|
@ -268,11 +272,13 @@ angular.module('quay').directive('imageFeatureView', function () {
|
|||
});
|
||||
}
|
||||
|
||||
$scope.featureBreakdown.push({
|
||||
'label': 'None',
|
||||
'value': greenCount,
|
||||
'color': '#2FC98E'
|
||||
});
|
||||
if (greenCount > 0) {
|
||||
$scope.featureBreakdown.push({
|
||||
'label': 'None',
|
||||
'value': greenCount,
|
||||
'color': '#2FC98E'
|
||||
});
|
||||
}
|
||||
|
||||
buildOrderedFeatures();
|
||||
};
|
||||
|
|
|
@ -25,6 +25,10 @@ angular.module('quay').factory('ImageMetadataService', ['UtilService', function(
|
|||
};
|
||||
|
||||
metadataService.getImageCommand = function(image, imageId) {
|
||||
if (!image) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!image.__imageMap) {
|
||||
image.__imageMap = {};
|
||||
for (var i = 0; i < image.history.length; ++i) {
|
||||
|
@ -33,7 +37,12 @@ angular.module('quay').factory('ImageMetadataService', ['UtilService', function(
|
|||
}
|
||||
}
|
||||
|
||||
return getDockerfileCommand(image.__imageMap[imageId].command);
|
||||
var found = image.__imageMap[imageId];
|
||||
if (!found) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return getDockerfileCommand(found.command);
|
||||
};
|
||||
|
||||
var getDockerfileCommand = function(command) {
|
||||
|
|
Reference in a new issue