Show percent used

This commit is contained in:
Jamie Cameron
2008-11-20 07:09:52 +00:00
parent 4f60acd253
commit 3c7750c558
3 changed files with 13 additions and 1 deletions

View 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.

View File

@@ -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) ?

View 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