From patchwork Tue Feb 21 13:11:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 6583 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PLfns5qdmz3x1t for ; Tue, 21 Feb 2023 13:12:01 +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 4PLfnq5CDpzkT; Tue, 21 Feb 2023 13:11:59 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PLfnq3vtwz2xRJ; Tue, 21 Feb 2023 13:11:59 +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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PLfnn2v2bz2xFK for ; Tue, 21 Feb 2023 13:11:57 +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 4PLfnm4bTGzVw; Tue, 21 Feb 2023 13:11:56 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1676985116; 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=cGi99A/9JTmCviojunIR9xfkj4ATwJMfHdSLIwbvMmo=; b=hHRpcOv51Hf6FxYicOSP5pEBWoPvqRgQMcMUzEq3dRoON38G9a5zTBYL0N1beRIQ6aT+Dq gxYIQdkGy27X1ZCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1676985116; 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=cGi99A/9JTmCviojunIR9xfkj4ATwJMfHdSLIwbvMmo=; b=olehywNmzUnreS235FUDlHmQ7UBWrdafm3XI4DjfzFbpIa4zOkq9bjvbTkW93hyfjSko2a 6YSfzcUv1QdSbX3PQzqmi4cCWXRPeg/nhhfjkJcKtxb5pDikWE8kiIkb8T0iFqaS74nWVr 7G00sKD1oTWFw964U3fQy6KGg9UcFyguM21kdKgYEJO7CIgUM/8pU/l/eoVrZ1NY7wYArL KWfPXNDFjjE5cUlXgieso1XtkEwW0ZLwadKlGau24v6SszXPvp4bC6wzoCmDFCS2oy1I1Q 2u68DdYSamF1hu43QtAkOKxj0BzSEjAyo3IbzdXiUGyJE7TzCtrZcLxcS4mNHg== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] updatexlrator.cgi: Fixes bug#13024 - Table style rendering bug Date: Tue, 21 Feb 2023 14:11:54 +0100 Message-Id: <20230221131154.4579-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" - This is happening due to the use of bgcolor which has been deprecated since HTML4.01 and is no longer supported in HTML5 - Similar approach used here as was used in the same fix for the dhcp.cgi page - CSS based approach utilised. - Partially tested in my vm testbed. The percentage bar works withg no problems. The table could not be confirmed as in my testbed I don't have updatexlrator running as my updates are all based on https and not http. - The table will need to be confirmed by the bug reporter or someone else that uses updatexlrator Fixes: Bug#13024 Signed-off-by: Adolf Belka --- html/cgi-bin/updatexlrator.cgi | 64 +++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/html/cgi-bin/updatexlrator.cgi b/html/cgi-bin/updatexlrator.cgi index fb3959457..47d3cca42 100644 --- a/html/cgi-bin/updatexlrator.cgi +++ b/html/cgi-bin/updatexlrator.cgi @@ -105,6 +105,46 @@ my @metadata=(); &General::readhash("${General::swroot}/proxy/settings", \%proxysettings); &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-table1colour { + background-color: $Header::table1colour; + } + .row-table2colour { + background-color: $Header::table2colour; + } + .percent-box { + border-style: solid; + border-width: 1px; + border-color: #a0a0a0; + width: 100px; + height: 10px; + } + .percent-bar { + background-color: #a0a0a0; + border-style: solid; + border-width: 1px; + border-color: #e2e2e2; + } + .percent-space { + background-color: #e2e2e2; + border-style: solid; + border-width: 1px; + border-color: #e2e2e2; + } + +END +; +###--- END HTML HEAD ---### + + $xlratorsettings{'ACTION'} = ''; $xlratorsettings{'ENABLE_LOG'} = 'off'; $xlratorsettings{'PASSIVE_MODE'} = 'off'; @@ -369,7 +409,7 @@ $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selecte &Header::showhttpheaders(); -&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, ''); +&Header::openpage($Lang::tr{'updxlrtr configuration'}, 1, $extraHead); &Header::openbigbox('100%', 'left', '', $errormessage); @@ -532,9 +572,9 @@ END $id++; if ($id % 2) { - print "\n"; } + print "\n"; } else { - print "\n"; } + print "\n"; } $filesize = $size_updatefile; 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; @@ -823,9 +863,9 @@ foreach (@vendors) $id++; if ($id % 2) { - print "\n"; } + print "\n"; } else { - print "\n"; } + print "\n"; } print " "; @@ -1162,9 +1202,9 @@ END $id++; if ($id % 2) { - print "\n"; } + print "\n"; } else { - print "\n"; } + print "\n"; } $filesize = $size_updatefile; 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/; @@ -1522,22 +1562,20 @@ sub savesettings sub percentbar { my $percent = $_[0]; - my $fg = '#a0a0a0'; - my $bg = '#e2e2e2'; if ($percent =~ m/^(\d+)%$/ ) { print < + END ; if ($percent eq "100%") { - print "
" + print "" } elsif ($percent eq "0%") { - print "" + print "" } else { - print "" + print "" } print <