Message ID | 20240803223627.123287-1-stephen@firemypi.org |
---|---|
State | New |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> 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) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4WbyJ302wHz3wwH for <patchwork@web04.haj.ipfire.org>; Sat, 3 Aug 2024 22:37:22 +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 RSA-PSS (4096 bits) server-digest SHA256 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "E5" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4WbyHz470gz1DR; Sat, 3 Aug 2024 22:37:19 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4WbyHz2CcMz344v; Sat, 3 Aug 2024 22:37: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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4WbyHw5kw2z344v for <development@lists.ipfire.org>; Sat, 3 Aug 2024 22:37:16 +0000 (UTC) Received: from resqmta-c2p-570503.sys.comcast.net (resqmta-c2p-570503.sys.comcast.net [IPv6:2001:558:fd00:56::5]) (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 did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4WbyHt6L9Tz1DR for <development@lists.ipfire.org>; Sat, 3 Aug 2024 22:37:14 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=comcastmailservice.net header.s=20211018a header.b=LZRgHAKt; dmarc=none; spf=none (mail01.ipfire.org: domain of stephen@firemypi.org has no SPF policy when checking 2001:558:fd00:56::5) smtp.mailfrom=stephen@firemypi.org ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1722724636; a=rsa-sha256; cv=none; b=CmSww3o/x8+7s6nqEU7d6RMMDVGDSzx3vwPFBQw5ol3wwrPqNrestN6Sk+d2xCBAGx6ZdY EORjp10k9S/zR0PaBvHoIT4JGcWm8sEgqxQtKyHju1MQ+SYOotNoaD8tFl9eTCwQn/g2OC GqvPhddInW7H8LwqPYjiTYd3hds3R+4Vv9KmZdmE7gvXxg+qn5SHBD0glHNh7PGn0i/YFm 7MBr207EkGBtZdTrIM8kTrZ8vS5yM4AM5+3wnBLmGd8KEDTxw3rnFRPPgza30p4v0Aa6Ki 0iTlwVLtBI3L5h783lX4nU71wm5CfG7kkGlOCQ2b91btBD8jk48tsliQxTzmQA== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=comcastmailservice.net header.s=20211018a header.b=LZRgHAKt; dmarc=none; spf=none (mail01.ipfire.org: domain of stephen@firemypi.org has no SPF policy when checking 2001:558:fd00:56::5) smtp.mailfrom=stephen@firemypi.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1722724636; 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:dkim-signature; bh=cUax9LKln0i+BwJMinqABls46gT73SyO0kXQAgC5alw=; b=WhkVDB+aSWHwPSfCd0JRYyo5eq9nwj9+6G5UjlL3AwF2irsrnl0AdksjmcqxVj+gZxZClg 9W27cG/th82xNb7GFgnZnBxSDApAzlMgjL81AReIl5Vnqn/sqBQzkp88kLiqa2dLl0TS+B R9KfjCvhPKrSSCjvb+I+7lhIEk1Xzy4vYYGUMs6K4zTAgJlam6JGgI47gGDVV8+CiYfTSR YbOEVnZaH3lQvK/WN5F03jqoTuoxg+BiLQalLEeFvCdVK9BTig4dIxwlgDb/Banm7a1bC3 L1+FBA9CdqCzlGPkXNl9T5MSE6806BD3BXSqMUNZPm33+5KQq863IIM6g67m6A== Received: from resomta-c2p-555661.sys.comcast.net ([96.102.18.228]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 256/256 bits) (Client did not present a certificate) by resqmta-c2p-570503.sys.comcast.net with ESMTPS id aLRRsndjCmPvHaNN7sR4Dj; Sat, 03 Aug 2024 22:37:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20211018a; t=1722724630; bh=cUax9LKln0i+BwJMinqABls46gT73SyO0kXQAgC5alw=; h=Received:Received:From:To:Subject:Date:Message-Id:MIME-Version: Xfinity-Spam-Result; b=LZRgHAKtexkQpQ5FaTO3AbqNtwhhW0sN6yH/FiEbee8O3cq4CQXc2eBCUwKDvKXfS SentUC3wPefVUNcP81CJ5h2RDsXm/UoFs5NEsB0vPaZ9W6AvbVZRM80lpS2UbLpItp V/RC7M6p9lwdDzobrfjilPTMUVQubaT4XrtEGL42jIC7Xa3hxMAzfeKqN0GnL6D67W NHTeKk7a9qV2+Wep62jW+rcIMpz1HCayXugjqy34JPpsMIK19hbFrNdUtpV8KrYgUP ms/xPdBSiPdtD4nxO3Y5zdo8WlS1R1VVEK9O7gt4cJRNUUDdVnP/RzVHhVTyMoJ4Y/ nQroEGvIrFQ+Q== Received: from localhost.localdomain ([75.70.122.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 256/256 bits) (Client did not present a certificate) by resomta-c2p-555661.sys.comcast.net with ESMTPSA id aNMlsxRpgdWKEaNMlsDKJM; Sat, 03 Aug 2024 22:36:48 +0000 From: Stephen Cuka <stephen@firemypi.org> To: development@lists.ipfire.org Subject: [PATCH] Remove space after every 80 characters in WebGUI "Logs/System Logs". Date: Sat, 3 Aug 2024 16:36:27 -0600 Message-Id: <20240803223627.123287-1-stephen@firemypi.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfOgiwENb4A6MZWQyz9NkJtFnwOJmprutdle74ZwHWXgw4BNy0VrrWzenjc3n/DddxmvPeYUMmhfxA+rqClmOiMaMO5eZ/XvL9+1CGuvvmnUvnJy2PaB9 vvJ/81jw1zJY1/owoObLH4izmrxu9CmXeMboxoCDBaU57WjIxApY65UpUoXZ3qTcKeGI1ellZUB0nX20GQfmphZF7cfH6TAXXO4h4b6N9HFLjB92+38oChP6 2vSK9Rs3VC8d1FzONyqZng== X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4WbyHt6L9Tz1DR X-Spamd-Result: default: False [0.11 / 11.00]; HFILTER_HELO_5(3.00)[resqmta-c2p-570503.sys.comcast.net]; BAYES_HAM(-2.78)[99.06%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; IP_REPUTATION_HAM(-0.30)[asn: 7922(-0.29), country: US(-0.01), ip: 2001:558:fd00:56::(0.00)]; R_DKIM_ALLOW(-0.20)[comcastmailservice.net:s=20211018a]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DMARC_NA(0.00)[firemypi.org]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RECEIVED_SPAMHAUS_PBL(0.00)[75.70.122.243:received]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_REPUTATION(0.00)[0]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ASN(0.00)[asn:7922, ipnet:2001:558::/29, country:US]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[comcastmailservice.net:+]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; R_SPF_NA(0.00)[no SPF record] X-Rspamd-Action: no action Message-ID-Hash: TB7NWVOIIEX5US2OW7XC646VDQH5S4TZ X-Message-ID-Hash: TB7NWVOIIEX5US2OW7XC646VDQH5S4TZ X-MailFrom: stephen@firemypi.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Stephen Cuka <stephen@firemypi.org> X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> Archived-At: <https://lists.ipfire.org/hyperkitty/list/development@lists.ipfire.org/message/TB7NWVOIIEX5US2OW7XC646VDQH5S4TZ/> List-Archive: <https://lists.ipfire.org/hyperkitty/list/development@lists.ipfire.org/> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Owner: <mailto:development-owner@lists.ipfire.org> List-Post: <mailto:development@lists.ipfire.org> List-Subscribe: <mailto:development-join@lists.ipfire.org> List-Unsubscribe: <mailto:development-leave@lists.ipfire.org> |
Series |
Remove space after every 80 characters in WebGUI "Logs/System Logs".
|
|
Commit Message
Stephen Cuka
Aug. 3, 2024, 10:36 p.m. UTC
Signed-off-by: Stephen Cuka <stephen@firemypi.org>
---
This patch addresses an issue with the IPFire WebGUI adding a space
after every 80 characters in the display of long log entries on the
"Logs/System Logs" page. (Bug 13735)
The patch removes the "very basic breaking of lines..." code and replaces it
with a direct copy of the log entry $data to the display output variable $d.
html/cgi-bin/logs.cgi/log.dat | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
Comments
Reviewed-by: Bernhard Bitsch <bbitsch@ipfire.org> Tested-by: Bernhard Bitsch <bbitsch@ipfire.org> Am 04.08.2024 um 00:36 schrieb Stephen Cuka: > Signed-off-by: Stephen Cuka <stephen@firemypi.org> > --- > > This patch addresses an issue with the IPFire WebGUI adding a space > after every 80 characters in the display of long log entries on the > "Logs/System Logs" page. (Bug 13735) > > The patch removes the "very basic breaking of lines..." code and replaces it > with a direct copy of the log entry $data to the display output variable $d. > > html/cgi-bin/logs.cgi/log.dat | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat > index 01c382a0d..ce7de0178 100644 > --- a/html/cgi-bin/logs.cgi/log.dat > +++ b/html/cgi-bin/logs.cgi/log.dat > @@ -412,11 +412,12 @@ foreach $_ (@log) > $sec = 'kernel'; > $data = $2.': '.$data; > } > - my $d = substr ($data,0,80); > - while (length($data)>80){ #very basic breaking of lines... > - $data = substr ($data,80); #permit correct display in table cell > - $d .= ' ' . substr ($data,0,80); > - } > + #my $d = substr ($data,0,80); > + #while (length($data)>80){ #very basic breaking of lines... > + # $data = substr ($data,80); #permit correct display in table cell > + # $d .= ' ' . substr ($data,0,80); > + #} > + my $d = $data; #don't break lines for display > my $col=""; > > if ($lines % 2) {
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org> Hi Stephen, Welcome to the list and thanks for the patch. On 04/08/2024 00:36, Stephen Cuka wrote: > Signed-off-by: Stephen Cuka <stephen@firemypi.org> > --- > > This patch addresses an issue with the IPFire WebGUI adding a space > after every 80 characters in the display of long log entries on the > "Logs/System Logs" page. (Bug 13735) > > The patch removes the "very basic breaking of lines..." code and replaces it > with a direct copy of the log entry $data to the display output variable $d. > > html/cgi-bin/logs.cgi/log.dat | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat > index 01c382a0d..ce7de0178 100644 > --- a/html/cgi-bin/logs.cgi/log.dat > +++ b/html/cgi-bin/logs.cgi/log.dat > @@ -412,11 +412,12 @@ foreach $_ (@log) > $sec = 'kernel'; > $data = $2.': '.$data; > } > - my $d = substr ($data,0,80); > - while (length($data)>80){ #very basic breaking of lines... > - $data = substr ($data,80); #permit correct display in table cell > - $d .= ' ' . substr ($data,0,80); > - } Removing these lines seems fine to me. The code looks to be adding a space instead of doing an actual line break. The text is also auto word wrapped in the text box in the browser anyway. > + #my $d = substr ($data,0,80); > + #while (length($data)>80){ #very basic breaking of lines... > + # $data = substr ($data,80); #permit correct display in table cell > + # $d .= ' ' . substr ($data,0,80); > + #} My only question is why you left all the removed lines in place as comments, rather than just removing them completely? > + my $d = $data; #don't break lines for display I think you could also save a line by not having this line but changing the earlier line of $data = $2.': '.$data; to my $d = $2.': '.$data; Regards, Adolf > my $col=""; > > if ($lines % 2) {
Hi Adolf, Thanks for your help on this. I left the original code lines in place for context. They're not really necessary. If it's better, I can remove them and resubmit the patch. For the my $d = $2.': '.$data; suggestion, there is some special processing for the display for the RED section logs. # correct the cut position, just when section=RED if (($cgiparams{'SECTION'} eq 'red' ) && ($sec =~ /(kernel:)(.*)/)) { $sec = 'kernel'; $data = $2.': '.$data; } Using 'my $d = $2. ': ' .$data;' for everything would add the timestamp to the front of the log text displayed for all sections. I'm not sure if the special processing for $data for RED is necessary. I think that the point of the 'if' statement is to clean up the Section display for entries from 'kernel: ippp\d' and 'kernel: isdn.*' matches for RED, but I don't know why adding the timestamp to the front of data would be desirable in that specific case. I don't have any log entries to reference for that though. Thanks, Stephen
Hi Stephen, On 05/08/2024 20:47, Stephen Cuka wrote: > Hi Adolf, > > Thanks for your help on this. > > I left the original code lines in place for context. They're not really necessary. If it's better, I can remove them and resubmit the patch. I think it would make more sense to remove them. You will need to make it a v2 patch so it supersedes this one automatically in patchwork. > For the > > my $d = $2.': '.$data; > > suggestion, there is some special processing for the display for the RED section logs. > > # correct the cut position, just when section=RED > if (($cgiparams{'SECTION'} eq 'red' ) && ($sec =~ /(kernel:)(.*)/)) { > $sec = 'kernel'; > $data = $2.': '.$data; > } > > Using 'my $d = $2. ': ' .$data;' for everything would add the timestamp to the front of the log text displayed for all sections. > > I'm not sure if the special processing for $data for RED is necessary. I think that the point of the 'if' statement is to clean up the Section display for entries from 'kernel: ippp\d' and 'kernel: isdn.*' matches for RED, but I don't know why adding the timestamp to the front of data would be desirable in that specific case. I don't have any log entries to reference for that though. I hadn't seen the special processing for the RED section logs. I would leave it as you have done it then unless Michael or Arne or Peter come back further onĀ this. Let's keep it simple for now. Regards, Adolf. > > Thanks, > Stephen
Hello Stephen, Welcome to the list! > On 5 Aug 2024, at 19:47, Stephen Cuka <stephen@firemypi.org> wrote: > > Hi Adolf, > > Thanks for your help on this. > > I left the original code lines in place for context. They're not really necessary. If it's better, I can remove them and resubmit the patch. > > For the > > my $d = $2.': '.$data; > > suggestion, there is some special processing for the display for the RED section logs. > > # correct the cut position, just when section=RED > if (($cgiparams{'SECTION'} eq 'red' ) && ($sec =~ /(kernel:)(.*)/)) { > $sec = 'kernel'; > $data = $2.': '.$data; > } > > Using 'my $d = $2. ': ' .$data;' for everything would add the timestamp to the front of the log text displayed for all sections. > > I'm not sure if the special processing for $data for RED is necessary. I think that the point of the 'if' statement is to clean up the Section display for entries from 'kernel: ippp\d' and 'kernel: isdn.*' matches for RED, but I don't know why adding the timestamp to the front of data would be desirable in that specific case. I don't have any log entries to reference for that though. I think we can safely drop this as we no longer support ISDN. -Michael > Thanks, > Stephen
diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat index 01c382a0d..ce7de0178 100644 --- a/html/cgi-bin/logs.cgi/log.dat +++ b/html/cgi-bin/logs.cgi/log.dat @@ -412,11 +412,12 @@ foreach $_ (@log) $sec = 'kernel'; $data = $2.': '.$data; } - my $d = substr ($data,0,80); - while (length($data)>80){ #very basic breaking of lines... - $data = substr ($data,80); #permit correct display in table cell - $d .= ' ' . substr ($data,0,80); - } + #my $d = substr ($data,0,80); + #while (length($data)>80){ #very basic breaking of lines... + # $data = substr ($data,80); #permit correct display in table cell + # $d .= ' ' . substr ($data,0,80); + #} + my $d = $data; #don't break lines for display my $col=""; if ($lines % 2) {