From patchwork Mon Feb 13 17:55:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 6515 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PFsSY2kq5z3ws7 for ; Mon, 13 Feb 2023 17:55:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PFsSX14c5zT0; Mon, 13 Feb 2023 17:55:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PFsSW6Z61z2xLQ; Mon, 13 Feb 2023 17:55:23 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PFsSV3TpPz2xPH for ; Mon, 13 Feb 2023 17:55:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PFsST0v9BzM7; Mon, 13 Feb 2023 17:55:21 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1676310921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Bw0Xd637PAUWbwNf0m9H35Leu98EcM1lVZXOQqUGc0E=; b=bLZprT59Z7UACjKggzXjTRlO2ELYCcmjqmN3FraBrVmVgIAtn2TfUcys5LgnzJu4XUtG+Q omRGhJn23r+jhnDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1676310921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Bw0Xd637PAUWbwNf0m9H35Leu98EcM1lVZXOQqUGc0E=; b=gwqCS+0QafhMW+J/0YIx4zQ1r9O71iHsVp7SS+qKTpnW53X8m8Y6pJmrhL0yyiqF+HAQOX 3iFLEcfnFTEokby+2eSF85IoXpSIbaAh3wvI5K7OOPTQTJ+82mpuIPh4961q3RPJFz+/d0 O4lxP6lKuRYn6RVEoEZMWjEY47FcEYYysLzmydBLd3U2++C7HPMcFWJFLZJbBAnPKk+ULQ 3IdY9YTop9B8B1KvEkpfokmggQLbjym3/H+Rxq0SUktT8V8wdhk47D+uBr1crEIjVAHI0B KCcUykoCJfwe1fKKjQGIeQyVHOMXRRnxwjGTYAO+HbTtXXtLs4t26u5PHZmaNg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 1/2] dhcp.cgi: Fix for bug#10629 - update bgcolor to css Date: Mon, 13 Feb 2023 18:55:14 +0100 Message-Id: <20230213175515.18840-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - bgcolor was deprecated in HTML 4.01 and is not supported by HTML 5 - The orange colour for IP's that are outside the IPFire green and blue subnets does not work on any browser I am using. - I used the CSS approach that @Leo used in the Zone Configuration cgi page - This patch changes all existing bgcolor entries to the css based background-color - Tested on my vm testbed and confirmed to work. The Orange colour for IP's outside of the subnet now shows up. Tested-by: Adolf Belka Signed-off-by: Adolf Belka Reviewed-by: Bernhard Bitsch --- html/cgi-bin/dhcp.cgi | 44 ++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index 125713285..2d162b204 100644 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -113,6 +113,27 @@ foreach my $itf (@ITFs) { &General::readhash("${General::swroot}/time/settings", \%timesettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color); +###--- HTML HEAD ---### +my $extraHead = < + .row-color20 { + background-color: $color{'color20'}; + } + .row-color22 { + background-color: $color{'color22'}; + } + .row-colouryellow { + background-color: $Header::colouryellow; + } + .cell-orange { + background-color: orange; + } + +END +; +###--- END HTML HEAD ---### + + #Get GUI values &Header::getcgihash(\%dhcpsettings); @@ -547,7 +568,8 @@ if ($dhcpsettings{'ACTION'} eq '' ) { # First launch from GUI $dhcpsettings{'ADVOPT_ENABLED'} = 'on'; } -&Header::openpage($Lang::tr{'dhcp configuration'}, 1, ''); +### START PAGE ### +&Header::openpage($Lang::tr{'dhcp configuration'}, 1, $extraHead); &Header::openbigbox('100%', 'left', '', $errormessage); if ($errormessage) { @@ -843,11 +865,11 @@ foreach my $line (@current1) { } if ($dhcpsettings{'KEY1'} eq $key) { - print ""; + print ""; } elsif ($key % 2) { - print ""; + print ""; } else { - print ""; + print ""; } print <"; - $col="bgcolor='${Header::colouryellow}'"; + $col="class='row-colouryellow'"; } elsif ($key % 2) { print ""; - $col="bgcolor='$color{'color20'}'"; + $col="class='row-color20'"; } else { print ""; - $col="bgcolor='$color{'color22'}'"; + $col="class='row-color22'"; } my $TAG0 = ''; my $TAG1 = ''; @@ -1091,12 +1113,12 @@ foreach my $line (@current2) { $TAG3 = ''; } if ($ipoutside{$temp[1]} > 0) { - $TAG4 = "bgcolor='orange'" if ($dhcpsettings{'KEY2'} ne $key); + $TAG4 = "class='cell-orange'" if ($dhcpsettings{'KEY2'} ne $key); } print <$TAG2$temp[0]$TAG3 -$TAG0$temp[1]$TAG1 +$TAG0$temp[1]$TAG1 $temp[6]  $temp[3]  $temp[4]  @@ -1153,8 +1175,8 @@ print <   -   - $Lang::tr{'ip address outside subnets'} +   + $Lang::tr{'ip address outside subnets'}     $dup