Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: HTML report tinkering #1561

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/output/html/base_image_template.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<tr>
<td></td>
<td colspan="100%">
<div id="base-image-details-{{ .Index }}" class="base-image-details">
<div id="base-image-details-{{ .Index }}" class="base-image-details hide-block">
{{ range .AllLayers }}
{{ $index := .Index }}
{{ $originalCommand := .LayerMetadata.Command }}
Expand Down
32 changes: 16 additions & 16 deletions internal/output/html/filter_template.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<i class="material-icons">keyboard_arrow_down</i>
</div>
</div>
<div id="layer-filter-option-container" class="filter-option-container">
<div id="layer-filter-option-container" class="filter-option-container hide-block">
<div data-layer-hash="all" class="filter-option layer-filter-option" id="all-layer-checkbox"
data-layer-all-count="{{ .VulnCount.AnalysisCount.Regular }}">
<p>All layers ({{ .VulnCount.AnalysisCount.Regular }})</p>
Expand All @@ -24,7 +24,7 @@
{{ $diffID := .LayerMetadata.DiffID }}
{{ $longCommand := false }}
{{ if gt (len $command) 109 }}
{{ $longCommand = true }}
{{ $longCommand = true }}
{{ end }}

{{ if gt .Count.AnalysisCount.Regular 0 }}
Expand All @@ -34,7 +34,7 @@
{{ if $longCommand }}
<span class="tooltiptext layer-tooltiptext">{{ $originalCommand }}</span>
{{ end }}
</div>
</div>
{{ template "severity_summary_template.gohtml".Count.SeverityCount }}
</div>
{{ end }}
Expand All @@ -54,28 +54,28 @@
<i class="material-icons">keyboard_arrow_down</i>
</div>
</div>
<div id="type-filter-option-container" class="filter-option-container">
<div id="type-filter-option-container" class="filter-option-container hide-block">
{{ if .IsContainerScanning }}
<div class="filter-option">
<label class="filter-option" for="all-type-checkbox">
<input type="checkbox" checked id="all-type-checkbox" data-type-all-count="{{ .VulnTypeSummary.All }}">
<label for="all-type-checkbox">Default ({{ .VulnTypeSummary.All }})</label>
</div>
Default ({{ .VulnTypeSummary.All }})
</label>
{{ end }}
<div class="filter-option">
<label class="filter-option" for="project-type-checkbox">
<input type="checkbox" checked id="project-type-checkbox"
data-type-project-count="{{ .VulnTypeSummary.Project }}">
<label for="project-type-checkbox"> Project Vulnerabilities ({{ .VulnTypeSummary.Project }})</label>
</div>
Project Vulnerabilities ({{ .VulnTypeSummary.Project }})
</label>
{{ if .IsContainerScanning }}
<div class="filter-option">
<label class="filter-option" for="os-type-checkbox">
<input type="checkbox" checked id="os-type-checkbox" data-type-os-count="{{ .VulnTypeSummary.OS }}">
<label for="os-type-checkbox"> Operating system vulnerabilities ({{ .VulnTypeSummary.OS }})</label>
</div>
Operating system vulnerabilities ({{ .VulnTypeSummary.OS }})
</label>
{{ end }}
<div class="filter-option">
<label class="filter-option" for="uncalled-type-checkbox">
<input type="checkbox" id="uncalled-type-checkbox" data-type-uncalled-count="{{ .VulnTypeSummary.Hidden }}">
<label for="uncalled-type-checkbox">Uncalled/Unimportant ({{ .VulnTypeSummary.Hidden }})</label>
</div>
Uncalled/Unimportant ({{ .VulnTypeSummary.Hidden }})
</label>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions internal/output/html/package_table_template.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
{{ end }}
</td>
</tr>
<tr>
<tr class="table-tr-details">
<td colspan="100%">
<div id="table-tr-{{ $index }}-details" class="package-details">
<div id="table-tr-{{ $index }}-details" class="package-details hide-block">
{{ if and $element.LayerDetail.LayerInfo.LayerMetadata (not (eq $element.LayerDetail.LayerInfo.LayerMetadata.Command "")) }}
{{ $index := $element.LayerDetail.LayerIndex }}
{{ $diffID := $element.LayerDetail.LayerInfo.LayerMetadata.DiffID }}
Expand Down
2 changes: 1 addition & 1 deletion internal/output/html/package_view_template.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="ecosystem-sources-container">
{{ range .Sources }}
<div class="source-container">
<h3 class="source-heading">Source: {{ .Name }}</h3>
<h3 class="source-heading">Source: <span class="source-path">{{ .Name }}</span></h3>
{{ template "package_table_template.gohtml" .Packages }}
</div>
{{ end }}
Expand Down
8 changes: 6 additions & 2 deletions internal/output/html/report_template.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<link href='https://fonts.googleapis.com/css?family=Overpass' rel='stylesheet'>
<link rel="stylesheet" href="https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
{{ template "style.html" }}
<style>
{{ template "style.css" }}
</style>
</head>

<body>
{{ template "script.html" }}
<div class="container">
<header>
<div id="header-left">
Expand Down Expand Up @@ -57,6 +58,9 @@
</div>

</div>
<script>
{{ template "script.js" }}
</script>
</body>

</html>
Loading