Message ID | 20240311234500.3379713-1-jon.murphy@ipfire.org |
---|---|
State | Staged |
Commit | f561899b54d6abd81430dd26a83679d49bc3fae7 |
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 ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Tttj255Pfz3wtq for <patchwork@web04.haj.ipfire.org>; Mon, 11 Mar 2024 23:46:46 +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 (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Tttj03DJpz12c; Mon, 11 Mar 2024 23:46:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Tttj00nZPz32ld; Mon, 11 Mar 2024 23:46:44 +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) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Ttthy28NRz30Pq for <development@lists.ipfire.org>; Mon, 11 Mar 2024 23:46:42 +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 (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Ttthw37FRzGb; Mon, 11 Mar 2024 23:46:40 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1710200801; 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=YWXED0aIvAkqKKu7KSz/EgfHKtU0DoC/PLdhC592nHI=; b=wlTLTZhC4acK4yQartlSLSwxB10ENdrmgUGWNtXggwn3LmaiJCvAQJJZozjRmYQucFcUy7 KmTRjUAzjzeYtDBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1710200801; 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=YWXED0aIvAkqKKu7KSz/EgfHKtU0DoC/PLdhC592nHI=; b=SMu81TiCDqmVqJhiXZwpmp0Fo4IK4QA416jbX7fGZwAUtUVXW/VO3dSMdCFaAUaLmRWGRZ NjVZbmzmORU3k5XBLBg2r1CUfR3OQ7/GWgCN51pYE8zHHxtFWYHsl6e2DCnrFUFILtfvox jI/6Crdq4E6jwJ2I684m/L52iu4qzrVNRUEb4Kj7we6Wu4rfsWMsybPzYxG2fw1NrHIikl zQ8vXg/Frpa12d494UD+1pfTo4snPkRe69opLBozqzgYfvicaEAueazULBy92jEBG/MGZt W1E5QvtaalYxijiyVo8FMBd4DYrGCExPomxEfrGgWZSUCIeA3VCXP+VaQWyXDQ== From: Jon Murphy <jon.murphy@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH] time.cgi: add current date-time to this WebGUI page Date: Mon, 11 Mar 2024 18:45:00 -0500 Message-Id: <20240311234500.3379713-1-jon.murphy@ipfire.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 22UWMQGPJRW7KUYDEP5CLBHB7YAPBFD5 X-Message-ID-Hash: 22UWMQGPJRW7KUYDEP5CLBHB7YAPBFD5 X-MailFrom: jon.murphy@ipfire.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: Leo-Andres Hofmann <hofmann@leo-andres.de> 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/22UWMQGPJRW7KUYDEP5CLBHB7YAPBFD5/> 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 |
time.cgi: add current date-time to this WebGUI page
|
|
Commit Message
jon
March 11, 2024, 11:45 p.m. UTC
- added words and date-time format to english (en.pl)
- other languages are needed
- seconds included since time is accurate to < .1s
https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440
Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
---
html/cgi-bin/time.cgi | 4 ++++
langs/en/cgi-bin/en.pl | 2 ++
2 files changed, 6 insertions(+)
Comments
Hello Jon, What is the motivation for this patch? -Michael > On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org> wrote: > > - added words and date-time format to english (en.pl) > - other languages are needed > - seconds included since time is accurate to < .1s > https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 > > Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> > Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> > --- > html/cgi-bin/time.cgi | 4 ++++ > langs/en/cgi-bin/en.pl | 2 ++ > 2 files changed, 6 insertions(+) > > diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi > index 57a02a4b6..04c1e771f 100644 > --- a/html/cgi-bin/time.cgi > +++ b/html/cgi-bin/time.cgi > @@ -287,6 +287,10 @@ print <<END > </table> > END > ; > + > +my $now = strftime($Lang::tr{'timeformat'}, localtime); > +print "<hr>$Lang::tr{'system time'}: $now"; > + > &Header::closebox(); > &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); > print <<END > diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl > index 667fb5d7e..2e036adb3 100644 > --- a/langs/en/cgi-bin/en.pl > +++ b/langs/en/cgi-bin/en.pl > @@ -2462,6 +2462,7 @@ > 'system log viewer' => 'System Log Viewer', > 'system logs' => 'System Logs', > 'system status information' => 'System Status Information', > +'system time' => 'System time (as of last page load)', > 'ta key' => 'TLS-Authentification-Key', > 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', > 'tcp more reliable' => 'TCP (more reliable)', > @@ -2490,6 +2491,7 @@ > 'time' => 'Time', > 'time date manually reset' => 'Time/Date manually reset.', > 'time server' => 'Time Server', > +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', > 'timeout must be a number' => 'Timeout must be a number.', > 'title' => 'Title', > 'to' => 'To', > -- > 2.30.2 >
Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended). Jon Murphy jon.murphy@ipfire.org > On Mar 12, 2024, at 5:10 AM, Michael Tremer <michael.tremer@ipfire.org> wrote: > > Hello Jon, > > What is the motivation for this patch? > > -Michael > >> On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org> wrote: >> >> - added words and date-time format to english (en.pl) >> - other languages are needed >> - seconds included since time is accurate to < .1s >> https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 >> >> Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> >> --- >> html/cgi-bin/time.cgi | 4 ++++ >> langs/en/cgi-bin/en.pl | 2 ++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi >> index 57a02a4b6..04c1e771f 100644 >> --- a/html/cgi-bin/time.cgi >> +++ b/html/cgi-bin/time.cgi >> @@ -287,6 +287,10 @@ print <<END >> </table> >> END >> ; >> + >> +my $now = strftime($Lang::tr{'timeformat'}, localtime); >> +print "<hr>$Lang::tr{'system time'}: $now"; >> + >> &Header::closebox(); >> &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); >> print <<END >> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl >> index 667fb5d7e..2e036adb3 100644 >> --- a/langs/en/cgi-bin/en.pl >> +++ b/langs/en/cgi-bin/en.pl >> @@ -2462,6 +2462,7 @@ >> 'system log viewer' => 'System Log Viewer', >> 'system logs' => 'System Logs', >> 'system status information' => 'System Status Information', >> +'system time' => 'System time (as of last page load)', >> 'ta key' => 'TLS-Authentification-Key', >> 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', >> 'tcp more reliable' => 'TCP (more reliable)', >> @@ -2490,6 +2491,7 @@ >> 'time' => 'Time', >> 'time date manually reset' => 'Time/Date manually reset.', >> 'time server' => 'Time Server', >> +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', >> 'timeout must be a number' => 'Timeout must be a number.', >> 'title' => 'Title', >> 'to' => 'To', >> -- >> 2.30.2 >> >
Michael - is this good to go?? Jon > On Mar 12, 2024, at 11:18 AM, jon <jon.murphy@ipfire.org> wrote: > > Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended). > > Jon Murphy > jon.murphy@ipfire.org <mailto:jon.murphy@ipfire.org> > > > >> On Mar 12, 2024, at 5:10 AM, Michael Tremer <michael.tremer@ipfire.org <mailto:michael.tremer@ipfire.org>> wrote: >> >> Hello Jon, >> >> What is the motivation for this patch? >> >> -Michael >> >>> On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org <mailto:jon.murphy@ipfire.org>> wrote: >>> >>> - added words and date-time format to english (en.pl) >>> - other languages are needed >>> - seconds included since time is accurate to < .1s >>> https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 <https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440> >>> >>> Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> >>> --- >>> html/cgi-bin/time.cgi | 4 ++++ >>> langs/en/cgi-bin/en.pl | 2 ++ >>> 2 files changed, 6 insertions(+) >>> >>> diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi >>> index 57a02a4b6..04c1e771f 100644 >>> --- a/html/cgi-bin/time.cgi >>> +++ b/html/cgi-bin/time.cgi >>> @@ -287,6 +287,10 @@ print <<END >>> </table> >>> END >>> ; >>> + >>> +my $now = strftime($Lang::tr{'timeformat'}, localtime); >>> +print "<hr>$Lang::tr{'system time'}: $now"; >>> + >>> &Header::closebox(); >>> &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); >>> print <<END >>> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl >>> index 667fb5d7e..2e036adb3 100644 >>> --- a/langs/en/cgi-bin/en.pl >>> +++ b/langs/en/cgi-bin/en.pl >>> @@ -2462,6 +2462,7 @@ >>> 'system log viewer' => 'System Log Viewer', >>> 'system logs' => 'System Logs', >>> 'system status information' => 'System Status Information', >>> +'system time' => 'System time (as of last page load)', >>> 'ta key' => 'TLS-Authentification-Key', >>> 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', >>> 'tcp more reliable' => 'TCP (more reliable)', >>> @@ -2490,6 +2491,7 @@ >>> 'time' => 'Time', >>> 'time date manually reset' => 'Time/Date manually reset.', >>> 'time server' => 'Time Server', >>> +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', >>> 'timeout must be a number' => 'Timeout must be a number.', >>> 'title' => 'Title', >>> 'to' => 'To', >>> -- >>> 2.30.2 >>> >> >
Hi Jon, On 14/03/2024 16:48, jon wrote: > Michael - is this good to go?? > > Jon > > >> On Mar 12, 2024, at 11:18 AM, jon <jon.murphy@ipfire.org> wrote: >> >> Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended). >> >> Jon Murphy >> jon.murphy@ipfire.org >> >> >> >>> On Mar 12, 2024, at 5:10 AM, Michael Tremer <michael.tremer@ipfire.org> wrote: >>> >>> Hello Jon, >>> >>> What is the motivation for this patch? >>> >>> -Michael >>> >>>> On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org> wrote: >>>> >>>> - added words and date-time format to english (en.pl) >>>> - other languages are needed >>>> - seconds included since time is accurate to < .1s I think this could be an issue. The time might be accurate to 0.1 secs but it will only be updated when the browser page is refreshed. So I can imagine people saying that the clock is not working because the seconds haven't changed. I have had that sort of problem in the past with the Connections Status page where people complained that the Connection expiry time was not updating unless they refreshed the browser page and they were sure it used to update every second in the past. Certainly don't want to be ending up refreshing the browser page every second or less to show a change in the seconds value. People will likely have a clock on the status panel of their OS desktop anyway so if the time matches on the hours and the minutes it will likely match the seconds as well. Regards, Adolf. >>>> https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 >>>> >>>> Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> >>>> --- >>>> html/cgi-bin/time.cgi | 4 ++++ >>>> langs/en/cgi-bin/en.pl | 2 ++ >>>> 2 files changed, 6 insertions(+) >>>> >>>> diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi >>>> index 57a02a4b6..04c1e771f 100644 >>>> --- a/html/cgi-bin/time.cgi >>>> +++ b/html/cgi-bin/time.cgi >>>> @@ -287,6 +287,10 @@ print <<END >>>> </table> >>>> END >>>> ; >>>> + >>>> +my $now = strftime($Lang::tr{'timeformat'}, localtime); >>>> +print "<hr>$Lang::tr{'system time'}: $now"; >>>> + >>>> &Header::closebox(); >>>> &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); >>>> print <<END >>>> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl >>>> index 667fb5d7e..2e036adb3 100644 >>>> --- a/langs/en/cgi-bin/en.pl >>>> +++ b/langs/en/cgi-bin/en.pl >>>> @@ -2462,6 +2462,7 @@ >>>> 'system log viewer' => 'System Log Viewer', >>>> 'system logs' => 'System Logs', >>>> 'system status information' => 'System Status Information', >>>> +'system time' => 'System time (as of last page load)', >>>> 'ta key' => 'TLS-Authentification-Key', >>>> 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', >>>> 'tcp more reliable' => 'TCP (more reliable)', >>>> @@ -2490,6 +2491,7 @@ >>>> 'time' => 'Time', >>>> 'time date manually reset' => 'Time/Date manually reset.', >>>> 'time server' => 'Time Server', >>>> +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', >>>> 'timeout must be a number' => 'Timeout must be a number.', >>>> 'title' => 'Title', >>>> 'to' => 'To', >>>> -- >>>> 2.30.2 >>>> >>> >> >
Comments below. Jon > On Mar 14, 2024, at 11:35 AM, Adolf Belka <adolf.belka@ipfire.org> wrote: > > Hi Jon, > > On 14/03/2024 16:48, jon wrote: >> Michael - is this good to go?? >> >> Jon >> >> >>> On Mar 12, 2024, at 11:18 AM, jon <jon.murphy@ipfire.org> wrote: >>> >>> Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended). >>> >>> Jon Murphy >>> jon.murphy@ipfire.org >>> >>> >>> >>>> On Mar 12, 2024, at 5:10 AM, Michael Tremer <michael.tremer@ipfire.org> wrote: >>>> >>>> Hello Jon, >>>> >>>> What is the motivation for this patch? >>>> >>>> -Michael >>>> >>>>> On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org> wrote: >>>>> >>>>> - added words and date-time format to english (en.pl) >>>>> - other languages are needed >>>>> - seconds included since time is accurate to < .1s > > I think this could be an issue. The time might be accurate to 0.1 secs but it will only be updated when the browser page is refreshed. So I can imagine people saying that the clock is not working because the seconds haven't changed. > > I have had that sort of problem in the past with the Connections Status page where people complained that the Connection expiry time was not updating unless they refreshed the browser page and they were sure it used to update every second in the past. > > Certainly don't want to be ending up refreshing the browser page every second or less to show a change in the seconds value. > > People will likely have a clock on the status panel of their OS desktop anyway so if the time matches on the hours and the minutes it will likely match the seconds as well. > I understand the concern and that was the reason for the "(as of last page load)" was added the the system time. The output looks like: "System time (as of last page load): 2024-03-14 at 11:40:22 CDT" And can easily be changed with the language files (I only did the `en.pl` file) And since many other WebGUI pages do not auto-update, I think this will be OK. PS - If it becomes an issue, we could always add an "Update" button (like the log pages) to the right of the time. > Regards, > > Adolf. > >>>>> https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 >>>>> >>>>> Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> >>>>> --- >>>>> html/cgi-bin/time.cgi | 4 ++++ >>>>> langs/en/cgi-bin/en.pl | 2 ++ >>>>> 2 files changed, 6 insertions(+) >>>>> >>>>> diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi >>>>> index 57a02a4b6..04c1e771f 100644 >>>>> --- a/html/cgi-bin/time.cgi >>>>> +++ b/html/cgi-bin/time.cgi >>>>> @@ -287,6 +287,10 @@ print <<END >>>>> </table> >>>>> END >>>>> ; >>>>> + >>>>> +my $now = strftime($Lang::tr{'timeformat'}, localtime); >>>>> +print "<hr>$Lang::tr{'system time'}: $now"; >>>>> + >>>>> &Header::closebox(); >>>>> &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); >>>>> print <<END >>>>> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl >>>>> index 667fb5d7e..2e036adb3 100644 >>>>> --- a/langs/en/cgi-bin/en.pl >>>>> +++ b/langs/en/cgi-bin/en.pl >>>>> @@ -2462,6 +2462,7 @@ >>>>> 'system log viewer' => 'System Log Viewer', >>>>> 'system logs' => 'System Logs', >>>>> 'system status information' => 'System Status Information', >>>>> +'system time' => 'System time (as of last page load)', >>>>> 'ta key' => 'TLS-Authentification-Key', >>>>> 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', >>>>> 'tcp more reliable' => 'TCP (more reliable)', >>>>> @@ -2490,6 +2491,7 @@ >>>>> 'time' => 'Time', >>>>> 'time date manually reset' => 'Time/Date manually reset.', >>>>> 'time server' => 'Time Server', >>>>> +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', >>>>> 'timeout must be a number' => 'Timeout must be a number.', >>>>> 'title' => 'Title', >>>>> 'to' => 'To', >>>>> -- >>>>> 2.30.2 >>>>> >>>> >>> >>
Hello Jon, Yes, this is good to go. I just didn’t have time to test the patch, yet. I merged it yesterday. -Michael > On 14 Mar 2024, at 15:48, jon <jon.murphy@ipfire.org> wrote: > > Michael - is this good to go?? > > Jon > > >> On Mar 12, 2024, at 11:18 AM, jon <jon.murphy@ipfire.org> wrote: >> >> Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended). >> >> Jon Murphy >> jon.murphy@ipfire.org >> >> >> >>> On Mar 12, 2024, at 5:10 AM, Michael Tremer <michael.tremer@ipfire.org> wrote: >>> >>> Hello Jon, >>> >>> What is the motivation for this patch? >>> >>> -Michael >>> >>>> On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org> wrote: >>>> >>>> - added words and date-time format to english (en.pl) >>>> - other languages are needed >>>> - seconds included since time is accurate to < .1s >>>> https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 >>>> >>>> Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> >>>> --- >>>> html/cgi-bin/time.cgi | 4 ++++ >>>> langs/en/cgi-bin/en.pl | 2 ++ >>>> 2 files changed, 6 insertions(+) >>>> >>>> diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi >>>> index 57a02a4b6..04c1e771f 100644 >>>> --- a/html/cgi-bin/time.cgi >>>> +++ b/html/cgi-bin/time.cgi >>>> @@ -287,6 +287,10 @@ print <<END >>>> </table> >>>> END >>>> ; >>>> + >>>> +my $now = strftime($Lang::tr{'timeformat'}, localtime); >>>> +print "<hr>$Lang::tr{'system time'}: $now"; >>>> + >>>> &Header::closebox(); >>>> &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); >>>> print <<END >>>> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl >>>> index 667fb5d7e..2e036adb3 100644 >>>> --- a/langs/en/cgi-bin/en.pl >>>> +++ b/langs/en/cgi-bin/en.pl >>>> @@ -2462,6 +2462,7 @@ >>>> 'system log viewer' => 'System Log Viewer', >>>> 'system logs' => 'System Logs', >>>> 'system status information' => 'System Status Information', >>>> +'system time' => 'System time (as of last page load)', >>>> 'ta key' => 'TLS-Authentification-Key', >>>> 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', >>>> 'tcp more reliable' => 'TCP (more reliable)', >>>> @@ -2490,6 +2491,7 @@ >>>> 'time' => 'Time', >>>> 'time date manually reset' => 'Time/Date manually reset.', >>>> 'time server' => 'Time Server', >>>> +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', >>>> 'timeout must be a number' => 'Timeout must be a number.', >>>> 'title' => 'Title', >>>> 'to' => 'To', >>>> -- >>>> 2.30.2 >>>> >>> >> >
Hello, > On 14 Mar 2024, at 17:19, jon <jon.murphy@ipfire.org> wrote: > > Comments below. > > Jon > > >> On Mar 14, 2024, at 11:35 AM, Adolf Belka <adolf.belka@ipfire.org> wrote: >> >> Hi Jon, >> >> On 14/03/2024 16:48, jon wrote: >>> Michael - is this good to go?? >>> >>> Jon >>> >>> >>>> On Mar 12, 2024, at 11:18 AM, jon <jon.murphy@ipfire.org> wrote: >>>> >>>> Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended). >>>> >>>> Jon Murphy >>>> jon.murphy@ipfire.org >>>> >>>> >>>> >>>>> On Mar 12, 2024, at 5:10 AM, Michael Tremer <michael.tremer@ipfire.org> wrote: >>>>> >>>>> Hello Jon, >>>>> >>>>> What is the motivation for this patch? >>>>> >>>>> -Michael >>>>> >>>>>> On 11 Mar 2024, at 23:45, Jon Murphy <jon.murphy@ipfire.org> wrote: >>>>>> >>>>>> - added words and date-time format to english (en.pl) >>>>>> - other languages are needed >>>>>> - seconds included since time is accurate to < .1s >> >> I think this could be an issue. The time might be accurate to 0.1 secs but it will only be updated when the browser page is refreshed. So I can imagine people saying that the clock is not working because the seconds haven't changed. >> >> I have had that sort of problem in the past with the Connections Status page where people complained that the Connection expiry time was not updating unless they refreshed the browser page and they were sure it used to update every second in the past. >> >> Certainly don't want to be ending up refreshing the browser page every second or less to show a change in the seconds value. >> >> People will likely have a clock on the status panel of their OS desktop anyway so if the time matches on the hours and the minutes it will likely match the seconds as well. I agree that showing time statically isn’t a good way, but I don’t know what we can improve really. If we use the browser’s time we are not showing the system’s time and that would be useless. I believe for debugging this is good enough. It should just be there to figure out if your system is badly out of time. > I understand the concern and that was the reason for the "(as of last page load)" was added the the system time. The output looks like: > > "System time (as of last page load): 2024-03-14 at 11:40:22 CDT" > > And can easily be changed with the language files (I only did the `en.pl` file) I added a German translation: https://git.ipfire.org/?p=ipfire-2.x.git;a=commitdiff;h=16492046bc7f50e2c63e2908a7ace13d1548e764 > And since many other WebGUI pages do not auto-update, I think this will be OK. > > PS - If it becomes an issue, we could always add an "Update" button (like the log pages) to the right of the time. I think a page refresh will do. I we wanted to do it properly live, we would need to send requests to the web service and ask for the time repeatedly. -Michael > > >> Regards, >> >> Adolf. >> >>>>>> https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440 >>>>>> >>>>>> Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de> >>>>>> Signed-off-by: Jon Murphy <jon.murphy@ipfire.org> >>>>>> --- >>>>>> html/cgi-bin/time.cgi | 4 ++++ >>>>>> langs/en/cgi-bin/en.pl | 2 ++ >>>>>> 2 files changed, 6 insertions(+) >>>>>> >>>>>> diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi >>>>>> index 57a02a4b6..04c1e771f 100644 >>>>>> --- a/html/cgi-bin/time.cgi >>>>>> +++ b/html/cgi-bin/time.cgi >>>>>> @@ -287,6 +287,10 @@ print <<END >>>>>> </table> >>>>>> END >>>>>> ; >>>>>> + >>>>>> +my $now = strftime($Lang::tr{'timeformat'}, localtime); >>>>>> +print "<hr>$Lang::tr{'system time'}: $now"; >>>>>> + >>>>>> &Header::closebox(); >>>>>> &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); >>>>>> print <<END >>>>>> diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl >>>>>> index 667fb5d7e..2e036adb3 100644 >>>>>> --- a/langs/en/cgi-bin/en.pl >>>>>> +++ b/langs/en/cgi-bin/en.pl >>>>>> @@ -2462,6 +2462,7 @@ >>>>>> 'system log viewer' => 'System Log Viewer', >>>>>> 'system logs' => 'System Logs', >>>>>> 'system status information' => 'System Status Information', >>>>>> +'system time' => 'System time (as of last page load)', >>>>>> 'ta key' => 'TLS-Authentification-Key', >>>>>> 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', >>>>>> 'tcp more reliable' => 'TCP (more reliable)', >>>>>> @@ -2490,6 +2491,7 @@ >>>>>> 'time' => 'Time', >>>>>> 'time date manually reset' => 'Time/Date manually reset.', >>>>>> 'time server' => 'Time Server', >>>>>> +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', >>>>>> 'timeout must be a number' => 'Timeout must be a number.', >>>>>> 'title' => 'Title', >>>>>> 'to' => 'To', >>>>>> -- >>>>>> 2.30.2
diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi index 57a02a4b6..04c1e771f 100644 --- a/html/cgi-bin/time.cgi +++ b/html/cgi-bin/time.cgi @@ -287,6 +287,10 @@ print <<END </table> END ; + +my $now = strftime($Lang::tr{'timeformat'}, localtime); +print "<hr>$Lang::tr{'system time'}: $now"; + &Header::closebox(); &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); print <<END diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 667fb5d7e..2e036adb3 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -2462,6 +2462,7 @@ 'system log viewer' => 'System Log Viewer', 'system logs' => 'System Logs', 'system status information' => 'System Status Information', +'system time' => 'System time (as of last page load)', 'ta key' => 'TLS-Authentification-Key', 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', 'tcp more reliable' => 'TCP (more reliable)', @@ -2490,6 +2491,7 @@ 'time' => 'Time', 'time date manually reset' => 'Time/Date manually reset.', 'time server' => 'Time Server', +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', 'timeout must be a number' => 'Timeout must be a number.', 'title' => 'Title', 'to' => 'To',