From e7b813308624191b5a11a9c3930c80cc66d65338 Mon Sep 17 00:00:00 2001 From: Julien W Date: Tue, 13 Aug 2024 14:42:35 +0200 Subject: [PATCH] Add help about timezone field utility --- internal/view/web/dashboard/backups/common.go | 27 +++++++++++++++++++ .../web/dashboard/backups/create_backup.go | 1 + 2 files changed, 28 insertions(+) diff --git a/internal/view/web/dashboard/backups/common.go b/internal/view/web/dashboard/backups/common.go index 0e0538b..8c56075 100644 --- a/internal/view/web/dashboard/backups/common.go +++ b/internal/view/web/dashboard/backups/common.go @@ -6,6 +6,7 @@ import ( "github.com/maragudk/gomponents" "github.com/maragudk/gomponents/components" "github.com/maragudk/gomponents/html" + "time" ) func localBackupsHelp() []gomponents.Node { @@ -58,6 +59,32 @@ func cronExpressionHelp() []gomponents.Node { } } +func timezoneFilenamesHelp() []gomponents.Node { + serverTimezone := time.Now().Location().String() + + return []gomponents.Node{ + html.P( + component.SpanText(` + Only for cron evaluation. + Backup filenames will always use the server timezone (currently + `), + component.BText(serverTimezone), + component.SpanText(")."), + ), + + html.Div( + html.Class("mt-4 flex justify-end items-center"), + html.A( + html.Href("https://github.com/eduardolat/pgbackweb?tab=readme-ov-file#configuration"), + html.Target("_blank"), + html.Class("btn btn-ghost"), + component.SpanText("Learn more in project README"), + lucide.ExternalLink(), + ), + ), + } +} + func destinationDirectoryHelp() []gomponents.Node { return []gomponents.Node{ component.PText(` diff --git a/internal/view/web/dashboard/backups/create_backup.go b/internal/view/web/dashboard/backups/create_backup.go index 9af96bf..88e9261 100644 --- a/internal/view/web/dashboard/backups/create_backup.go +++ b/internal/view/web/dashboard/backups/create_backup.go @@ -188,6 +188,7 @@ func createBackupForm( }, ), }, + HelpButtonChildren: timezoneFilenamesHelp(), }), component.InputControl(component.InputControlParams{