From: Michael Tremer Date: Tue, 22 Oct 2013 18:21:33 +0000 (+0200) Subject: firewall: Straighten the format of the rule table. X-Git-Tag: v2.15-beta1~190^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=989d0fd7172efa96382a10cb1ee16e608355af29;p=people%2Fms%2Fipfire-2.x.git firewall: Straighten the format of the rule table. Lots of markup and code cleanup. --- diff --git a/html/cgi-bin/forwardfw.cgi b/html/cgi-bin/forwardfw.cgi index 5e62dbcb99..fbee025a8b 100755 --- a/html/cgi-bin/forwardfw.cgi +++ b/html/cgi-bin/forwardfw.cgi @@ -2350,9 +2350,34 @@ sub viewtablenew my $tooltip; my @tmpsrc=(); my $coloryellow=''; - print"$title1
"; - print""; - print""; + print <$title1 +
+ +
#$Lang::tr{'fwdfw source'}Log$Lang::tr{'fwdfw target'}$Lang::tr{'fwdfw action'}
+ + + + + + + + + +END + foreach my $key (sort {$a <=> $b} keys %$hash){ $tdcolor=''; @tmpsrc=(); @@ -2403,11 +2428,13 @@ sub viewtablenew $color="$color{'color20'}"; } } - print""; - #KEY print<$key   + + END + #RULETYPE (A,R,D) if ($$hash{$key}[0] eq 'ACCEPT'){ $ruletype='A'; @@ -2422,7 +2449,13 @@ END $tooltip='REJECT'; $rulecolor=$color{'color16'}; } - print""; + + print < +    + +END + #Get Protocol my $prot; if ($$hash{$key}[8]){ @@ -2434,6 +2467,7 @@ END }else{ push (@protocols,$Lang::tr{'all'}); } + my $protz=join(",",@protocols); if($protz eq 'ICMP' && $$hash{$key}[9] ne 'All ICMP-Types' && $$hash{$key}[14] ne 'cust_srvgrp'){ &General::readhasharray("${General::swroot}/fwhosts/icmp-types", \%icmptypes); @@ -2487,17 +2521,20 @@ END } #LOGGING print< - + + END #TARGET &getcolor($$hash{$key}[5],$$hash{$key}[6],\%customhost); print< + - - - + + + + END if (exists $$hash{$key-1}){ print<
- - - - +
END }else{ - print""; + print""; } + if (exists $$hash{$key+1}){ print<
- - - -
+ + END }else{ - print""; + print""; } #REMARK if ($optionsfw{'SHOWREMARK'} eq 'on' && $$hash{$key}[16] ne ''){ - print""; - print""; + print < + + + + +END } + if ($$hash{$key}[18] eq 'ON'){ #TIMEFRAME if ($$hash{$key}[18] eq 'ON'){ @@ -2604,7 +2669,7 @@ END my $weekdays=join(",",@days); if (@days){ print""; - print""; + print""; } } }
+ # + + $Lang::tr{'protocol'} + + $Lang::tr{'fwdfw source'} + + Log + + $Lang::tr{'fwdfw target'} + + $Lang::tr{'fwdfw action'} +
+ $key  + $ruletype
- - - -
+
+ + + + +
+
END #Is this a DNAT rule? if ($$hash{$key}[31] eq 'dnat' && $$hash{$key}[28] eq 'ON'){ @@ -2506,7 +2543,7 @@ END $$hash{$key}[30]=~ tr/|/,/; print": $$hash{$key}[30]"; } - print"
->"; + print"
->"; } if ($$hash{$key}[5] eq 'ipfire'){ $ipfireiface='Interface'; @@ -2542,54 +2579,82 @@ END $gif="/images/off.gif" } print<
- - - -
- - - -
- - - -
- - - -
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + +
+
   $$hash{$key}[16]
  +   $$hash{$key}[16] +
   $weekdays   $$hash{$key}[26] - $$hash{$key}[27]
   $weekdays   $$hash{$key}[26] - $$hash{$key}[27]