Skip to content

Commit

Permalink
Refine the display of exploitability #98
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Nov 15, 2024
1 parent 1bd041a commit 666ef3d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@
{% endif %}
</td>
<td>
{{ vulnerability.get_exploitability_display }}
{% include 'vulnerabilities/includes/exploitability.html' with instance=vulnerability only %}
</td>
<td>
{{ vulnerability.weighted_severity|default_if_none:"" }}
</td>
<td class="fs-110pct">
{% include 'component_catalog/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
{% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
</td>
<td>
{% if vulnerability.fixed_packages_html %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
{% if product.dataspace.enable_vulnerablecodedb_access %}
<td class="fs-110pct">
{% if relation.related_component_or_package.vulnerability_count %}
{% include 'component_catalog/includes/risk_score_badge.html' with risk_score=relation.related_component_or_package.risk_score only %}
{% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=relation.related_component_or_package.risk_score only %}
{% endif %}
</td>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
{% for package in vulnerability.affected_packages.all %}
<li>
<a href="{{ package.get_absolute_url }}#vulnerabilities" target="_blank">{{ package }}</a>
{% include 'component_catalog/includes/risk_score_badge.html' with risk_score=package.risk_score label='risk' only %}
{% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=package.risk_score label='risk' only %}
</li>
{% endfor %}
</ul>
</td>
<td>
{{ vulnerability.get_exploitability_display }}
{% include 'vulnerabilities/includes/exploitability.html' with instance=vulnerability only %}
</td>
<td>
{{ vulnerability.weighted_severity|default_if_none:"" }}
</td>
<td class="fs-110pct">
{% include 'component_catalog/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
{% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
</td>
<td>
{% if vulnerability.summary %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% if instance.exploitability %}
<span class="
{% if instance.exploitability == 0.5 %}text-success
{% elif instance.exploitability == 1.0 %}text-warning
{% elif instance.exploitability == 2.0 %}text-danger
{% endif %}
">
{{ instance.get_exploitability_display }}
</span>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
{% endif %}
</td>
<td>
{{ vulnerability.get_exploitability_display }}
{% include 'vulnerabilities/includes/exploitability.html' with instance=vulnerability only %}
</td>
<td>
{{ vulnerability.weighted_severity|default_if_none:"" }}
</td>
<td class="fs-110pct">
{% include 'component_catalog/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
{% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
</td>
<td>
{% if vulnerability.affected_products_count %}
Expand Down

0 comments on commit 666ef3d

Please sign in to comment.