Add CustomHeader to allow custom definition of the logo and title. See squidanalyzer.conf or documentation for more explanation and example. Thanks to Raktim Chatterjee.

This commit is contained in:
Darold Gilles 2014-03-15 18:22:37 +01:00
parent 7739e35840
commit b3ff727a55
5 changed files with 58 additions and 3 deletions

14
README
View File

@ -199,6 +199,20 @@ CONFIGURATION
The URL of the SquidAnalyzer javascript, HTML and images files.
Default: /squidreport
CustomHeader
This directive allow you to replace the SquidAnalyze logo by your
custom logo. The default value is defined as follow:
<a href="$self->{WebUrl}">
<img src="$self->{WebUrl}images/logo-squidanalyzer.png" title="SquidAnalyzer $VERSION" border="0">
</a> SquidAnalyzer
Feel free to define your own header but take care to not break
current design. For example:
CustomHeader <a href="http://my.isp.dom/"><img src="http://my.isp.dom/logo.png" title="My ISP link" border="0" width="100" height="110"></a> My ISP Company
126,1 Bas
LogFile squid_access_log_file
Set the path to the Squid log file.

View File

@ -734,6 +734,8 @@ sub _init
$self->{DNSLookupTimeout} = $options{DNSLookupTimeout} || 0.0001;
$self->{DNSLookupTimeout} = int($self->{DNSLookupTimeout} * 1000000);
$self->{pidfile} = $pidfile || '/tmp/squid-analyzer.pid';
$self->{CustomHeader} = $options{CustomHeader} || qq{<a href="$self->{WebUrl}"><img src="$self->{WebUrl}images/logo-squidanalyzer.png" title="SquidAnalyzer $VERSION" border="0"></a> SquidAnalyzer};
if ($self->{Lang}) {
open(IN, "$self->{Lang}") or die "ERROR: can't open translation file $self->{Lang}, $!\n";
@ -1536,8 +1538,7 @@ sub _print_header
<div id="header">
<div id="alignLeft">
<h1>
<a href="$self->{WebUrl}"><img src="$self->{WebUrl}images/logo-squidanalyzer.png" title="SquidAnalyzer $VERSION" border="0"></a>
SquidAnalyzer
$self->{CustomHeader}
</h1>
<p class="sous-titre">
$Translate{'Generation'} $now.

View File

@ -206,6 +206,21 @@ You should give a path that can be read by a Web browser.
The URL of the SquidAnalyzer javascript, HTML and images files.
Default: /squidreport
=item CustomHeader
This directive allow you to replace the SquidAnalyze logo by your custom
logo. The default value is defined as follow:
<a href="$self->{WebUrl}">
<img src="$self->{WebUrl}images/logo-squidanalyzer.png" title="SquidAnalyzer $VERSION" border="0">
</a> SquidAnalyzer
Feel free to define your own header but take care to not break current design.
For example:
CustomHeader <a href="http://my.isp.dom/"><img src="http://my.isp.dom/logo.png" title="My ISP link" border="0" width="100" height="110"></a> My ISP Company
126,1 Bas
=item LogFile squid_access_log_file
Set the path to the Squid log file.

View File

@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "SQUIDANALYZER 1"
.TH SQUIDANALYZER 1 "2014-03-03" "perl v5.14.2" "User Contributed Perl Documentation"
.TH SQUIDANALYZER 1 "2014-03-15" "perl v5.14.2" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@ -341,6 +341,24 @@ You should give a path that can be read by a Web browser.
.IX Item "WebUrl"
The \s-1URL\s0 of the SquidAnalyzer javascript, \s-1HTML\s0 and images files.
Default: /squidreport
.IP "CustomHeader" 4
.IX Item "CustomHeader"
This directive allow you to replace the SquidAnalyze logo by your custom
logo. The default value is defined as follow:
.Sp
.Vb 3
\& <a href="$self\->{WebUrl}">
\& <img src="$self\->{WebUrl}images/logo\-squidanalyzer.png" title="SquidAnalyzer $VERSION" border="0">
\& </a> SquidAnalyzer
.Ve
.Sp
Feel free to define your own header but take care to not break current design.
For example:
.Sp
.Vb 2
\& CustomHeader <a href="http://my.isp.dom/"><img src="http://my.isp.dom/logo.png" title="My ISP link" border="0" width="100" height="110"></a> My ISP Company
\& 126,1 Bas
.Ve
.IP "LogFile squid_access_log_file" 4
.IX Item "LogFile squid_access_log_file"
Set the path to the Squid log file.

View File

@ -117,3 +117,10 @@ WriteDelay 3600
# Set it to 0 to disable this feature.
TopUrlUser 10
# This directive allow you to replace the SquidAnalyze logo by your custom
# logo. The default value is defined as follow:
# <a href="$self->{WebUrl}">
# <img src="$self->{WebUrl}images/logo-squidanalyzer.png" title="SquidAnalyzer $VERSION" border="0">
# </a> SquidAnalyzer
# Feel free to define your own header but take care to not break current design.
#CustomHeader <a href="http://my.isp.dom/"><img src="http://my.isp.dom/logo.png" title="My ISP link" border="0" width="100" height="110"></a> My ISP Company