Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Aug 26, 2023
1 parent 872d5ab commit b4e54e6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/static/app/js/components/TaskListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ class TaskListItem extends React.Component {
</tr>}
{task.size > 0 &&
<tr>
<td><strong>{_("Size:")}</strong></td>
<td><strong>{_("Disk Usage:")}</strong></td>
<td>{Utils.bytesToSize(task.size * 1024 * 1024)}</td>
</tr>}
<tr>
Expand Down
4 changes: 2 additions & 2 deletions app/templates/app/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ <h3>{% trans 'Welcome!' %} ☺</h3>
{% endif %}

{% if user.profile.has_exceeded_quota_cached %}
{% with total=user.profile.quota|storage_size used=user.profile.used_quota_cached|storage_size %}
{% with total=user.profile.quota|disk_size used=user.profile.used_quota_cached|disk_size %}
{% quota_exceeded_grace_period as hours %}
<div class="alert alert-warning alert-dismissible">
<i class="fas fa-exclamation-triangle"></i> {% blocktrans %}The current storage quota is being exceeded ({{ used }} of {{ total }} used). The most recent tasks will be automatically deleted within {{ hours }} hours, until usage falls below {{ total }}.{% endblocktrans %}
<i class="fas fa-exclamation-triangle"></i> {% blocktrans %}The disk quota is being exceeded ({{ used }} of {{ total }} used). The most recent tasks will be automatically deleted within {{ hours }} hours, until usage falls below {{ total }}.{% endblocktrans %}
</div>
{% endwith %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/app/logged_in_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<li>
<div class="info-item quotas">
{% with usage=perc_quota|floatformat:0 used=used_quota|storage_size total=tot_quota|storage_size %}
{% with usage=perc_quota|floatformat:0 used=used_quota|disk_size total=tot_quota|disk_size %}
<i class="fa fa-database fa-fw"></i> {% blocktrans %}{{used}} of {{total}} used{% endblocktrans %}
<div class="progress">
<div class="progress-bar progress-bar-{% if perc_quota <= 100 %}success{% else %}warning{% endif %} active" style="width: {{ bar_width }}%">
Expand Down
2 changes: 1 addition & 1 deletion app/templatetags/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
logger = logging.getLogger('app.logger')

@register.filter
def storage_size(megabytes):
def disk_size(megabytes):
k = 1000
k2 = k ** 2
k3 = k ** 3
Expand Down
3 changes: 3 additions & 0 deletions app/tests/test_api_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ def test_task(self):
# Size should be updated
self.assertTrue(task.size > 0)

# The owner's used quota should have increased
self.assertTrue(task.project.owner.profile.used_quota_cached() > 0)

# Can export orthophoto (when formula and bands are specified)
res = client.post("/api/projects/{}/tasks/{}/orthophoto/export".format(project.id, task.id), {
'formula': 'NDVI'
Expand Down

0 comments on commit b4e54e6

Please sign in to comment.