mirror of
https://github.com/eduardolat/pgbackweb.git
synced 2026-01-25 05:58:29 -06:00
Refactor naming in dashboard for clarity
This commit is contained in:
@@ -309,7 +309,7 @@ func createBackupForm(
|
||||
nodx.Button(
|
||||
nodx.Class("btn btn-primary"),
|
||||
nodx.Type("submit"),
|
||||
component.SpanText("Save"),
|
||||
component.SpanText("Create backup task"),
|
||||
lucide.Save(),
|
||||
),
|
||||
),
|
||||
@@ -319,7 +319,7 @@ func createBackupForm(
|
||||
func createBackupButton() nodx.Node {
|
||||
mo := component.Modal(component.ModalParams{
|
||||
Size: component.SizeLg,
|
||||
Title: "Create backup",
|
||||
Title: "Create backup task",
|
||||
Content: []nodx.Node{
|
||||
nodx.Div(
|
||||
htmx.HxGet("/dashboard/backups/create-form"),
|
||||
@@ -334,7 +334,7 @@ func createBackupButton() nodx.Node {
|
||||
button := nodx.Button(
|
||||
mo.OpenerAttr,
|
||||
nodx.Class("btn btn-primary"),
|
||||
component.SpanText("Create backup"),
|
||||
component.SpanText("Create backup task"),
|
||||
lucide.Plus(),
|
||||
)
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ func (h *handlers) deleteBackupHandler(c echo.Context) error {
|
||||
func deleteBackupButton(backupID uuid.UUID) nodx.Node {
|
||||
return component.OptionsDropdownButton(
|
||||
htmx.HxDelete("/dashboard/backups/"+backupID.String()),
|
||||
htmx.HxConfirm("Are you sure you want to delete this backup?"),
|
||||
htmx.HxConfirm("Are you sure you want to delete this backup task?"),
|
||||
lucide.Trash(),
|
||||
component.SpanText("Delete backup"),
|
||||
component.SpanText("Delete backup task"),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ func (h *handlers) duplicateBackupHandler(c echo.Context) error {
|
||||
func duplicateBackupButton(backupID uuid.UUID) nodx.Node {
|
||||
return component.OptionsDropdownButton(
|
||||
htmx.HxPost("/dashboard/backups/"+backupID.String()+"/duplicate"),
|
||||
htmx.HxConfirm("Are you sure you want to duplicate this backup?"),
|
||||
htmx.HxConfirm("Are you sure you want to duplicate this backup task?"),
|
||||
lucide.CopyPlus(),
|
||||
component.SpanText("Duplicate backup"),
|
||||
component.SpanText("Duplicate backup task"),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ func (h *handlers) editBackupHandler(c echo.Context) error {
|
||||
return respondhtmx.ToastError(c, err.Error())
|
||||
}
|
||||
|
||||
return respondhtmx.AlertWithRefresh(c, "Backup updated")
|
||||
return respondhtmx.AlertWithRefresh(c, "Backup task updated")
|
||||
}
|
||||
|
||||
func editBackupButton(backup dbgen.BackupsServicePaginateBackupsRow) nodx.Node {
|
||||
@@ -87,7 +87,7 @@ func editBackupButton(backup dbgen.BackupsServicePaginateBackupsRow) nodx.Node {
|
||||
|
||||
mo := component.Modal(component.ModalParams{
|
||||
Size: component.SizeLg,
|
||||
Title: "Edit backup",
|
||||
Title: "Edit backup task",
|
||||
Content: []nodx.Node{
|
||||
nodx.FormEl(
|
||||
htmx.HxPost("/dashboard/backups/"+backup.ID.String()+"/edit"),
|
||||
@@ -268,7 +268,7 @@ func editBackupButton(backup dbgen.BackupsServicePaginateBackupsRow) nodx.Node {
|
||||
component.OptionsDropdownButton(
|
||||
mo.OpenerAttr,
|
||||
lucide.Pencil(),
|
||||
component.SpanText("Edit backup"),
|
||||
component.SpanText("Edit backup task"),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ func indexPage(reqCtx reqctx.Ctx) nodx.Node {
|
||||
content := []nodx.Node{
|
||||
nodx.Div(
|
||||
nodx.Class("flex justify-between items-start"),
|
||||
component.H1Text("Backups"),
|
||||
component.H1Text("Backup tasks"),
|
||||
createBackupButton(),
|
||||
),
|
||||
component.CardBox(component.CardBoxParams{
|
||||
@@ -60,7 +60,7 @@ func indexPage(reqCtx reqctx.Ctx) nodx.Node {
|
||||
}
|
||||
|
||||
return layout.Dashboard(reqCtx, layout.DashboardParams{
|
||||
Title: "Backups",
|
||||
Title: "Backup tasks",
|
||||
Body: content,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,19 +48,19 @@ func createDatabaseButton() nodx.Node {
|
||||
htmxAttributes := func(url string) nodx.Node {
|
||||
return nodx.Group(
|
||||
htmx.HxPost(url),
|
||||
htmx.HxInclude("#create-database-form"),
|
||||
htmx.HxDisabledELT(".create-database-btn"),
|
||||
htmx.HxIndicator("#create-database-loading"),
|
||||
htmx.HxInclude("#add-database-form"),
|
||||
htmx.HxDisabledELT(".add-database-btn"),
|
||||
htmx.HxIndicator("#add-database-loading"),
|
||||
htmx.HxValidate("true"),
|
||||
)
|
||||
}
|
||||
|
||||
mo := component.Modal(component.ModalParams{
|
||||
Size: component.SizeMd,
|
||||
Title: "Create database",
|
||||
Title: "Add database",
|
||||
Content: []nodx.Node{
|
||||
nodx.FormEl(
|
||||
nodx.Id("create-database-form"),
|
||||
nodx.Id("add-database-form"),
|
||||
nodx.Class("space-y-2"),
|
||||
|
||||
component.InputControl(component.InputControlParams{
|
||||
@@ -98,7 +98,7 @@ func createDatabaseButton() nodx.Node {
|
||||
nodx.Div(
|
||||
nodx.Button(
|
||||
htmxAttributes("/dashboard/databases/test"),
|
||||
nodx.Class("create-database-btn btn btn-neutral btn-outline"),
|
||||
nodx.Class("add-database-btn btn btn-neutral btn-outline"),
|
||||
nodx.Type("button"),
|
||||
component.SpanText("Test connection"),
|
||||
lucide.DatabaseZap(),
|
||||
@@ -106,12 +106,12 @@ func createDatabaseButton() nodx.Node {
|
||||
),
|
||||
nodx.Div(
|
||||
nodx.Class("flex justify-end items-center space-x-2"),
|
||||
component.HxLoadingMd("create-database-loading"),
|
||||
component.HxLoadingMd("add-database-loading"),
|
||||
nodx.Button(
|
||||
htmxAttributes("/dashboard/databases"),
|
||||
nodx.Class("create-database-btn btn btn-primary"),
|
||||
nodx.Class("add-database-btn btn btn-primary"),
|
||||
nodx.Type("button"),
|
||||
component.SpanText("Save"),
|
||||
component.SpanText("Add database"),
|
||||
lucide.Save(),
|
||||
),
|
||||
),
|
||||
@@ -122,7 +122,7 @@ func createDatabaseButton() nodx.Node {
|
||||
button := nodx.Button(
|
||||
mo.OpenerAttr,
|
||||
nodx.Class("btn btn-primary"),
|
||||
component.SpanText("Create database"),
|
||||
component.SpanText("Add database"),
|
||||
lucide.Plus(),
|
||||
)
|
||||
|
||||
|
||||
@@ -52,19 +52,19 @@ func createDestinationButton() nodx.Node {
|
||||
htmxAttributes := func(url string) nodx.Node {
|
||||
return nodx.Group(
|
||||
htmx.HxPost(url),
|
||||
htmx.HxInclude("#create-destination-form"),
|
||||
htmx.HxDisabledELT(".create-destination-btn"),
|
||||
htmx.HxIndicator("#create-destination-loading"),
|
||||
htmx.HxInclude("#add-destination-form"),
|
||||
htmx.HxDisabledELT(".add-destination-btn"),
|
||||
htmx.HxIndicator("#add-destination-loading"),
|
||||
htmx.HxValidate("true"),
|
||||
)
|
||||
}
|
||||
|
||||
mo := component.Modal(component.ModalParams{
|
||||
Size: component.SizeMd,
|
||||
Title: "Create destination",
|
||||
Title: "Add destination",
|
||||
Content: []nodx.Node{
|
||||
nodx.FormEl(
|
||||
nodx.Id("create-destination-form"),
|
||||
nodx.Id("add-destination-form"),
|
||||
nodx.Class("space-y-2"),
|
||||
|
||||
component.InputControl(component.InputControlParams{
|
||||
@@ -124,7 +124,7 @@ func createDestinationButton() nodx.Node {
|
||||
nodx.Div(
|
||||
nodx.Button(
|
||||
htmxAttributes("/dashboard/destinations/test"),
|
||||
nodx.Class("create-destination-btn btn btn-neutral btn-outline"),
|
||||
nodx.Class("add-destination-btn btn btn-neutral btn-outline"),
|
||||
nodx.Type("button"),
|
||||
component.SpanText("Test connection"),
|
||||
lucide.PlugZap(),
|
||||
@@ -132,12 +132,12 @@ func createDestinationButton() nodx.Node {
|
||||
),
|
||||
nodx.Div(
|
||||
nodx.Class("flex justify-end items-center space-x-2"),
|
||||
component.HxLoadingMd("create-destination-loading"),
|
||||
component.HxLoadingMd("add-destination-loading"),
|
||||
nodx.Button(
|
||||
htmxAttributes("/dashboard/destinations"),
|
||||
nodx.Class("create-destination-btn btn btn-primary"),
|
||||
nodx.Class("add-destination-btn btn btn-primary"),
|
||||
nodx.Type("button"),
|
||||
component.SpanText("Save"),
|
||||
component.SpanText("Add destination"),
|
||||
lucide.Save(),
|
||||
),
|
||||
),
|
||||
@@ -148,7 +148,7 @@ func createDestinationButton() nodx.Node {
|
||||
button := nodx.Button(
|
||||
mo.OpenerAttr,
|
||||
nodx.Class("btn btn-primary"),
|
||||
component.SpanText("Create destination"),
|
||||
component.SpanText("Add destination"),
|
||||
lucide.Plus(),
|
||||
)
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ func indexPage(
|
||||
Data: []int32{destinationsQty.Healthy, destinationsQty.Unhealthy},
|
||||
BgColors: []string{greenColor, redColor},
|
||||
}),
|
||||
countCard("Backups", backupsQty.All, ChartData{
|
||||
countCard("Backup tasks", backupsQty.All, ChartData{
|
||||
Label: "Quantity",
|
||||
Labels: []string{"Active", "Inactive"},
|
||||
Data: []int32{backupsQty.Active, backupsQty.Inactive},
|
||||
|
||||
@@ -25,17 +25,17 @@ func indexHowTo() nodx.Node {
|
||||
nodx.Li(
|
||||
nodx.Class("step"),
|
||||
alpine.XBind("class", "currentSlide >= 1 ? 'step-primary' : ''"),
|
||||
nodx.Text("Create database"),
|
||||
nodx.Text("Add database"),
|
||||
),
|
||||
nodx.Li(
|
||||
nodx.Class("step"),
|
||||
alpine.XBind("class", "currentSlide >= 2 ? 'step-primary' : ''"),
|
||||
nodx.Text("Create destination"),
|
||||
nodx.Text("Add destination"),
|
||||
),
|
||||
nodx.Li(
|
||||
nodx.Class("step"),
|
||||
alpine.XBind("class", "currentSlide >= 3 ? 'step-primary' : ''"),
|
||||
nodx.Text("Create backup"),
|
||||
nodx.Text("Create backup task"),
|
||||
),
|
||||
nodx.Li(
|
||||
nodx.Class("step"),
|
||||
@@ -47,22 +47,22 @@ func indexHowTo() nodx.Node {
|
||||
|
||||
nodx.Div(
|
||||
alpine.XShow("currentSlide === 1"),
|
||||
component.H3Text("Create database"),
|
||||
component.H3Text("Add database"),
|
||||
component.PText(`
|
||||
To create a database, click on the "Databases" menu item on the
|
||||
left sidebar. Then click on the "Create database" button. Fill
|
||||
in the form and click on the "Save" button. You can create as
|
||||
To add a database, click on the "Databases" menu item on the
|
||||
left sidebar. Then click on the "Add database" button. Fill
|
||||
in the form and click on the "Save" button. You can add as
|
||||
many databases as you want to backup.
|
||||
`),
|
||||
),
|
||||
|
||||
nodx.Div(
|
||||
alpine.XShow("currentSlide === 2"),
|
||||
component.H3Text("Create S3 destination (optional)"),
|
||||
component.H3Text("Add S3 destination (optional)"),
|
||||
component.PText(`
|
||||
To create a destination, click on the "Destinations" menu item on
|
||||
the left sidebar. Then click on the "Create destination" button.
|
||||
Fill in the form and click on the "Save" button. You can create
|
||||
To add a destination, click on the "Destinations" menu item on
|
||||
the left sidebar. Then click on the "Add destination" button.
|
||||
Fill in the form and click on the "Save" button. You can add
|
||||
as many destinations as you want to store the backups. If you
|
||||
don't want to use S3 destinations and store the backups locally,
|
||||
you can skip this step.
|
||||
@@ -73,10 +73,10 @@ func indexHowTo() nodx.Node {
|
||||
alpine.XShow("currentSlide === 3"),
|
||||
component.H3Text("Create backup"),
|
||||
component.PText(`
|
||||
To create a backup you need to have at least one database and one
|
||||
destination. Click on the "Backups" menu item on the left sidebar.
|
||||
Then click on the "Create backup" button. Fill in the form and
|
||||
click on the "Save" button. You can create as many backups as you
|
||||
To create a backup task you need to have at least one database and one
|
||||
destination. Click on the "Backup tasks" menu item on the left sidebar.
|
||||
Then click on the "Create backup task" button. Fill in the form and
|
||||
click on the "Save" button. You can create as many backup tasks as you
|
||||
want including any combination of databases and destinations.
|
||||
`),
|
||||
),
|
||||
|
||||
@@ -65,7 +65,7 @@ func dashboardAside() nodx.Node {
|
||||
|
||||
dashboardAsideItem(
|
||||
lucide.DatabaseBackup,
|
||||
"Backups",
|
||||
"Backup tasks",
|
||||
"/dashboard/backups",
|
||||
false,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user