Skip to content
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
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
perf: performance tests (opt-in). Set RUN_PERF=1 to enable.
31 changes: 30 additions & 1 deletion vulnerabilities/templates/packages.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
{{ page_obj.paginator.count|intcomma }} results
</div>
{% if is_paginated %}
{% include 'includes/pagination.html' with page_obj=page_obj %}
<div style="display:inline-block;">
{% include 'includes/pagination.html' with page_obj=page_obj %}
</div>
<div style="display:inline-block; margin-left:12px; vertical-align:middle;">
<a class="button is-small" href="?{% if search %}search={{ search|urlencode }}{% endif %}" title="Reset sorting and keep search">
⇵ Reset
</a>
</div>
{% endif %}
</div>
</section>
Expand All @@ -38,13 +45,35 @@
</span>
</th>
<th style="width: 225px;">
{% if sorts %}
{% if "-affected" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=affected" title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "affected" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected" title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected" title="Sort by affected (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected" title="Sort by affected (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
<span
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
data-tooltip="This is the number of vulnerabilities that affect the package.">
Affected by vulnerabilities
</span>
</th>
<th style="width: 225px;">
{% if sorts %}
{% if "-fixing" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=fixing" title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "fixing" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing" title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing" title="Sort by fixing (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing" title="Sort by fixing (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
<span
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
data-tooltip="This is the number of vulnerabilities fixed by the package.">
Expand Down
31 changes: 30 additions & 1 deletion vulnerabilities/templates/packages_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
{{ page_obj.paginator.count|intcomma }} results
</div>
{% if is_paginated %}
{% include 'includes/pagination.html' with page_obj=page_obj %}
<div style="display:inline-block;">
{% include 'includes/pagination.html' with page_obj=page_obj %}
</div>
<div style="display:inline-block; margin-left:12px; vertical-align:middle;">
<a class="button is-small" href="?{% if search %}search={{ search|urlencode }}{% endif %}" title="Reset sorting and keep search">
⇵ Reset
</a>
</div>
{% endif %}
</div>
</section>
Expand All @@ -38,13 +45,35 @@
</span>
</th>
<th style="width: 225px;">
{% if sorts %}
{% if "-affected" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=affected" title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "affected" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected" title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected" title="Sort by affected (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected" title="Sort by affected (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
<span
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
data-tooltip="This is the number of vulnerabilities that affect the package.">
Affected by vulnerabilities
</span>
</th>
<th style="width: 225px;">
{% if sorts %}
{% if "-fixing" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=fixing" title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "fixing" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing" title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing" title="Sort by fixing (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing" title="Sort by fixing (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
<span
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
data-tooltip="This is the number of vulnerabilities fixed by the package.">
Expand Down
178 changes: 118 additions & 60 deletions vulnerabilities/templates/vulnerabilities.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,70 +12,128 @@
</section>

{% if search %}
<div class="is-max-desktop mb-3">
<section class="mx-5">
<div class="is-flex" style="justify-content: space-between;">
<div>
{{ page_obj.paginator.count|intcomma }} results
</div>
{% if is_paginated %}
<div class="is-max-desktop mb-3">
<section class="mx-5">
<div class="is-flex" style="justify-content: space-between;">
<div>
{{ page_obj.paginator.count|intcomma }} results
</div>
{% if is_paginated %}
<div style="display:inline-block;">
{% include 'includes/pagination.html' with page_obj=page_obj %}
{% endif %}
</div>
</section>
</div>

<section class="section pt-0">
<div class="content">
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>Vulnerability id</th>
<th style="width: 225px;">Aliases</th>
<th style="width: 225px;">Affected packages</th>
<th style="width: 225px;">Fixed by packages</th>
</tr>
</thead>
<tbody>
{% for vulnerability in page_obj %}
<tr class="is-clipped-list">
<td style="word-break: break-all;">
<a
href="{{ vulnerability.get_absolute_url }}?search={{ search }}"
target="_self">{{ vulnerability.vulnerability_id }}
</a>
</td>
<td>
{% for alias in vulnerability.alias %}
{% if alias.url %}
<a href="{{ alias.url }}" target="_blank">{{ alias }}
<i class="fa fa-external-link fa_link_custom"></i>
</a>
{% else %}
{{ alias }}
{% endif %}
<br />
{% endfor %}
</td>
<td>{{ vulnerability.vulnerable_package_count }}</td>
<td>{{ vulnerability.patched_package_count }}</td>
</tr>
{% empty %}
<tr class="is-clipped-list">
<td colspan="3" style="word-break: break-all;">
No vulnerability found.
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div style="display:inline-block; margin-left:12px; vertical-align:middle;">
<a class="button is-small" href="?{% if search %}search={{ search|urlencode }}{% endif %}"
title="Reset sorting and keep search">
⇵ Reset
</a>
</div>
{% endif %}
</div>
</section>
</div>

<section class="section pt-0">
<div class="content">
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr>
<th>
{% if sorts %}
{% if "-vulnerability_id" in sorts or "-id" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=vulnerability_id"
title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "vulnerability_id" in sorts or "id" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-vulnerability_id"
title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-vulnerability_id"
title="Sort by id (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-vulnerability_id"
title="Sort by id (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
Vulnerability id
</th>
<th style="width: 225px;">Aliases</th>
<th style="width: 225px;">
{% if sorts %}
{% if "-affected" in sorts or "-vulnerable_package_count" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=affected"
title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "affected" in sorts or "vulnerable_package_count" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected"
title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected"
title="Sort by affected (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-affected"
title="Sort by affected (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
Affected packages
</th>
<th style="width: 225px;">
{% if sorts %}
{% if "-fixing" in sorts or "-patched_package_count" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=fixing"
title="Sort ascending" style="margin-right:6px; text-decoration:none;">▼</a>
{% elif "fixing" in sorts or "patched_package_count" in sorts %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing"
title="Sort descending" style="margin-right:6px; text-decoration:none;">▲</a>
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing"
title="Sort by fixing (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
{% else %}
<a href="?{% if search %}search={{ search|urlencode }}&{% endif %}sort=-fixing"
title="Sort by fixing (desc)" style="margin-right:6px; text-decoration:none;">⇵</a>
{% endif %}
Fixed by packages
</th>
</tr>
</thead>
<tbody>
{% for vulnerability in page_obj %}
<tr class="is-clipped-list">
<td style="word-break: break-all;">
<a href="{{ vulnerability.get_absolute_url }}?search={{ search }}" target="_self">{{
vulnerability.vulnerability_id }}
</a>
</td>
<td>
{% for alias in vulnerability.alias %}
{% if alias.url %}
<a href="{{ alias.url }}" target="_blank">{{ alias }}
<i class="fa fa-external-link fa_link_custom"></i>
</a>
{% else %}
{{ alias }}
{% endif %}
<br />
{% endfor %}
</td>
<td>{{ vulnerability.vulnerable_package_count }}</td>
<td>{{ vulnerability.patched_package_count }}</td>
</tr>
{% empty %}
<tr class="is-clipped-list">
<td colspan="3" style="word-break: break-all;">
No vulnerability found.
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

{% if is_paginated %}
{% include 'includes/pagination.html' with page_obj=page_obj %}
{% endif %}
</section>

{% if is_paginated %}
{% include 'includes/pagination.html' with page_obj=page_obj %}
{% endif %}
</section>
{% endif %}

{% endblock %}
{% endblock %}
Loading