-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Vulnerabilities tab in the Product details view #95
Signed-off-by: tdruez <tdruez@nexb.com>
- Loading branch information
Showing
6 changed files
with
226 additions
and
16 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
component_catalog/templates/component_catalog/includes/vulnerability_aliases.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
product_portfolio/templates/product_portfolio/tabs/tab_vulnerabilities.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{% load i18n %} | ||
<table class="table table-bordered table-hover table-md text-break"> | ||
<thead> | ||
<tr> | ||
<th style="width: 210px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Link to the VulnerableCode app."> | ||
{% trans 'Affected by' %} | ||
</span> | ||
</th> | ||
<th style="width: 210px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="A list of aliases for this vulnerability."> | ||
{% trans 'Aliases' %} | ||
</span> | ||
</th> | ||
<th style="width: 90px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Severity score range."> | ||
{% trans 'Score' %} | ||
</span> | ||
</th> | ||
<th> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Summary of the vulnerability."> | ||
{% trans 'Summary' %} | ||
</span> | ||
</th> | ||
<th style="min-width: 320px;"> | ||
<span class="help_text" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Affected packages."> | ||
{% trans 'Affected packages' %} | ||
</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for vulnerability in page_obj.object_list %} | ||
<tr> | ||
<td> | ||
<strong> | ||
<a href="{{ values.vulnerablecode_url }}vulnerabilities/{{ vulnerability.vulnerability_id }}" target="_blank"> | ||
{{ vulnerability.vulnerability_id }} | ||
<i class="fa-solid fa-up-right-from-square mini"></i> | ||
</a> | ||
</strong> | ||
</td> | ||
<td> | ||
{% include 'component_catalog/includes/vulnerability_aliases.html' with aliases=vulnerability.aliases only %} | ||
</td> | ||
<td> | ||
{% if vulnerability.min_score %} | ||
{{ vulnerability.min_score }} - | ||
{% endif %} | ||
{% if vulnerability.max_score %} | ||
<strong> | ||
{{ vulnerability.max_score }} | ||
</strong> | ||
{% endif %} | ||
</td> | ||
<td> | ||
{% if vulnerability.summary %} | ||
{% if vulnerability.summary|length > 120 %} | ||
<details> | ||
<summary>{{ vulnerability.summary|slice:":120" }}...</summary> | ||
{{ vulnerability.summary|slice:"120:" }} | ||
</details> | ||
{% else %} | ||
{{ vulnerability.summary }} | ||
{% endif %} | ||
{% endif %} | ||
</td> | ||
<td> | ||
<ul class="list-unstyled mb-0"> | ||
{% for package in vulnerability.affected_packages.all %} | ||
<li> | ||
<a href="{{ package.get_absolute_url }}#vulnerabilities" target="_blank">{{ package }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters