changeset 68:bac5931b8312

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 Aug 2009 03:47:16 +0300
parents 8df5d52436a1
children b090ddfccdab
files example.css maltfilter
diffstat 2 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/example.css	Tue Aug 18 03:38:31 2009 +0300
+++ b/example.css	Tue Aug 18 03:47:16 2009 +0300
@@ -51,10 +51,15 @@
 }
 
 table td {
+	padding: 2px;
 	font-size: 8pt;
 }
 
-table.global .blocked, table.ignored .blocked {
+table.global .filtered, table.ignored .filtered {
 	background: #400;
 	color: red;
 }
+
+table.filtered tr:hover td {
+	background: black;
+}
--- a/maltfilter	Tue Aug 18 03:38:31 2009 +0300
+++ b/maltfilter	Tue Aug 18 03:47:16 2009 +0300
@@ -313,7 +313,7 @@
   );
   
   foreach my $mip (sort { $func->($table, $a, $b) } keys %{$keys}) {
-    my $blocked = defined($filterlist{$mip}) ? "blocked" : "unblocked";
+    my $blocked = defined($filterlist{$mip}) ? "filtered" : "unfiltered";
     printElem($m, $f, " <tr class=\"$blocked\">");
     printTD($m, $f, sprintf(bb($m)."%-10d".eb($m), $table->{$mip}{"hits"}));
     printElem(!$m, $f, " | ");
@@ -388,7 +388,7 @@
   my @ncolor = (0, 0);
   
   my $printEntry = sub {
-    my $blocked = "class=\"".(defined($filterlist{$_[0]}) ? "blocked" : "unblocked")."\"";
+    my $blocked = "class=\"".(defined($filterlist{$_[0]}) ? "filtered" : "unfiltered")."\"";
     if (test_ips($previp[$_[1]], $_[0]) < 3) {
       $ncolor[$_[1]]++;
     }
@@ -489,15 +489,17 @@
   ($reportmode ? "complete logfile scan" : "a period of last $period").".\n");
 
   printP($m, $f, "The hit classes marked as 'IPTABLES' are a pseudo-class meaning an\n".
-  "blocked IP that was in Netfilter before Maltfilter was started.\n");
+  "filtered IP that was in Netfilter before Maltfilter was started.\n");
 
-  printH($m, $f, 2, "Currently filtered entries");
-  $period = get_period($settings{"FILTER_MAX_AGE"});
-  printP($m, $f, "List of IPs that are currently filtered (or would be, if this is\n".
-  "a report-only mode). Data from period of $period.\n");
-  print_table1($m, $f, \%statlist, \%filterlist, \&cmp_hits, "blocked");
+  if ($settings{"FILTER"} > 0) {
+    printH($m, $f, 2, "Currently filtered entries");
+    $period = get_period($settings{"FILTER_MAX_AGE"});
+    printP($m, $f, "List of IPs that are currently filtered (or would be, if this is\n".
+    "a report-only mode). Data from period of $period.\n");
+    print_table1($m, $f, \%statlist, \%filterlist, \&cmp_hits, "filtered");
+  }
 
-  printH($m, $f, 2, "Summary of non-ignored entries");
+  printH($m, $f, 2, "Summary of entries");
   printP($m, $f, "List of 'hits' of suspicious activity noticed by Maltfilter, but not\n".
   "necessarily acted upon. Sorted by descending IP address.\n");
   print_table2($m, $f, \%statlist, \%statlist, \&cmp_ips, "global");