]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
ids.cgi: Colourize network zones
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 24 Dec 2018 12:18:14 +0000 (13:18 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 24 Dec 2018 12:18:14 +0000 (13:18 +0100)
Colourize the network with the proper colour.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/ids.cgi

index f2362d2dc4c0dc032d9fb046f8b6bb5e5989cd87..df8810a0bf2403053a107b6fd2bab10d017b693d 100644 (file)
@@ -88,6 +88,14 @@ unless (-f "$rulessettingsfile") { &IDS::create_empty_file($rulessettingsfile);
 unless (-f "$ignoredfile") { &IDS::create_empty_file($ignoredfile); }
 unless (-f "$whitelistfile" ) { &IDS::create_empty_file($whitelistfile); }
 
+# Hash which contains the colour code of a network zone.
+my %colourhash = (
+       'red' => $Header::colourred,
+       'green' => $Header::colourgreen,
+       'blue' => $Header::colourblue,
+       'orange' => $Header::colourorange
+);
+
 &Header::showhttpheaders();
 
 #Get GUI values
@@ -787,7 +795,8 @@ foreach my $zone (@network_zones) {
        }
 
        print "<td class='base' width='25%'>\n";
-       print "<input type='checkbox' name='ENABLE_IDS_$zone_upper' $checked_input>$Lang::tr{$zone}\n";
+       print "<input type='checkbox' name='ENABLE_IDS_$zone_upper' $checked_input>\n";
+       print "&nbsp$Lang::tr{'enabled on'}<font color='$colourhash{$zone}'> $Lang::tr{$zone}</font>\n";
        print "</td>\n";
 }