From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4bQvs10K8rz36VL for ; Mon, 23 Jun 2025 17:17:09 +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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4bQvrx3w7Fz3368 for ; Mon, 23 Jun 2025 17:17:05 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4bQvrw5cBqz4kG; Mon, 23 Jun 2025 17:17:04 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4bQvrw2K6YzTh9w; Mon, 23 Jun 2025 17:17:04 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Cc: dietzmann@brecht-schule.hamburg, Michael Tremer Subject: [PATCH 4/5] fwhosts.cgi: Move the tooltip into the usage counter Date: Mon, 23 Jun 2025 17:16:57 +0000 Message-Id: <20250623171658.530138-4-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250623171658.530138-1-michael.tremer@ipfire.org> References: <20250623171658.530138-1-michael.tremer@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes This will clutter the page less as we don't have any good icon sets. Signed-off-by: Michael Tremer --- html/cgi-bin/fwhosts.cgi | 42 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 69970a840..953f81e5f 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -1932,7 +1932,7 @@ sub viewtablenet }else{ print< - $Lang::tr{'name'}$Lang::tr{'fwhost netaddress'}$Lang::tr{'remark'}$Lang::tr{'used'} + $Lang::tr{'name'}$Lang::tr{'fwhost netaddress'}$Lang::tr{'remark'}$Lang::tr{'used'} END } my $count=0; @@ -1953,11 +1953,7 @@ END my $colnet="$customnetwork{$key}[1]/".&General::subtocidr($customnetwork{$key}[2]); my $netcount=&getnetcount($customnetwork{$key}[0]); my $netusedin=&getusedin($customnetwork{$key}[0]); - my $htmlparttouse=""; - if ($netusedin) { - $htmlparttouse = ""; - } - print"
$customnetwork{$key}[0]".&getcolor($colnet)."$customnetwork{$key}[3]$netcount x$htmlparttouse"; + print"$customnetwork{$key}[0]".&getcolor($colnet)."$customnetwork{$key}[3]$netcount x"; print< @@ -2091,7 +2087,7 @@ sub viewtablehost }else{ print< - $Lang::tr{'name'}$Lang::tr{'fwhost ip_mac'}$Lang::tr{'remark'}$Lang::tr{'used'} + $Lang::tr{'name'}$Lang::tr{'fwhost ip_mac'}$Lang::tr{'remark'}$Lang::tr{'used'} END } my $count=0; @@ -2112,12 +2108,9 @@ END my $hostcount=0; $hostcount=&gethostcount($customhost{$key}[0]); my $hostusedin=&getusedin($customhost{$key}[0]); - my $htmlparttouse=""; - if ($hostusedin) { - $htmlparttouse = ""; - } - print"$customhost{$key}[0]".&getcolor($ip)."$customhost{$key}[3]$hostcount x$htmlparttouse"; - print<$customhost{$key}[0]$color$customhost{$key}[3]$hostcount x @@ -2192,11 +2185,8 @@ sub viewtablegrp print "
$grpname   "; print " $Lang::tr{'remark'}:  $remark   " if ($remark ne ''); my $netgrpcount=&getnetcount($grpname); - print "$Lang::tr{'used'}: $netgrpcount x "; my $groupusedin=&getusedin($grpname); - if ($groupusedin) { - print ""; - } + print "$Lang::tr{'used'}: $netgrpcount x"; if($netgrpcount == '0') { print""; @@ -2335,10 +2325,7 @@ sub viewtablelocationgrp # Get group count. my $locationgrpcount=&getlocationcount($grpname); my $locationusedin=&getlocusedin($grpname); - print "$Lang::tr{'used'}: $locationgrpcount x "; - if ($locationusedin) { - print ""; - } + print "$Lang::tr{'used'}: $locationgrpcount x"; # Only display delete icon, if the group is not used by a firewall rule. if($locationgrpcount == '0') { print"
\n"; @@ -2459,7 +2446,7 @@ sub viewtableservice &General::readhasharray("$fwconfigout", \%fwout); print< - $Lang::tr{'fwhost srv_name'}$Lang::tr{'fwhost prot'}$Lang::tr{'fwhost port'}ICMP$Lang::tr{'fwhost used'} + $Lang::tr{'fwhost srv_name'}$Lang::tr{'fwhost prot'}$Lang::tr{'fwhost port'}ICMP$Lang::tr{'fwhost used'} END my $col=''; foreach my $key (sort { ncmp($customservice{$a}[0],$customservice{$b}[0])} keys %customservice) @@ -2481,14 +2468,10 @@ END #Neuer count $srvcount=&getsrvcount($customservice{$key}[0]); my $serviceusedin=&getsrvusedin($customservice{$key}[0]); - my $htmlparttouse=""; - if ($serviceusedin) { - $htmlparttouse=""; - } if($customservice{$key}[3] eq 'All ICMP-Types'){print $Lang::tr{'fwdfw all icmp'};} elsif($customservice{$key}[3] ne 'BLANK'){print $customservice{$key}[3];} print<$srvcount x$htmlparttouse + $srvcount x @@ -2560,11 +2543,8 @@ sub viewtableservicegrp if($count >0){print"";$count=1;} print "
$grpname    "; print "$Lang::tr{'remark'}:  $remark " if ($remark ne ''); - print "  $Lang::tr{'used'}: $grpcount x "; my $srvgrpusedin=&getsrvusedin($customservicegrp{$key}[0]); - if ($srvgrpusedin) { - print ""; - } + print "  $Lang::tr{'used'}: $grpcount x"; if($grpcount == '0') { print""; -- 2.39.5