From 326a764de66971d2c78d2e45225d8985ca4ac3be Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alf=20H=C3=B8gemark?= Date: Sat, 1 Mar 2014 14:32:52 +0100 Subject: [PATCH] firewalllog*.cgi and country.cgi: Use language strings, and align graphs Put the piechart for firewalllog* in the center of the page horisontally, this looks visually better. Add language string for count and details submit button. Add language strings for country.cgi. Make html validate for country.cgi. --- html/cgi-bin/country.cgi | 61 +++++++++++------------ html/cgi-bin/logs.cgi/firewalllogip.dat | 10 ++-- html/cgi-bin/logs.cgi/firewalllogport.dat | 10 ++-- langs/de/cgi-bin/de.pl | 6 +++ langs/en/cgi-bin/en.pl | 6 +++ 5 files changed, 50 insertions(+), 43 deletions(-) diff --git a/html/cgi-bin/country.cgi b/html/cgi-bin/country.cgi index db6c07496d..76035fb46d 100644 --- a/html/cgi-bin/country.cgi +++ b/html/cgi-bin/country.cgi @@ -36,18 +36,18 @@ require "${General::swroot}/header.pl"; &Header::showhttpheaders(); -&Header::openpage('Country Codes', 1, ''); -&Header::openbigbox('100%', 'LEFT'); - -&Header::openbox('100%', 'LEFT', 'Flags & Country Codes:'); -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; +&Header::openpage($Lang::tr{'countries'}, 1, ''); +&Header::openbigbox('100%', 'left'); + +&Header::openbox('100%', 'left', $Lang::tr{'country codes and flags'}); +print "
FlagCode$Lang::tr{'country'} FlagCode$Lang::tr{'country'}
"; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; +print ""; @flaglist = <$flagdir/*>; @@ -69,39 +69,34 @@ foreach $flag (@flaglistfiles) if($fcode eq 'tp') { $country = 'East Timor'; } if($fcode eq 'yu') { $country = 'Yugoslavia'; } if ($lines % 2) { - print ""; print ""; print "\n"; -} -else { - $lines2++; - if($lines2 % 2) { - print ""; - $col="bgcolor='${Header::table2colour}'"; - } else { - print ""; - $col="bgcolor='${Header::table1colour}'"; } - print ""; - print ""; - print ""; + else { + $lines2++; + if($lines2 % 2) { + $col="style='background-color:${Header::table2colour};'"; + } else { + $col="style='background-color:${Header::table1colour};'"; + } + print ""; + print ""; + print ""; + print ""; + print ""; } } -print "
$Lang::tr{'flag'}$Lang::tr{'countrycode'}$Lang::tr{'country'} $Lang::tr{'flag'}$Lang::tr{'countrycode'}$Lang::tr{'country'}
$flagcode"; + print "$flagcode$flagcode$country
$flagcode"; - print "$flagcode$country 
$flagcode$flagcode$country 
"; +print ""; &Header::closebox(); &Header::closebigbox(); print < - - - - -
$Lang::tr{'back'}
+
+$Lang::tr{'back'}
END ; diff --git a/html/cgi-bin/logs.cgi/firewalllogip.dat b/html/cgi-bin/logs.cgi/firewalllogip.dat index e4e845198b..07bcc77f81 100644 --- a/html/cgi-bin/logs.cgi/firewalllogip.dat +++ b/html/cgi-bin/logs.cgi/firewalllogip.dat @@ -397,9 +397,9 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { print FILE $myimage->png; close(FILE); ##################################################### - print "
"; + print "
"; print ""; - print "
"; + print ""; } print < $Lang::tr{'ip address'} $Lang::tr{'country'} -Count +$Lang::tr{'count'} $Lang::tr{'percentage'} END @@ -439,10 +439,10 @@ for($s=0;$s<$lines;$s++) my $fcode = lc($ccode); $color++; - print "
"; + print "
"; print "$key[$s]"; if ( $fcode ne "" ){ - print "$ccode";} + print "$ccode";} else { print "";} print "$value[$s]"; diff --git a/html/cgi-bin/logs.cgi/firewalllogport.dat b/html/cgi-bin/logs.cgi/firewalllogport.dat index 9f7ce3a113..5b0db62314 100644 --- a/html/cgi-bin/logs.cgi/firewalllogport.dat +++ b/html/cgi-bin/logs.cgi/firewalllogport.dat @@ -400,17 +400,17 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) { print FILE $myimage->png; close(FILE); ##################################################### - print "
"; + print "
"; print ""; - print "
"; + print ""; } print < + - + END @@ -437,7 +437,7 @@ for($s=0;$s<$lines;$s++) print ""; $color++; - print ""; + print ""; print ""; print ""; print ""; diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index e951b68b5c..ea56e72759 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -564,7 +564,11 @@ 'could not open installed updates file' => 'Datei mit Update-Liste konnte nicht geöffnet werden', 'could not open update information file' => 'Datei mit den Update-Information konnte nicht geöffnet werden. Die Update-Datei ist beschädigt.', 'could not retrieve common name from certificate' => 'Der Gemeinsame Name (CN) konnte nicht aus dem Zertifikat gelesen werden.', +'count' => 'Anzahl', +'countries' => 'Länder', 'country' => 'Land', +'countrycode' => 'Kennung', +'country codes and flags' => 'Länder und Länderkennungen', 'cpu frequency per' => 'CPU-Frequenz pro', 'cpu idle usage' => 'Leerlauf CPU-Nutzung', 'cpu interrupt usage' => 'Interrupt CPU-Nutzung', @@ -644,6 +648,7 @@ 'destination port numbers' => 'Zielport muß ein(e) gültige(r) Portnummer oder Portbereich sein.', 'destination port overlaps' => 'Der Zielportbereich überlappt einen bereits bestehenden Portbereich.', 'detail level' => 'Detaillierungsgrad', +'details' => 'Mehr', 'device' => 'Gerät', 'devices on blue' => 'Geräte auf Blau', 'dhcp advopt add' => 'DHCP Option hinzufügen', @@ -898,6 +903,7 @@ 'fixed ip lease added' => 'Feste IP-Zuordnung hinzugefügt', 'fixed ip lease modified' => 'Feste IP-Zuordnung geändert', 'fixed ip lease removed' => 'Feste IP-Zuordnung gelöscht', +'flag' => 'Flagge', 'force update' => 'Aktualisierung erzwingen', 'force user' => 'Standardbenutzer für das UNIX Dateisystem', 'forward firewall' => 'Firewall', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index d8cfdc771c..27b8b09cf3 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -585,7 +585,11 @@ 'could not open installed updates file' => 'Could not open installed updates file', 'could not open update information file' => 'Could not open update information file. The update file is corrupt.', 'could not retrieve common name from certificate' => 'Could not retrieve common name from certificate.', +'count' => 'Count', +'countries' => 'Countries', 'country' => 'Country', +'countrycode' => 'Code', +'country codes and flags' => 'Country Codes and Flags:', 'cpu frequency per' => 'CPU frequency per', 'cpu idle usage' => 'Idle CPU Usage', 'cpu interrupt usage' => 'Interrupt CPU Usage', @@ -666,6 +670,7 @@ 'destination port numbers' => 'Destination port must be a valid port number or port range.', 'destination port overlaps' => 'Destination port range overlaps an existing port range.', 'detail level' => 'Detail level', +'details' => 'Details', 'device' => 'Device', 'devices on blue' => 'Devices on BLUE', 'dhcp advopt add' => 'Add a DHCP option', @@ -924,6 +929,7 @@ 'fixed ip lease added' => 'Fixed IP lease added', 'fixed ip lease modified' => 'Fixed IP lease modified', 'fixed ip lease removed' => 'Fixed IP lease removed', +'flag' => 'Flag', 'force update' => 'Force update', 'force user' => 'force all new file to user', 'forward firewall' => 'Firewall', -- 2.39.2
$Lang::tr{'port'}count$Lang::tr{'count'} $Lang::tr{'percentage'}
$key[$s]$value[$s]$percent