From: eldy <>
Date: Thu, 25 Sep 2003 05:04:49 +0000 (+0000)
Subject: Add percent column for file types.
X-Git-Tag: AWSTATS_6_0_BETA~232
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca4c9f51a1af9de1768774fef27bcdf1238dcc01;p=thirdparty%2FAWStats.git
Add percent column for file types.
---
diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl
index 5bb15372..790f4b9c 100644
--- a/wwwroot/cgi-bin/awstats.pl
+++ b/wwwroot/cgi-bin/awstats.pl
@@ -8830,14 +8830,16 @@ if (scalar keys %HTMLOutput) {
if ($ShowFileTypesStats =~ /C/i) { $title.=" - $Message[98]"; }
&tab_head("$title",19);
print "
| $Message[73] | ";
- if ($ShowFileTypesStats =~ /H/i) { print " $Message[57] | $Message[15] | "; }
- if ($ShowFileTypesStats =~ /B/i) { print "$Message[75] | "; }
+ if ($ShowFileTypesStats =~ /H/i) { print "$Message[57] | $Message[15] | "; }
+ if ($ShowFileTypesStats =~ /B/i) { print "$Message[75] | $Message[15] | "; }
if ($ShowFileTypesStats =~ /C/i) { print "$Message[100] | $Message[101] | $Message[99] | "; }
print "
\n";
my $count=0;
&BuildKeyList($MaxRowsInHTMLOutput,1,\%_filetypes_h,\%_filetypes_h);
foreach my $key (@keylist) {
- my $p=int($_filetypes_h{$key}/$Totalh*1000)/10;
+ my $p_h=' '; my $p_k=' ';
+ if ($Totalh) { $p_h=int($_filetypes_h{$key}/$Totalh*1000)/10; $p_h="$p_h %"; }
+ if ($Totalk) { $p_k=int($_filetypes_k{$key}/$Totalk*1000)/10; $p_k="$p_k %"; }
if ($key eq 'Unknown') {
print ".") | $Message[0] | ";
}
@@ -8847,8 +8849,8 @@ if (scalar keys %HTMLOutput) {
print "
.") | $key | ";
print "$nametype | ";
}
- if ($ShowFileTypesStats =~ /H/i) { print "$_filetypes_h{$key} | $p % | "; }
- if ($ShowFileTypesStats =~ /B/i) { print "".Format_Bytes($_filetypes_k{$key})." | "; }
+ if ($ShowFileTypesStats =~ /H/i) { print "$_filetypes_h{$key} | $p_h % | "; }
+ if ($ShowFileTypesStats =~ /B/i) { print "".Format_Bytes($_filetypes_k{$key})." | $p_k % | "; }
if ($ShowFileTypesStats =~ /C/i) {
if ($_filetypes_gz_in{$key}) {
my $percent=int(100*(1-$_filetypes_gz_out{$key}/$_filetypes_gz_in{$key}));
@@ -8861,6 +8863,8 @@ if (scalar keys %HTMLOutput) {
print "
\n";
$count++;
}
+ # TODO Add a total
+
&tab_end;
}