From patchwork Tue Nov 17 06:29:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 3665 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyW2bp2z3wlJ for ; Tue, 17 Nov 2020 06:29:23 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyS00Klz1k7; Tue, 17 Nov 2020 06:29:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CZwyR6N3Kz2ygN; Tue, 17 Nov 2020 06:29:19 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyQ4zMnz2xlV for ; Tue, 17 Nov 2020 06:29:18 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyN4Qzmzj7 for ; Tue, 17 Nov 2020 06:29:16 +0000 (UTC) Received: (qmail 10993 invoked from network); 17 Nov 2020 06:29:15 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 17 Nov 2020 06:29:15 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 1/4] zoneconf.cgi: Clean up HTML output Date: Tue, 17 Nov 2020 07:29:01 +0100 Message-Id: <20201117062904.1547-1-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1605594556; a=rsa-sha256; cv=none; b=aZ04YSB8GWIGOxfyUN9soYIIHOeVml/OtYL07vHF+ToyDrEKCLvkuOXpIahq3raq02fGJy F++QoGl8JhPg0sSZwD7xghiNV5CqRhM6JYpwk4LhcBJAfA0oiz7U+rslpK1BRB7mDim+iC cHfT9vDTrhK8s90kujdL8bYhCFjaiknb3PCbwbDjRndkayEkToiOwN+jHbzsA76PH4TBCF bjPUtVcaWevO7GCwyZ9i+3/J6wKxF+VU+Ue8O9BVsqozZrXpnizhL/FJ28gzlzpZAZF4zn SEg7aQeMj/zqmLwHpY9chobAiR7lgKYPKdduHTYhbJ1xABatrO1jaZshhyGlCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1605594556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=PuEeBYJtYvXrp3GiKc1ch9t155kxYwmD4LCmn1Vot/0=; b=iOYu5aNg+6ZN5/cbcv9EicLRTT/5QGBiEAgNhDoZxrKEzRr13VtW4Opz3peIDXsIMtQ6j1 9EG8sQKNJQhPZrLiFldjGYlSqz69ILqo+mdiCpxb3UwVWM4bJ3A0fLDSNfHUIAYOG4Pkfd fZZaqrRX+BNgOkoN9lM75W8wPxodARnVlLPtN1coUH92m+UqbAA4iOfRhiPBcEAYl/8J+D Int6HJK/xsQaTjfV8CAtTaGGH/cg7dq0Brs+0+hnkEU1HPl9x2NTCdcmlA2Y8UjwbrTBz6 vEp5gLpWLZZkMW4n+1QLx0tdgQAD9WSvMmp8F20KsufkKfSy4+vfu5mfy1dNMw== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [0.69 / 11.00]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.00), ip: 185.26.156.147(0.00)]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; BAYES_HAM(-3.00)[99.99%] X-Rspamd-Queue-Id: 4CZwyN4Qzmzj7 Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de 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 adds missing brackets, cleans up the indentation and removes unnecessary CSS. Signed-off-by: Leo-Andres Hofmann Reviewed-by: Michael Tremer --- html/cgi-bin/zoneconf.cgi | 46 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi index d99a3e611..067410582 100644 --- a/html/cgi-bin/zoneconf.cgi +++ b/html/cgi-bin/zoneconf.cgi @@ -38,10 +38,6 @@ my $css = < - - + END ; @@ -332,7 +324,7 @@ foreach (@zones) { my $red_restricted = ($uc eq "RED" && ! ($red_type eq "STATIC" || $red_type eq "DHCP")); if ($red_restricted) { - print ""; + print "\t\t\n"; next; # We're done here } @@ -350,7 +342,7 @@ foreach (@zones) { } print <$uc
+
"; +print "\t\n"; my $slightlygrey = ""; @@ -370,7 +362,8 @@ foreach (@nics) { my $nic = $_->[1]; my $wlan = $_->[2]; - print ""; + print "\t\n"; + print "\t\t\n"; # Iterate through all zones and check if the current NIC is assigned to it foreach (@zones) { @@ -393,7 +386,12 @@ foreach (@nics) { $checked = "checked"; } - print ""; + print < + + +END +; next; # We're done here } } @@ -432,19 +430,19 @@ foreach (@nics) { my $vlan_disabled = ($wlan) ? "disabled" : ""; print < - - - + END ; } - print ""; + print "\t\n"; if ($slightlygrey) { $slightlygrey = ""; From patchwork Tue Nov 17 06:29:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 3666 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyW2hF3z3wlY for ; Tue, 17 Nov 2020 06:29:23 +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 "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyS1dHTz1qL; Tue, 17 Nov 2020 06:29:20 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CZwyS003tz2ygg; Tue, 17 Nov 2020 06:29:19 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyQ4wMDz2xSc for ; Tue, 17 Nov 2020 06:29:18 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyP4WHxz1k7 for ; Tue, 17 Nov 2020 06:29:17 +0000 (UTC) Received: (qmail 11015 invoked from network); 17 Nov 2020 06:29:16 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 17 Nov 2020 06:29:16 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 2/4] zoneconf.cgi: Make output HTML 5 standard compliant Date: Tue, 17 Nov 2020 07:29:02 +0100 Message-Id: <20201117062904.1547-2-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201117062904.1547-1-hofmann@leo-andres.de> References: <20201117062904.1547-1-hofmann@leo-andres.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1605594557; a=rsa-sha256; cv=none; b=h5ZtdsoyH19LdHprCucywU3JYIfikBqPir+FFiEgu8ZSe3Ji3xNr2n2lSfZBhQc2Ov1G8q rPumFeLae2c9/cSRQB+FMqI0fPx+ATannbTbmdLGcLeHfQPX+tw/EpOSjpNJRzWrtB1ZD0 jhmgkAl2mqQB6Jyyy3WP5oVdCovY0VelRoSF4adn4a/PUidI39sJdB6Lg3hbnAIjTi+3Sn 3Orwez3kE3WjapljW6dV3DzS3fOHuCBed9Ep6huP9iO/TA3yFK7FuhPC0P2TWaD1NOih3A k48ayukXc3dfERFkEOXCS3jvRf/OPMgMl7VEALMGHxPbf9ecl4NilFhSvjAe1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1605594557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zeinp34P3gUe32wJysgz7/t/pkx8EY+7/Ax2FBm8BoU=; b=RdgjMcHzb9vwI+FbCEQbcTP5s/h3BrxFk/yOdy91PRQGjCyfmKLGUqIuiAQlsAWvyrr5WM 0wYm10y66RFV0+eYD4+M1/AsazAV271SJP41j8dR1AbCMaE52qszkI2heBpa6nBpY4WT0F vhSqDXAG/jDxMy2ka2S5yFL6oxmXnesPJRCE5HlSqlrmO5Cc1Jftt/ApRMGu/yLaO/Y9lM eXXW9o4BXGRytTQZQVXu3GOXAp0F4QiHbg09TOPgjl4ESlyi0k8V323zofre/wfWyzAqhl 6gjp1QPecuOoLLqSiyH+hDqcy9yqtMS4PHo3elqM/iOkat5D57PpF/Y9cqkOAg== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [0.69 / 11.00]; ARC_NA(0.00)[]; BAYES_HAM(-3.00)[99.99%]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.00), ip: 185.26.156.147(0.00)]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1] X-Rspamd-Queue-Id: 4CZwyP4WHxz1k7 Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de 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 fixes two minor violations of the HTML standard: - elements may not contain nested "; + print "$VALIDATE_error

$Lang::tr{'back'}\n"; &Header::closebox(); &Header::closebigbox(); @@ -388,7 +384,7 @@ foreach (@nics) { print < - + END ; @@ -431,12 +427,12 @@ END print < - - + END ; From patchwork Tue Nov 17 06:29:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo-Andres Hofmann X-Patchwork-Id: 3667 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyX535qz3wlJ for ; Tue, 17 Nov 2020 06:29:24 +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 "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyT1HQrz1qg; Tue, 17 Nov 2020 06:29:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CZwyT0pJhz2yfw; Tue, 17 Nov 2020 06:29:21 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyR0xmCz2y3s for ; Tue, 17 Nov 2020 06:29:19 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyQ2vHHz1kr for ; Tue, 17 Nov 2020 06:29:18 +0000 (UTC) Received: (qmail 11037 invoked from network); 17 Nov 2020 06:29:17 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 17 Nov 2020 06:29:17 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 3/4] zoneconf.cgi: Improve CSS Date: Tue, 17 Nov 2020 07:29:03 +0100 Message-Id: <20201117062904.1547-3-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201117062904.1547-1-hofmann@leo-andres.de> References: <20201117062904.1547-1-hofmann@leo-andres.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1605594558; a=rsa-sha256; cv=none; b=hgP29Q2FEU4w4Vn5ERjY3/ddWzdXFL0j7aln12L9upm7l/L+2HFGPSqB3bXXeOlKmreVhi UpC1jjmGb3ypNyHPuADh74qiiotcUwiA5mmhBGwAQzF4TzdzmwPAKe3gjKsLP+TRDm8UEf FGW5kvQJpL+ZnMOQge5CK3n7/HH5dwelieFSkw+rFvnV6iQ2Oqp4Ch3v77jIbTwE59zUur tD4vbDMbCLZDYBDsWpOiICj2YeM7LysLfUYcZD37sS70n+QCuVhAhFDGq2zdxcq2uITNnf DQNwQeL09MOvpBWXyJnyMUCuHVo7tSp3qTM6AOuJScghllCnztjUvcv39UuQoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1605594558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WBjER5TTufB7e5MlpNyT1+vwhLnijf6yOMo2at7ioKE=; b=B3hoJvvMV8N+aF8ZcMopm6MvXMesYmlEW2UR0rr0ext4PqkDf+a1v/5Opu/6cUlRbiKs72 VdxlZSo0uzssYDQdKiYLedBYqcNZaEFiswmikxH3sjvZ2qEuhmAknlrWJxOwNPW4kub2qH 3XbvFof3Qwey/YnbB25gg0ekLTjUMgaKqqlczKdwmRHVk3pDIGf82Xq514Gv8bSCF9SSVN 57jh43R5V+q3F+55lR9OY05xBTmvEHMRvxrlO23OxSGmxsYXF5fYK6I+zatwdgjBrpJ18X WfPFjv3bunQYk/9ivat5xDwhBnASHvKUvIqRfZxv0ljvAMaXB65uluoIiPTqYQ== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [0.69 / 11.00]; ARC_NA(0.00)[]; BAYES_HAM(-3.00)[99.99%]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.00), ip: 185.26.156.147(0.00)]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1] X-Rspamd-Queue-Id: 4CZwyQ2vHHz1kr Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de 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" - Add an element id so that the styling only affects the zone table - Alternating row colors are now generated by CSS, remove unneeded Perl code Signed-off-by: Leo-Andres Hofmann --- html/cgi-bin/zoneconf.cgi | 73 ++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi index 2346aa829..ef361af95 100644 --- a/html/cgi-bin/zoneconf.cgi +++ b/html/cgi-bin/zoneconf.cgi @@ -28,63 +28,64 @@ require "${General::swroot}/header.pl"; my $css = < - table { + table#zoneconf { width: 100%; border-collapse: collapse; table-layout: fixed; } - tr { + #zoneconf tr { height: 4em; } - td.narrow { - width: 11em; + #zoneconf td { + padding: 5px 10px; + border: 0.5px solid black; + text-align: center; } - td { - padding: 5px; - padding-left: 10px; - padding-right: 10px; - border: 0.5px solid black; + /* dark grey header cells */ + #zoneconf td.heading { + background-color: grey; + color: white; + } + #zoneconf td.heading::first-line { + font-weight: bold; + line-height: 1.6; } - td.slightlygrey { - background-color: #F0F0F0; + /* narrow left column */ + #zoneconf tr > td:first-child { + width: 11em; } - td.h { - background-color: grey; - color: white; - font-weight: 800; + /* alternating row background color */ + #zoneconf tr:nth-child(2n+3) { + background-color: #F0F0F0; } - td.green { + #zoneconf td.green { background-color: $Header::colourgreen; } - td.red { + #zoneconf td.red { background-color: $Header::colourred; } - td.blue { + #zoneconf td.blue { background-color: $Header::colourblue; } - td.orange { + #zoneconf td.orange { background-color: $Header::colourorange; } - td.topleft { - background-color: white; + #zoneconf td.topleft { + background-color: $Header::pagecolour; border-top-style: none; border-left-style: none; } - td.textcenter { - text-align: center; - } - input.vlanid { width: 4em; } @@ -299,9 +300,9 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{"save"}) { print < -
+
$uc ($red_type)$uc ($red_type)$uc
$nic
$mac
$nic
$mac
+ + +
+
- + END ; @@ -320,7 +321,7 @@ foreach (@zones) { my $red_restricted = ($uc eq "RED" && ! ($red_type eq "STATIC" || $red_type eq "DHCP")); if ($red_restricted) { - print "\t\t\n"; + print "\t\t\n"; next; # We're done here } @@ -338,7 +339,7 @@ foreach (@zones) { } print <$uc
+
\n"; -my $slightlygrey = ""; - foreach (@nics) { my $mac = $_->[0]; my $nic = $_->[1]; my $wlan = $_->[2]; print "\t\n"; - print "\t\t\n"; + print "\t\t\n"; # Iterate through all zones and check if the current NIC is assigned to it foreach (@zones) { @@ -383,7 +382,7 @@ foreach (@nics) { } print < + END @@ -426,7 +425,7 @@ END my $vlan_disabled = ($wlan) ? "disabled" : ""; print < + \n"; - - if ($slightlygrey) { - $slightlygrey = ""; - } else { - $slightlygrey = "slightlygrey"; - } } print < X-Patchwork-Id: 3668 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 "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyY64q6z3wlY for ; Tue, 17 Nov 2020 06:29: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 "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyT22Lhz1qv; Tue, 17 Nov 2020 06:29:21 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CZwyT1TJ9z2ygf; Tue, 17 Nov 2020 06:29:21 +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 "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CZwyR4Ycbz2y3s for ; Tue, 17 Nov 2020 06:29:19 +0000 (UTC) Received: from arche.uberspace.de (arche.uberspace.de [185.26.156.147]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4CZwyQ5D2rzj7 for ; Tue, 17 Nov 2020 06:29:18 +0000 (UTC) Received: (qmail 11069 invoked from network); 17 Nov 2020 06:29:18 -0000 Received: from localhost (HELO localhost) (127.0.0.1) by arche.uberspace.de with SMTP; 17 Nov 2020 06:29:18 -0000 From: Leo-Andres Hofmann To: development@lists.ipfire.org Subject: [PATCH 4/4] zoneconf.cgi: Add NIC selection highlighting Date: Tue, 17 Nov 2020 07:29:04 +0100 Message-Id: <20201117062904.1547-4-hofmann@leo-andres.de> X-Mailer: git-send-email 2.27.0.windows.1 In-Reply-To: <20201117062904.1547-1-hofmann@leo-andres.de> References: <20201117062904.1547-1-hofmann@leo-andres.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1605594558; a=rsa-sha256; cv=none; b=iCziCR6M0CbkZ7PD1xhTFZDg95Roe3u55cH9P73rvkyhD7rgCa4ldI055/zO7j+FnaJ3h6 gtznEw1w+3cautFvFasbMdSQX47YycAim6eGXUcYxmYNg/giwl1Touc6q5JIZznwaLKUwL UizwaKoSgy3NIc5jbK9SMXlVTMML7yMaXdSmtYP/f4+2Vu3bq2KvxtKQ9hil1/omhX2dSf mTttVlKkOkUUztplxo8FE6KDwg4B0NwVJnhOyjwg0cvjr/uz549JK/gLpmAFKffiEYecXb GFZz/nJi4KPApi/tY47R1wJKBIBm/ArfxFVcJ4k3gjfo5MBxnjd5Ye2Tt5v2kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1605594558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e4ehhl6enoAm0gUSm4wxG2GvxVjCUAL5yIdR1+vVz4M=; b=He29LwXJZ6+6koYjPMNQj7VytfTRkoTJD679r8I/05RHzP1Q5qkn7uyZXuzBuNlkxIo8P6 1SJ08Bo6s+cj00Xpl2k0edwS5bgEWfu3lANYxYd4bnLSduFkJJl1vkQ0cSXYmRXM9nuwM9 maAPZtgUGntF/nM0A6L8uyZhmC1N2tSV2xngrxCWpImfRdGa5nEB9F7ycB3wszK2jCThik Eh5K2OcIXUZCNMg5j06RGUneuYhu0+4l3IsOJJVhw40oOYk2WHAX6OoEe2CGrT2OFukM3D kptBhLOLhTeVP1lBKwPgNc54g1t7jlHqlPRzVuj/OiW4s+iHeINoLNNdaOsXNA== X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [0.69 / 11.00]; ARC_NA(0.00)[]; BAYES_HAM(-3.00)[99.99%]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; IP_REPUTATION_HAM(-0.01)[asn: 205766(0.00), country: DE(-0.00), ip: 185.26.156.147(0.00)]; DMARC_NA(0.00)[leo-andres.de]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:205766, ipnet:185.26.156.0/24, country:DE]; RCVD_COUNT_TWO(0.00)[2]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1] X-Rspamd-Queue-Id: 4CZwyQ5D2rzj7 Authentication-Results: mail01.ipfire.org; dkim=none; dmarc=none; spf=pass (mail01.ipfire.org: domain of hofmann@leo-andres.de designates 185.26.156.147 as permitted sender) smtp.mailfrom=hofmann@leo-andres.de 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 improves the usability of the zone configuration by marking assigned NICs in the zone color. The highlighting is initially applied to the static HTML output, and JavaScript is used to follow changes made by the user. Signed-off-by: Leo-Andres Hofmann --- config/rootfiles/common/web-user-interface | 1 + html/cgi-bin/zoneconf.cgi | 21 +++++--- html/html/include/zoneconf.js | 56 ++++++++++++++++++++++ 3 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 html/html/include/zoneconf.js diff --git a/config/rootfiles/common/web-user-interface b/config/rootfiles/common/web-user-interface index 44856fcc2..3eac4411a 100644 --- a/config/rootfiles/common/web-user-interface +++ b/config/rootfiles/common/web-user-interface @@ -308,6 +308,7 @@ srv/web/ipfire/html/images/wakeup.gif srv/web/ipfire/html/images/window-new.png srv/web/ipfire/html/include srv/web/ipfire/html/include/snortupdateutility.js +srv/web/ipfire/html/include/zoneconf.js srv/web/ipfire/html/index.cgi srv/web/ipfire/html/redirect-templates srv/web/ipfire/html/redirect-templates/legacy diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi index ef361af95..0914ceb78 100644 --- a/html/cgi-bin/zoneconf.cgi +++ b/html/cgi-bin/zoneconf.cgi @@ -26,7 +26,7 @@ require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; -my $css = < table#zoneconf { width: 100%; @@ -101,6 +101,8 @@ my $css = < + + END ; @@ -151,7 +153,7 @@ foreach (@nics) { } } -&Header::openpage($Lang::tr{"zoneconf title"}, 1, $css); +&Header::openpage($Lang::tr{"zoneconf title"}, 1, $extraHead); &Header::openbigbox('100%', 'center'); ### Evaluate POST parameters ### @@ -364,6 +366,7 @@ foreach (@nics) { foreach (@zones) { my $uc = uc $_; my $dev_name = $ethsettings{"${uc}_DEV"}; + my $highlight = ""; if ($dev_name eq "") { # Again, skip the zone if it is not activated next; @@ -379,11 +382,12 @@ foreach (@nics) { if ($mac eq $ethsettings{"${uc}_MACADDR"}) { $checked = "checked"; + $highlight = $_; } print < - + END ; @@ -424,9 +428,14 @@ END $access_selected{"NONE"} = ($access_selected{"NATIVE"} eq "") && ($access_selected{"VLAN"} eq "") ? "selected" : ""; my $vlan_disabled = ($wlan) ? "disabled" : ""; + # If the interface is assigned, hightlight table cell + if ($access_selected{"NONE"} eq "") { + $highlight = $_; + } + print < -
$uc ($red_type)$uc ($red_type)$uc
$nic
$mac
$nic
$mac
+ +