Switch from an image view UI to a manifest view UI
We no longer allow viewing individual images, but instead only manifests. This will help with the transition to Clair V3 (which is manifest based) and, eventually, the the new data model (which will also be manifest based)
This commit is contained in:
parent
d41dcaae23
commit
fc6eb71ab1
24 changed files with 312 additions and 260 deletions
|
@ -262,6 +262,10 @@ angular.module('quay').directive('repoPanelTags', function () {
|
|||
};
|
||||
|
||||
$scope.getTagVulnerabilities = function(tag) {
|
||||
if (!tag.manifest_digest) {
|
||||
return 'nodigest';
|
||||
}
|
||||
|
||||
return $scope.getImageVulnerabilities(tag.image_id);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/**
|
||||
* An element which displays the features of an image.
|
||||
* An element which displays the features of a manifest.
|
||||
*/
|
||||
angular.module('quay').directive('imageFeatureView', function () {
|
||||
angular.module('quay').directive('manifestFeatureView', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/image-feature-view.html',
|
||||
templateUrl: '/static/directives/manifest-feature-view.html',
|
||||
replace: false,
|
||||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository',
|
||||
'image': '=image',
|
||||
'manifest': '=manifest',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, Config, ApiService, VulnerabilityService, ViewArray, TableService) {
|
||||
|
@ -64,15 +64,15 @@ angular.module('quay').directive('imageFeatureView', function () {
|
|||
});
|
||||
};
|
||||
|
||||
var loadImageVulnerabilities = function() {
|
||||
var loadManifestVulnerabilities = function() {
|
||||
if ($scope.loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loading = true;
|
||||
VulnerabilityService.loadImageVulnerabilities($scope.repository, $scope.image.id, function(resp) {
|
||||
VulnerabilityService.loadManifestVulnerabilities($scope.repository, $scope.manifest.digest, function(resp) {
|
||||
$scope.securityStatus = resp.status;
|
||||
$scope.featuresInfo = VulnerabilityService.buildFeaturesInfo($scope.image, resp);
|
||||
$scope.featuresInfo = VulnerabilityService.buildFeaturesInfo($scope.manifest.image, resp);
|
||||
|
||||
buildOrderedFeatures();
|
||||
buildChart();
|
||||
|
@ -87,20 +87,20 @@ angular.module('quay').directive('imageFeatureView', function () {
|
|||
$scope.$watch('options.filter', buildOrderedFeatures);
|
||||
|
||||
$scope.$watch('repository', function(repository) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.image) {
|
||||
loadImageVulnerabilities();
|
||||
if ($scope.isEnabled && $scope.repository && $scope.manifest) {
|
||||
loadManifestVulnerabilities();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('image', function(image) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.image) {
|
||||
loadImageVulnerabilities();
|
||||
$scope.$watch('manifest', function(manifest) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.manifest) {
|
||||
loadManifestVulnerabilities();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('isEnabled', function(isEnabled) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.image) {
|
||||
loadImageVulnerabilities();
|
||||
if ($scope.isEnabled && $scope.repository && $scope.manifest) {
|
||||
loadManifestVulnerabilities();
|
||||
}
|
||||
});
|
||||
}
|
|
@ -1,22 +1,22 @@
|
|||
<span class="manifest-link">
|
||||
<span class="id-label" ng-if="!$ctrl.hasSHA256($ctrl.manifestDigest)"
|
||||
<span class="id-label" ng-if="::!$ctrl.hasSHA256($ctrl.manifestDigest)"
|
||||
data-title="The Docker V1 ID for this image. This ID is not content addressable nor is it stable across pulls."
|
||||
data-container="body"
|
||||
ng-click="$ctrl.showCopyBox()"
|
||||
bs-tooltip>V1ID</span>
|
||||
|
||||
<span class="id-label cas" ng-if="$ctrl.hasSHA256($ctrl.manifestDigest)"
|
||||
<span class="id-label cas" ng-if="::$ctrl.hasSHA256($ctrl.manifestDigest)"
|
||||
data-title="The content-addressable SHA256 hash of this tag."
|
||||
data-container="body"
|
||||
ng-click="$ctrl.showCopyBox()"
|
||||
bs-tooltip>SHA256</span>
|
||||
|
||||
<a bo-href-i="/repository/{{ $ctrl.repository.namespace }}/{{ $ctrl.repository.name }}/image/{{ $ctrl.imageId }}"
|
||||
class="image-link-element" bindonce>
|
||||
<span ng-if="!$ctrl.hasSHA256($ctrl.manifestDigest)">{{ $ctrl.imageId.substr(0, 12) }}</span>
|
||||
<span ng-if="$ctrl.hasSHA256($ctrl.manifestDigest)">{{ $ctrl.getShortDigest($ctrl.manifestDigest) }}</span>
|
||||
<a ng-href="/repository/{{ ::$ctrl.repository.namespace }}/{{ ::$ctrl.repository.name }}/manifest/{{ ::$ctrl.manifestDigest }}">
|
||||
{{ $ctrl.getShortDigest($ctrl.manifestDigest) }}
|
||||
</a>
|
||||
|
||||
<span ng-if="::!$ctrl.hasSHA256($ctrl.manifestDigest)">{{ ::$ctrl.imageId.substr(0, 12) }}</span>
|
||||
|
||||
<div class="modal fade co-dialog" ng-if="$ctrl.showingCopyBox">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
|
|
@ -25,6 +25,7 @@ export class ManifestLinkComponent {
|
|||
}
|
||||
|
||||
private getShortDigest(digest: string) {
|
||||
if (!digest) { return ''; }
|
||||
return digest.substr('sha256:'.length).substr(0, 12);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
/**
|
||||
* An element which displays the vulnerabilities in an image.
|
||||
* An element which displays the vulnerabilities in a manifest.
|
||||
*/
|
||||
angular.module('quay').directive('imageVulnerabilityView', function () {
|
||||
angular.module('quay').directive('manifestVulnerabilityView', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/image-vulnerability-view.html',
|
||||
templateUrl: '/static/directives/manifest-vulnerability-view.html',
|
||||
replace: false,
|
||||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository',
|
||||
'image': '=image',
|
||||
'manifest': '=manifest',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, $routeParams, Config, ApiService, VulnerabilityService, ViewArray, TableService) {
|
||||
|
@ -100,15 +100,15 @@ angular.module('quay').directive('imageVulnerabilityView', function () {
|
|||
});
|
||||
};
|
||||
|
||||
var loadImageVulnerabilities = function() {
|
||||
var loadManifestVulnerabilities = function() {
|
||||
if ($scope.loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.loading = true;
|
||||
VulnerabilityService.loadImageVulnerabilities($scope.repository, $scope.image.id, function(resp) {
|
||||
VulnerabilityService.loadManifestVulnerabilities($scope.repository, $scope.manifest.digest, function(resp) {
|
||||
$scope.securityStatus = resp.status;
|
||||
$scope.vulnerabilitiesInfo = VulnerabilityService.buildVulnerabilitiesInfo($scope.image, resp);
|
||||
$scope.vulnerabilitiesInfo = VulnerabilityService.buildVulnerabilitiesInfo($scope.manifest.image, resp);
|
||||
|
||||
buildOrderedVulnerabilities();
|
||||
buildChart();
|
||||
|
@ -124,20 +124,20 @@ angular.module('quay').directive('imageVulnerabilityView', function () {
|
|||
$scope.$watch('options.fixableVulns', buildOrderedVulnerabilities);
|
||||
|
||||
$scope.$watch('repository', function(repository) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.image) {
|
||||
loadImageVulnerabilities();
|
||||
if ($scope.isEnabled && $scope.repository && $scope.manifest) {
|
||||
loadManifestVulnerabilities();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('image', function(image) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.image) {
|
||||
loadImageVulnerabilities();
|
||||
$scope.$watch('manifest', function(manifest) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.manifest) {
|
||||
loadManifestVulnerabilities();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('isEnabled', function(isEnabled) {
|
||||
if ($scope.isEnabled && $scope.repository && $scope.image) {
|
||||
loadImageVulnerabilities();
|
||||
if ($scope.isEnabled && $scope.repository && $scope.manifest) {
|
||||
loadManifestVulnerabilities();
|
||||
}
|
||||
});
|
||||
}
|
Reference in a new issue