From d4ce843e229d840bc86fc6b29c8bb33832121f8a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 29 May 2020 18:10:59 -0700 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/modules/storage/templates/storage.html | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/plinth/modules/storage/templates/storage.html b/plinth/modules/storage/templates/storage.html index e8776878a..e71493f04 100644 --- a/plinth/modules/storage/templates/storage.html +++ b/plinth/modules/storage/templates/storage.html @@ -38,21 +38,24 @@ {{ disk.mount_points|join:"
" }} {{ disk.filesystem_type }} -
- {% if disk.percent_used < 75 %} -
- {{ disk.percent_used }}% -
-
-
{{ disk.used_str }} / {{ disk.size_str }}
+ {% if 'percent_used' in disk %} +
+
+ {{ disk.percent_used }}% +
+
+
{{ disk.used_str }} / {{ disk.size_str }}
+ {% endif %} {% if disk.is_removable %}