Skip to content

Commit

Permalink
Merge pull request #28 from julien-wff/Feat/filename-timezone-helper
Browse files Browse the repository at this point in the history
Feat/filename timezone helper
  • Loading branch information
eduardolat authored Aug 15, 2024
2 parents 8f95171 + e7b8133 commit 8d96ed8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions internal/view/web/dashboard/backups/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/maragudk/gomponents"
"github.com/maragudk/gomponents/components"
"github.com/maragudk/gomponents/html"
"time"
)

func localBackupsHelp() []gomponents.Node {
Expand Down Expand Up @@ -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(`
Expand Down
1 change: 1 addition & 0 deletions internal/view/web/dashboard/backups/create_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func createBackupForm(
},
),
},
HelpButtonChildren: timezoneFilenamesHelp(),
}),

component.InputControl(component.InputControlParams{
Expand Down

0 comments on commit 8d96ed8

Please sign in to comment.