Show percent used
authorJamie Cameron <jcameron@webmin.com>
Thu, 20 Nov 2008 07:09:52 +0000 (07:09 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 20 Nov 2008 07:09:52 +0000 (07:09 +0000)
mount/CHANGELOG
mount/index.cgi
mount/lang/en

index 056e766..4e8ba0c 100644 (file)
@@ -21,3 +21,4 @@ Mounted filesystems can now be displayed on Intel macs, without needing the gcc
 SMBFS authentication credentials can be stored in a separate file, thanks to a patch by Rob Shinn.
 ---- Changes since 1.440 ----
 Improved support for filesystems on partitions identified by volume ID when the vol_id command is missing.
+Show the used disk space for each filesystem on the main page.
index e28c6ab..c778774 100755 (executable)
@@ -50,6 +50,7 @@ if (@visible) {
        print &ui_columns_start([ $text{'index_dir'},
                                $text{'index_type'},
                                $text{'index_dev'},
+                               $text{'index_used'},
                                $text{'index_use'},
                                $text{'index_perm'} ], 100);
        foreach $m (@visible) {
@@ -79,6 +80,15 @@ if (@visible) {
                $fsn .= " ($minfo[2])" if (uc($fsn) ne uc($minfo[2]));
                push(@cols, $minfo[2] eq "*" ? $text{'index_auto'} : $fsn);
                push(@cols, &device_name($minfo[1]));
+               ($total, $free) = &disk_space($minfo[2],$minfo[0]);
+               if ($total) {
+                       $pc = int(100*($total-$free) / $total);
+                       push(@cols, $pc >= 99 ? "<font color=red>$pc %</font>" :
+                                   $pc >= 95 ? "<font color=orange>$pc %</font>" : $pc."%");
+                       }
+               else {
+                       push(@cols, "");
+                       }
                if (&can_edit_fs(@minfo)) {
                        push(@cols,
                                defined($medidx) ?
index dd346d0..d9722a1 100644 (file)
@@ -2,8 +2,9 @@ index_title=Disk and Network Filesystems
 index_dir=Mounted as
 index_type=Type
 index_dev=Location
+index_used=Used
 index_use=In use?
-index_perm=Permanent?
+index_perm=Saved?
 index_add=Add mount
 index_auto=Unknown Type
 index_swap=Virtual Memory