Re: [BackupPC-users] Changing backup browsing view from bytes to eg megabytes
2014-10-22 07:59:56
> -----Original Message-----
> From: Alexander Moisseev [mailto:moiseev AT mezonplus DOT ru]
> Sent: den 22 oktober 2014 13:53
> To: backuppc-users AT lists.sourceforge DOT net
> Subject: Re: [BackupPC-users] Changing backup browsing view from bytes to
> eg megabytes
>
> It doesn't matter where "$a->{size}" comes from if you can change it right
> here.
>
>
> root@backup:/usr/local/lib/BackupPC/CGI # diff -ruN Browse.pm.orig
> Browse.pm
> --- Browse.pm.orig 2014-10-22 15:12:01.000000000 +0400
> +++ Browse.pm 2014-10-22 15:38:50.000000000 +0400
> @@ -206,11 +206,25 @@
> $iconStr = <<EOF;
> <img src="$Conf{CgiImageDirURL}/icon-$typeStr.png" valign="top">
> EOF
> + my $size;
> + if ( $a->{size} >= 1073741824 ) {
> + $size = sprintf( "%u GiB", $a->{size} / (1073741824)
> );
> + }
> + elsif ( $a->{size} >= 1048576 ) {
> + $size = sprintf( "%u MiB", $a->{size} / 1048576 );
> + }
> + elsif ( $a->{size} >= 1024 ) {
> + $size = sprintf( "%u KiB", $a->{size} / 1024 );
> + }
> + else {
> + $size = $a->{size};
> + }
> +
> $attrStr .= <<EOF;
> <td align="center" class="fviewborder">$typeStr</td>
> <td align="center" class="fviewborder">$modeStr</td>
> <td align="center" class="fviewborder">$a->{backupNum}</td>
> - <td align="right" class="fviewborder">$a->{size}</td>
> + <td align="right" class="fviewborder">$size</td>
> <td align="right" class="fviewborder">$mtimeStr</td>
> </tr>
> EOF
>
Oh! Thanks Alexander!
--
//Sorin
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
|
|
|