Skip to content

Commit

Permalink
Warn when quota is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Sep 12, 2023
1 parent df24590 commit b7178c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 2 additions & 3 deletions app/templates/app/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ <h3>{% trans 'Welcome!' %} ☺</h3>
<button class="btn btn-primary" onclick="location.href='{% url "admin:nodeodm_processingnode_add" %}';"><i class="fa fa-plus-circle"></i> {{ add_processing_node }}</button>

{% else %}

{% include "quota.html" %}

{% if no_tasks %}
<h3>{% trans 'Welcome!' %} ☺</h3>
{% trans 'Select Images and GCP' as upload_images %}
Expand All @@ -42,8 +43,6 @@ <h3>{% trans 'Welcome!' %} ☺</h3>
</p>
{% endif %}

{% include "quota.html" %}

<div id="dashboard-app" data-dashboard></div>

{% endif %}
Expand Down
7 changes: 6 additions & 1 deletion app/templates/app/quota.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{% load i18n %}
{% load settings %}

{% quota_exceeded_grace_period as when %}

{% if user.profile.has_exceeded_quota_cached %}
{% with total=user.profile.quota|disk_size used=user.profile.used_quota_cached|disk_size %}
{% quota_exceeded_grace_period as when %}
<div class="alert alert-warning alert-dismissible">
<i class="fas fa-info-circle"></i> {% blocktrans %}The disk quota is being exceeded ({{ used }} of {{ total }} used). The most recent tasks will be automatically deleted {{ when }}, until usage falls below {{ total }}.{% endblocktrans %}
</div>
{% endwith %}
{% elif user.profile.quota == 0 %}
<div class="alert alert-warning alert-dismissible">
<i class="fas fa-info-circle"></i> {% blocktrans %}Your account does not have a storage quota. Any new task will be automatically deleted {{ when }}{% endblocktrans %}
</div>
{% endif %}

0 comments on commit b7178c8

Please sign in to comment.