mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
storage: Don't show empty progress bar for disks not mounted
In future, we may consider showing disks that are not mounted and allow mounting them manually or unlocking encrypted volumes manually. Prepare for that scenario. Tests performed: - Edit get_disks() code to show not mounted disks. The progress bar or free space information should not be shown. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
10b46f1968
commit
d4ce843e22
@ -38,21 +38,24 @@
|
||||
<td>{{ disk.mount_points|join:"<br>" }}</td>
|
||||
<td>{{ disk.filesystem_type }}</td>
|
||||
<td>
|
||||
<div class="progress">
|
||||
{% if disk.percent_used < 75 %}
|
||||
<div class="progress-bar progress-bar-striped progress-bar-success"
|
||||
{% elif disk.percent_used < 90 %}
|
||||
<div class="progress-bar progress-bar-striped progress-bar-warning"
|
||||
{% else %}
|
||||
<div class="progress-bar progress-bar-striped progress-bar-danger"
|
||||
{% endif %}
|
||||
role="progressbar" aria-valuenow="disk.percent_used"
|
||||
aria-valuemin="0" aria-valuemax="100"
|
||||
style="width: {{ disk.percent_used }}%;">
|
||||
{{ disk.percent_used }}%
|
||||
</div>
|
||||
</div>
|
||||
<div>{{ disk.used_str }} / {{ disk.size_str }}</div>
|
||||
{% if 'percent_used' in disk %}
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-striped
|
||||
{% if disk.percent_used < 75 %}
|
||||
progress-bar-success
|
||||
{% elif disk.percent_used < 90 %}
|
||||
progress-bar-warning
|
||||
{% else %}
|
||||
progress-bar-danger
|
||||
{% endif %}"
|
||||
role="progressbar" aria-valuenow="disk.percent_used"
|
||||
aria-valuemin="0" aria-valuemax="100"
|
||||
style="width: {{ disk.percent_used }}%;">
|
||||
{{ disk.percent_used }}%
|
||||
</div>
|
||||
</div>
|
||||
<div>{{ disk.used_str }} / {{ disk.size_str }}</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if disk.is_removable %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user