The backup.cgi displayed backups smaller than 1KB as 0KB.

Now backups smaller than 1KB are shown as 0.xx
This commit is contained in:
Jan Paul Tuecking
2009-07-19 10:50:16 +02:00
parent e908e6a035
commit c35ac55223

View File

@@ -230,9 +230,17 @@ delete $addons{$_};
my $Datei = "/var/ipfire/backup/addons/backup/".$_.".ipf";
my @Info = stat($Datei);
my $Size = $Info[7] / 1024;
$Size = sprintf("%2d", $Size);
if ( -e $Datei ){
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB $Lang::tr{'date'} ".localtime($Info[9])."</td>";
if ($Size < 1) {
$Size = sprintf("%.2f", $Size);
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB $Lang::tr{'date'} ".localtime($Info[9])."</td>";
} else {
$Size = sprintf("%2d", $Size);
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB $Lang::tr{'date'} ".localtime($Info[9])."</td>";
}
print <<END
<td align='right' width='5'>
<form method='post' action='$ENV{'SCRIPT_NAME'}'>