This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/ui/nvd-vectors-display.js

35 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-11-12 16:09:47 +00:00
/**
* An element which displays NVD vectors is an expanded format.
*/
angular.module('quay').directive('nvdVectorsDisplay', function () {
var directiveDefinitionObject = {
priority: 0,
templateUrl: '/static/directives/nvd-vectors-display.html',
replace: false,
transclude: true,
restrict: 'C',
scope: {
'vectors': '@vectors',
},
controller: function($scope, $element, VulnerabilityService) {
$scope.parsedVectors = VulnerabilityService.parseVectorsString($scope.vectors);
$scope.getVectorTitle = function(vector) {
return VulnerabilityService.getVectorTitle(vector);
};
$scope.getVectorDescription = function(vector) {
return VulnerabilityService.getVectorDescription(vector);
};
$scope.getVectorOptions = function(vectorString) {
return VulnerabilityService.getVectorOptions(vectorString);
};
$scope.getVectorClasses = function(option, vectorString) {
return VulnerabilityService.getVectorClasses(option, vectorString);
};
}
};
return directiveDefinitionObject;
});