Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/filename timezone helper #28

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -188,6 +188,7 @@ func createBackupForm(
},
),
},
HelpButtonChildren: timezoneFilenamesHelp(),
}),

component.InputControl(component.InputControlParams{
Expand Down
Loading