Skip to content

Commit

Permalink
Add toggle button for graphs when more than 5000 resources #844
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Druez <[email protected]>
  • Loading branch information
tdruez committed Aug 21, 2023
1 parent 0c86c6f commit 2e31ea3
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions scanpipe/templates/scanpipe/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,21 @@
</section>

{% if project.resource_count or project.package_count %}
<section id="charts" class="mx-5 pt-5" hx-get="{% url 'project_charts' project.slug %}?file-filter={{ file_filter }}" hx-trigger="load">
<i class="fa-solid fa-spinner fa-pulse" aria-hidden="true"></i>
Loading the charts...
</section>
{% endif %}
<section id="charts" class="mx-5 pt-5">
{% if project.resource_count < 5000 and project.package_count < 5000 %}
<span hx-get="{% url 'project_charts' project.slug %}?file-filter={{ file_filter }}" hx-trigger="load" hx-target="#charts"></span>
<i class="fa-solid fa-spinner fa-pulse" aria-hidden="true"></i>
Loading the charts...
{% else %}
<button class="button is-info is-outlined is-fullwidth mt-5 mb-6" hx-get="{% url 'project_charts' project.slug %}?file-filter={{ file_filter }}" hx-trigger="click" hx-swap="outerHTML">
<span class="icon">
<i class="fa-solid fa-chart-pie"></i>
</span>
<span>Load the charts</span>
</button>
{% endif %}
{% endif %}
</section>
</div>

{% include 'scanpipe/includes/run_modal.html' %}
Expand Down

0 comments on commit 2e31ea3

Please sign in to comment.