]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
firewalllogcountry.dat: Use language strings and add to menu
authorAlf Høgemark <alf@i100.no>
Sun, 16 Feb 2014 06:18:41 +0000 (07:18 +0100)
committerAlf Høgemark <alf@i100.no>
Sat, 1 Mar 2014 13:59:18 +0000 (14:59 +0100)
Add some language strings for the new firewalllogport.dat, and
include html fixes done in firewalllogip.dat, which this file
is based on.

Also try to add the menu item to the sub menu, but that is
currently not working.

config/menu/70-log.menu
html/cgi-bin/logs.cgi/firewalllogcountry.dat
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index 25ba090fc2e609428eaabc1b59bc77f949c9ddb4..08973de5a2943ea6f3b5267837d14b7011c60206 100644 (file)
                                 'title' => "$Lang::tr{'firewall logs port'}",
                                 'enabled' => 1
                                 };
+    $sublogs->{'43.firewallcountry'} = {'caption' => $Lang::tr{'firewall logs country'},
+                                'uri' => '/cgi-bin/logs.cgi/firewalllogcountry.dat',
+                                'title' => "$Lang::tr{'firewall logs country'}",
+                                'enabled' => 1
+                                };
     $sublogs->{'50.ids'} = {'caption' => $Lang::tr{'ids logs'},
                                'uri' => '/cgi-bin/logs.cgi/ids.dat',
                                'title' => "$Lang::tr{'ids logs'}",
index ffd8cea83915deb4518e5286fbf7cf2f776789c5..6676f9cb76fe3f050f1694a8a7fb28843637bb3c 100644 (file)
@@ -221,7 +221,7 @@ if ($errormessage) {
         &Header::closebox();
 }
 
-&Header::openbox('100%', 'left', "$Lang::tr{'settings'}:");
+&Header::openbox('100%', 'left', "$Lang::tr{'settings'}");
 
 print <<END
 <form method='post' action='$ENV{'SCRIPT_NAME'}'>
@@ -266,15 +266,15 @@ print <<END
 </td>
 <td width='5%'  align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day before'}' value='&lt;&lt;' /></td>
 <td width='5%'  align='center'><input type='submit' name='ACTION' title='$Lang::tr{'day after'}' value='&gt;&gt;' /></td>
-<td width='20%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
+<td width='20%' align='right'><input type='submit' name='ACTION' value='$Lang::tr{'update'}' /></td>
+</tr>
+<tr>
+       <td colspan='3' align='left' valign="left">$Lang::tr{'Number of Countries for the pie chart'}:</td>
+       <td colspan='3' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
+       <td align='right'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
 </tr>
 </table>
-<table width='100%'>
-<tr><td width='20%' align='right' valign="center">$Lang::tr{'Number of IPs for the pie chart'}:</td>
-          <td width='10%' align='left' valign="center"><input type='text' name='pienumber' value='$pienumber' size='4'></td>
-          <td width='20%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td></tr>
-       </table>
-       </form>
+</form>
 END
 ;
 
@@ -285,7 +285,6 @@ print "<p><b>$Lang::tr{'firewall hits'} $longmonthstr $daystr: $lines</b></p>";
 
 my $linesjc = 0;
 my %tabjc;
-
 my $gi = Geo::IP::PurePerl->new();
 
 if ($pienumber == -1 || $pienumber > $lines || $sortcolumn == 2) { $pienumber = $lines; };
@@ -416,13 +415,13 @@ if ($showpie != 2 && $pienumber <= 50 && $pienumber != 0) {
 }
 
 print <<END
-<TABLE WIDTH='100%'>
-<TR>
-<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'></TD>
-<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'><B>Flag</B></TD>
-<TD WIDTH='10%' ALIGN='CENTER' CLASS='boldbase'><B>Count</B></TD>
-<TD WIDTH='30%' ALIGN='CENTER' CLASS='boldbase'><B>Percent</B></TD>
-</TR>
+<table width='100%' class='tbl'>
+<tr>
+<th width='10%' align='center' class='boldbase'></th>
+<th width='30%' align='center' class='boldbase'><b>$Lang::tr{'country'}</b></th>
+<th width='30%' align='center' class='boldbase'><b>Count</b></th>
+<th width='30%' align='center' class='boldbase'><b>$Lang::tr{'percentage'}</b></th>
+</tr>
 END
 ;
 
@@ -431,6 +430,7 @@ my $show=0;
 
 my $s;
 my $percent;
+my $col="";
 
 for($s=0;$s<$lines;$s++)
 {
@@ -438,42 +438,42 @@ for($s=0;$s<$lines;$s++)
   $percent = $value[$s] * 100 / $linesjc;
   $percent = sprintf("%.f", $percent);
   $total = $total + $value[$s];
-  if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
-  if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
-  if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
-  if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
-  if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
-  if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
-  if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
-  if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
-  if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
-  if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
-  
+  if ( ($color % 10) == 1 ){print "<tr>"; $col="bgcolor='$color{'color1'}'";}
+  if ( ($color % 10) == 2 ){print "<tr>"; $col="bgcolor='$color{'color2'}'";}
+  if ( ($color % 10) == 3 ){print "<tr>"; $col="bgcolor='$color{'color3'}'";}
+  if ( ($color % 10) == 4 ){print "<tr>"; $col="bgcolor='$color{'color4'}'";}
+  if ( ($color % 10) == 5 ){print "<tr>"; $col="bgcolor='$color{'color5'}'";}
+  if ( ($color % 10) == 6 ){print "<tr>"; $col="bgcolor='$color{'color6'}'";}
+  if ( ($color % 10) == 7 ){print "<tr>"; $col="bgcolor='$color{'color7'}'";}
+  if ( ($color % 10) == 8 ){print "<tr>"; $col="bgcolor='$color{'color8'}'";}
+  if ( ($color % 10) == 9 ){print "<tr>"; $col="bgcolor='$color{'color9'}'";}
+  if ( ($color % 10) == 0 ){print "<tr>"; $col="bgcolor='$color{'color10'}'";}
   
   $color++;
-  print "<TD ALIGN='CENTER'><form method='post' action='showrequestfromcountry.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='country' value='$key[$s]'> <input type='submit' value='details'></form></TD>";
+  print "<td align='center' $col><form method='post' action='showrequestfromcountry.dat'><input type='hidden' name='MONTH' value='$cgiparams{'MONTH'}'> <input type='hidden' name='DAY' value='$cgiparams{'DAY'}'> <input type='hidden' name='country' value='$key[$s]'> <input type='submit' value='details'></form></td>";
   if ( $key[$s] ne "unknown" ){
       my $fcode = lc($key[$s]);
-  print "<TD ALIGN='CENTER'><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></TD>";} 
+      print "<td align='center' $col><a href='/cgi-bin/country.cgi#$fcode'><img src='/images/flags/$fcode.png' border='0' align='absmiddle' alt='$key[$s]' title='$key[$s]'></a></TD>";} 
   else {
-      print "<TD ALIGN='CENTER'></TD>";}
-      print "<TD ALIGN='CENTER'>$value[$s]</TD>";
-      print "<TD ALIGN='CENTER'>$percent</TD>";
-      print "</TR>";
+      print "<td align='center' $col></td>";
   }
+  print "<td align='center' $col>$value[$s]</td>";
+  print "<td align='center' $col>$percent</td>";
+  print "</tr>";
+}
 
 if($cgiparams{'otherspie'} == 2 ){}
 else{
-if ( ($color % 10) == 1 ){print "<TR BGCOLOR='$color{'color1'}'>\n";}
-if ( ($color % 10) == 2 ){print "<TR BGCOLOR='$color{'color2'}'>\n";}
-if ( ($color % 10) == 3 ){print "<TR BGCOLOR='$color{'color3'}'>\n";}
-if ( ($color % 10) == 4 ){print "<TR BGCOLOR='$color{'color4'}'>\n";}
-if ( ($color % 10) == 5 ){print "<TR BGCOLOR='$color{'color5'}'>\n";}
-if ( ($color % 10) == 6 ){print "<TR BGCOLOR='$color{'color6'}'>\n";}
-if ( ($color % 10) == 7 ){print "<TR BGCOLOR='$color{'color7'}'>\n";}
-if ( ($color % 10) == 8 ){print "<TR BGCOLOR='$color{'color8'}'>\n";}
-if ( ($color % 10) == 9 ){print "<TR BGCOLOR='$color{'color9'}'>\n";}
-if ( ($color % 10) == 0 ){print "<TR BGCOLOR='$color{'color10'}'>\n";}
+if ( ($color % 10) == 1 ){print "<tr>"; $col="bgcolor='$color{'color1'}'";}
+if ( ($color % 10) == 2 ){print "<tr>"; $col="bgcolor='$color{'color2'}'";}
+if ( ($color % 10) == 3 ){print "<tr>"; $col="bgcolor='$color{'color3'}'";}
+if ( ($color % 10) == 4 ){print "<tr>"; $col="bgcolor='$color{'color4'}'";}
+if ( ($color % 10) == 5 ){print "<tr>"; $col="bgcolor='$color{'color5'}'";}
+if ( ($color % 10) == 6 ){print "<tr>"; $col="bgcolor='$color{'color6'}'";}
+if ( ($color % 10) == 7 ){print "<tr>"; $col="bgcolor='$color{'color7'}'";}
+if ( ($color % 10) == 8 ){print "<tr>"; $col="bgcolor='$color{'color8'}'";}
+if ( ($color % 10) == 9 ){print "<tr>"; $col="bgcolor='$color{'color9'}'";}
+if ( ($color % 10) == 0 ){print "<tr>"; $col="bgcolor='$color{'color10'}'";}
 
 if ( $linesjc ne "0")
 {
@@ -482,11 +482,11 @@ $dif = $linesjc - $total;
 $percent = $dif * 100 / $linesjc;
 $percent = sprintf("%.f", $percent);
 print <<END
-<TD ALIGN='CENTER'></TD>
-<TD ALIGN='CENTER'>Other country</TD>
-<TD ALIGN='CENTER'>$dif</TD>
-<TD ALIGN='CENTER'>$percent</TD> 
-</TR>
+<td align='center' $col></TD>
+<td align='center' $col>$Lang::tr{'other countries'}</td>
+<td align='center' $col>$dif</TD>
+<td align='center' $col>$percent</TD>
+</tr>
 END
 ;
 }
index e951b68b5c1d6f1d620b3393ac1c052fbd276a0d..700f41b3b1dd115463d08be683c32efb23c9d2a1 100644 (file)
@@ -34,6 +34,7 @@
 'Level7 rule' => 'Level7-Regel',
 'Local VPN IP' => 'Internes Netzwerk (GREEN)',
 'MTU' => 'MTU Size',
+'Number of Countries for the pie chart' => 'Anzahl der angezeigten Länder im Diagramm',
 'Number of IPs for the pie chart' => 'Anzahl der angezeigten IPs im Diagramm',
 'Number of Ports for the pie chart' => 'Anzahl der angezeigten Ports im Diagramm',
 'OVPN' => 'OpenVPN',
 'firewall log' => 'Firewall-Protokoll',
 'firewall log viewer' => 'Betrachter der Firewall-Logdateien',
 'firewall logs' => 'Firewall-Logdateien',
+'firewall logs country' => 'Fw-Logdiagramme (Land)',
 'firewall logs ip' => 'Fw-Logdiagramme (IP)',
 'firewall logs port' => 'Fw-Logdiagramme (Port)',
 'firewall rules' => 'Firewallregeln',
index d8cfdc771ccd19f42c7f4f402bddd0b5ad631b82..6a7835275c53df47a0d6070276c65366d46a8227 100644 (file)
@@ -34,6 +34,7 @@
 'Level7 rule' => 'Level7 rule',
 'Local VPN IP' => 'Internal Network (GREEN):',
 'MTU' => 'MTU size:',
+'Number of Countries for the pie chart' => 'Number of Countries for the pie chart',
 'Number of IPs for the pie chart' => 'Number of IPs for the pie chart',
 'Number of Ports for the pie chart' => 'Number of ports for the pie chart',
 'OVPN' => 'OpenVPN',
 'firewall graphs' => 'Firewall Graphs',
 'firewall hits' => 'Total number of firewall hits for',
 'firewall hits per' => 'firewallhits per',
+'firewall logs' => 'Firewall Logs',
 'firewall log' => 'Firewall log',
 'firewall log viewer' => 'Firewall Log Viewer',
-'firewall logs' => 'Firewall Logs',
 'firewall logs ip' => 'Fw-Loggraphs (IP)',
 'firewall logs port' => 'Fw-Loggraphs (Port)',
+'firewall logs country' => 'Fw-Loggraphs (Country)',
 'firewall rules' => 'Firewall Rules',
 'firewallhits' => 'firewallhits',
 'firmware' => 'Firmware',