From fc9adfd536355777a1385f199df784d028acf53d Mon Sep 17 00:00:00 2001 From: Sven Merk Date: Mon, 4 Mar 2019 11:51:43 +0100 Subject: [PATCH] Added stylesheet for report rendering --- resources/piper.css | 60 ++++++++++++++++++++++++++++++ vars/whitesourceExecuteScan.groovy | 7 +++- 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 resources/piper.css diff --git a/resources/piper.css b/resources/piper.css new file mode 100644 index 000000000..ee5ed56b9 --- /dev/null +++ b/resources/piper.css @@ -0,0 +1,60 @@ +body { + font-family: Arial, Verdana; +} +table { + border-collapse: collapse; +} +div.code { + font-family: "Courier New", "Lucida Console"; +} +th { + border-top: 1px solid #ddd; +} +th, td { + padding: 12px; + text-align: left; + border-bottom: 1px solid #ddd; + border-right: 1px solid #ddd; +} +tr:nth-child(even) { + background-color: #f2f2f2; +} +.bold { + font-weight: bold; +} +.nobullets { + list-style-type:none; + padding-left: 0; + padding-bottom: 0; + margin: 0; +} +.notok { + background-color: #ffe5e5; + padding: 5px +} +.warn { + background-color: #ffff99; + padding: 5px +} +.ok { + background-color: #e1f5a9; + padding: 5px +} +.green{ + color: olivedrab; +} +.red{ + color: orangered; +} +.risk-yellow{ + padding: 5px; + color: rgba(255, 255, 0, 0.6); +} +.risk-grey{ + background-color: rgba(212, 212, 212, 0.7); + padding: 5px; +} +.risk-black{ + background-color: rgba(0, 0, 0, 0.75); + padding: 5px; +} diff --git a/vars/whitesourceExecuteScan.groovy b/vars/whitesourceExecuteScan.groovy index 48b2c1eb1..4429cf704 100644 --- a/vars/whitesourceExecuteScan.groovy +++ b/vars/whitesourceExecuteScan.groovy @@ -58,6 +58,9 @@ void call(Map parameters = [:]) { .mixinGeneralConfig(script.commonPipelineEnvironment, GENERAL_CONFIG_KEYS) .mixinStepConfig(script.commonPipelineEnvironment, STEP_CONFIG_KEYS) .mixinStageConfig(script.commonPipelineEnvironment, parameters.stageName ?: env.STAGE_NAME, STEP_CONFIG_KEYS) + .mixin([ + style : libraryResource('piper.css') + ]) .mixin(parameters, PARAMETER_KEYS) .dependingOn('scanType').mixin('buildDescriptorFile') .dependingOn('scanType').mixin('configFilePath') @@ -341,7 +344,7 @@ def getReportHtml(config, vulnerabilityList, numSevereVulns) { totalSevereVulnerabilities : numSevereVulns, totalVulnerabilities : vulnerabilityList.size(), vulnerabilityTable : vulnerabilityTable, - whitesourceProductName : config.whitesourceProductName, - whitesourceProjectNames : config.whitesourceProjectNames + whitesourceProductName : config.productName, + whitesourceProjectNames : config.projectNames ]).toString() }