{{ define "diff-content" }}

Layers

{{ if .LayerDiff }}
{{ range .LayerDiff }} {{ end }}
Layer differences
Change # Command Size
{{/* Glyph + sr-only label: color is redundant information. */}}{{ if eq .Status "added" }}Added{{ else if eq .Status "removed" }}Removed{{ else if eq .Status "rebuilt" }}Rebuilt{{ else }}Unchanged{{ end }} {{ .Layer.Index }} {{ if .Layer.Command }} {{ .Layer.Command }} {{ end }} {{ if not .Layer.EmptyLayer }}{{ humanizeBytes .Layer.Size }}{{ end }} {{ if and (eq .Status "rebuilt") .PrevLayer }} {{ if ne .Layer.Size .PrevLayer.Size }} ({{ humanizeByteDelta (sub64 .Layer.Size .PrevLayer.Size) }}) {{ end }} {{ end }}
{{ else }} {{ template "state-empty" (dict "Icon" "history" "Title" "No layer history" "Subtext" "Neither side of this diff reports layer history." ) }} {{ end }}

Vulnerabilities

{{ if not .HasVulnData }} {{/* Branch on per-side scan status so users can tell "not scanned yet" from "hold offline" from transient errors. */}} {{ if or (eq .FromScanStatus "hold-unreachable") (eq .ToScanStatus "hold-unreachable") }}
{{ icon "wifi-off" "size-4 shrink-0" }} We couldn't reach the hold to fetch scan data. Try again in a moment.
{{ else if or (eq .FromScanStatus "no-data") (eq .ToScanStatus "no-data") }}

Neither manifest has been scanned yet. Vulnerability comparison will appear after both scans complete.

{{ else }}

Vulnerability scan data isn't available for both manifests.

{{ end }} {{ else }} {{ if .FixedVulns }}
{{ icon "shield-check" "size-4 text-success" }} Fixed ({{ len .FixedVulns }})
{{ range .FixedVulns }} {{ end }}
Vulnerabilities fixed in the newer manifest
CVE Severity Package Was
{{ if .CVEURL }}{{ or .CVEID "—" }} {{ else }}{{ or .CVEID "—" }}{{ end }} {{ severityLabel .Severity }} {{ .Package }} {{ .Version }}
{{ end }} {{ if .NewVulns }}
{{ icon "alert-triangle" "size-4 text-error" }} New ({{ len .NewVulns }})
{{ range .NewVulns }} {{ end }}
Vulnerabilities new to the newer manifest
CVE Severity Package Version Fix
{{ if .CVEURL }}{{ or .CVEID "—" }} {{ else }}{{ or .CVEID "—" }}{{ end }} {{ severityLabel .Severity }} {{ .Package }} {{ .Version }} {{ .FixedIn }}
{{ end }} {{ if .UnchangedVulns }}
Unchanged ({{ len .UnchangedVulns }})
{{ range .UnchangedVulns }} {{ end }}
Vulnerabilities present in both manifests
CVE Severity Package Version Fix
{{ if .CVEURL }}{{ or .CVEID "—" }} {{ else }}{{ or .CVEID "—" }}{{ end }} {{ severityLabel .Severity }} {{ .Package }} {{ .Version }} {{ .FixedIn }}
{{ end }} {{ if and (not .FixedVulns) (not .NewVulns) (not .UnchangedVulns) }}

No vulnerabilities found in either manifest

{{ end }} {{ end }}
{{ end }}