Show LV space used on main page
authorJamie Cameron <jcameron@webmin.com>
Fri, 21 Nov 2008 01:47:00 +0000 (01:47 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 21 Nov 2008 01:47:00 +0000 (01:47 +0000)
lvm/CHANGELOG
lvm/index.cgi
lvm/lang/en

index c763f52..3bb5edd 100644 (file)
@@ -12,3 +12,5 @@ Converted all user interface code to use the new Webmin UI library.
 Fixed the command used to move data to another physical volume under LVM 2.
 ---- Changes since 1.410 ----
 The percentage of a snapshot's blocks used is now shown on the Edit Snapshot page.
+---- Changes since 1.440 ----
+Filesystem space used is show on the logical volume list, and the field for a new volume's size is more user-friendly.
index cb35083..51b9e00 100755 (executable)
@@ -168,6 +168,7 @@ if (@vgs) {
                print &ui_columns_start([ $text{'index_lvname'},
                                          $text{'index_lvvg'},
                                          $text{'index_lvsize'},
+                                         $text{'index_lvused'},
                                          $text{'index_lvuse'} ], 100);
                foreach $l (@alllvs) {
                        ($v) = grep { $_->{'name'} eq $l->{'vg'} } @vgs;
@@ -181,11 +182,20 @@ if (@vgs) {
                                $snapof = undef;
                                }
                        @stat = &device_status($l->{'device'});
+                       $usedmsg = "";
+                       if (@stat[2]) {
+                               ($total, $free) = &mount::disk_space(
+                                       $stat[1], $stat[0]);
+                               $usedmsg = &text('lv_petotals',
+                                       &nice_size(($total-$free)*1024),
+                                       &nice_size($total));
+                               }
                        print &ui_columns_row([
                          "<a href='edit_lv.cgi?vg=".&urlize($v->{'name'}).
                            "&lv=".&urlize($l->{'name'})."'>$l->{'name'}</a>",
                          $v->{'name'},
                          &nice_size($l->{'size'}*1024),
+                         $usedmsg,
                          (@stat ? &device_message(@stat) : undef).
                          ($snap ? " ".&text('index_snapof', $snap->{'name'})
                                 : ""),
index ac2123e..574c246 100644 (file)
@@ -35,6 +35,7 @@ index_lvsdesc=A logical volume is a virtual partition created from the combined
 index_lvname=Logical volume
 index_lvvg=Volume group
 index_lvsize=Size
+index_lvused=Space used
 index_lvuse=Used for
 index_snapof=(Snapshot of $1)