diff --git a/internal/view/web/dashboard/backups/index.go b/internal/view/web/dashboard/backups/index.go index f2914ef..3563ca6 100644 --- a/internal/view/web/dashboard/backups/index.go +++ b/internal/view/web/dashboard/backups/index.go @@ -52,15 +52,9 @@ func indexPage(reqCtx reqctx.Ctx) gomponents.Node { html.TBody( htmx.HxGet("/dashboard/backups/list?page=1"), htmx.HxTrigger("load"), - htmx.HxIndicator("#list-backups-loading"), ), ), ), - - html.Div( - html.Class("flex justify-center mt-4"), - component.HxLoadingLg("list-backups-loading"), - ), }, }), } diff --git a/internal/view/web/dashboard/backups/list_backups.go b/internal/view/web/dashboard/backups/list_backups.go index 22e7549..745a46a 100644 --- a/internal/view/web/dashboard/backups/list_backups.go +++ b/internal/view/web/dashboard/backups/list_backups.go @@ -137,7 +137,6 @@ func listBackups( )), htmx.HxTrigger("intersect once"), htmx.HxSwap("afterend"), - htmx.HxIndicator("#list-backups-loading"), )) } diff --git a/internal/view/web/dashboard/databases/index.go b/internal/view/web/dashboard/databases/index.go index 8dfa80a..e99639e 100644 --- a/internal/view/web/dashboard/databases/index.go +++ b/internal/view/web/dashboard/databases/index.go @@ -44,15 +44,9 @@ func indexPage(reqCtx reqctx.Ctx) gomponents.Node { html.TBody( htmx.HxGet("/dashboard/databases/list?page=1"), htmx.HxTrigger("load"), - htmx.HxIndicator("#list-databases-loading"), ), ), ), - - html.Div( - html.Class("flex justify-center mt-4"), - component.HxLoadingLg("list-databases-loading"), - ), }, }), } diff --git a/internal/view/web/dashboard/databases/list_databases.go b/internal/view/web/dashboard/databases/list_databases.go index 69386a8..d3603f7 100644 --- a/internal/view/web/dashboard/databases/list_databases.go +++ b/internal/view/web/dashboard/databases/list_databases.go @@ -119,7 +119,6 @@ func listDatabases( )), htmx.HxTrigger("intersect once"), htmx.HxSwap("afterend"), - htmx.HxIndicator("#list-databases-loading"), )) } diff --git a/internal/view/web/dashboard/destinations/index.go b/internal/view/web/dashboard/destinations/index.go index a827d6c..25a8020 100644 --- a/internal/view/web/dashboard/destinations/index.go +++ b/internal/view/web/dashboard/destinations/index.go @@ -57,15 +57,9 @@ func indexPage(reqCtx reqctx.Ctx) gomponents.Node { html.TBody( htmx.HxGet("/dashboard/destinations/list?page=1"), htmx.HxTrigger("load"), - htmx.HxIndicator("#list-destinations-loading"), ), ), ), - - html.Div( - html.Class("flex justify-center mt-4"), - component.HxLoadingLg("list-destinations-loading"), - ), }, }), } diff --git a/internal/view/web/dashboard/destinations/list_destinations.go b/internal/view/web/dashboard/destinations/list_destinations.go index 931efd0..b1f50cf 100644 --- a/internal/view/web/dashboard/destinations/list_destinations.go +++ b/internal/view/web/dashboard/destinations/list_destinations.go @@ -148,7 +148,6 @@ func listDestinations( )), htmx.HxTrigger("intersect once"), htmx.HxSwap("afterend"), - htmx.HxIndicator("#list-destinations-loading"), )) } diff --git a/internal/view/web/dashboard/executions/index.go b/internal/view/web/dashboard/executions/index.go index 3c9dd3b..bc534be 100644 --- a/internal/view/web/dashboard/executions/index.go +++ b/internal/view/web/dashboard/executions/index.go @@ -74,15 +74,9 @@ func indexPage(reqCtx reqctx.Ctx, queryData execsQueryData) gomponents.Node { return url }()), htmx.HxTrigger("load"), - htmx.HxIndicator("#list-executions-loading"), ), ), ), - - html.Div( - html.Class("flex justify-center mt-4"), - component.HxLoadingLg("list-executions-loading"), - ), }, }), } diff --git a/internal/view/web/dashboard/executions/list_executions.go b/internal/view/web/dashboard/executions/list_executions.go index 6ae1a87..6aadcd8 100644 --- a/internal/view/web/dashboard/executions/list_executions.go +++ b/internal/view/web/dashboard/executions/list_executions.go @@ -137,7 +137,6 @@ func listExecutions( }()), htmx.HxTrigger("intersect once"), htmx.HxSwap("afterend"), - htmx.HxIndicator("#list-executions-loading"), )) } diff --git a/internal/view/web/dashboard/restorations/index.go b/internal/view/web/dashboard/restorations/index.go index c8df159..81070a9 100644 --- a/internal/view/web/dashboard/restorations/index.go +++ b/internal/view/web/dashboard/restorations/index.go @@ -69,15 +69,9 @@ func indexPage(reqCtx reqctx.Ctx, queryData resQueryData) gomponents.Node { return url }()), htmx.HxTrigger("load"), - htmx.HxIndicator("#list-restorations-loading"), ), ), ), - - html.Div( - html.Class("flex justify-center mt-4"), - component.HxLoadingLg("list-restorations-loading"), - ), }, }), } diff --git a/internal/view/web/dashboard/restorations/list_restorations.go b/internal/view/web/dashboard/restorations/list_restorations.go index 0a35769..68a9770 100644 --- a/internal/view/web/dashboard/restorations/list_restorations.go +++ b/internal/view/web/dashboard/restorations/list_restorations.go @@ -126,7 +126,6 @@ func listRestorations( }()), htmx.HxTrigger("intersect once"), htmx.HxSwap("afterend"), - htmx.HxIndicator("#list-restorations-loading"), )) } diff --git a/internal/view/web/dashboard/webhooks/index.go b/internal/view/web/dashboard/webhooks/index.go index 402958a..8b5cec6 100644 --- a/internal/view/web/dashboard/webhooks/index.go +++ b/internal/view/web/dashboard/webhooks/index.go @@ -47,14 +47,8 @@ func indexPage(reqCtx reqctx.Ctx) gomponents.Node { html.TBody( htmx.HxGet("/dashboard/webhooks/list?page=1"), htmx.HxTrigger("load"), - htmx.HxIndicator("#list-webhooks-loading"), ), ), - - html.Div( - html.Class("flex justify-center mt-4"), - component.HxLoadingLg("list-webhooks-loading"), - ), ), }, }), diff --git a/internal/view/web/dashboard/webhooks/list_webhooks.go b/internal/view/web/dashboard/webhooks/list_webhooks.go index 2378466..fc15919 100644 --- a/internal/view/web/dashboard/webhooks/list_webhooks.go +++ b/internal/view/web/dashboard/webhooks/list_webhooks.go @@ -102,7 +102,6 @@ func listWebhooks( }()), htmx.HxTrigger("intersect once"), htmx.HxSwap("afterend"), - htmx.HxIndicator("#list-webhooks-loading"), )) } diff --git a/internal/view/web/layout/dashboard.go b/internal/view/web/layout/dashboard.go index 84ecf47..0614d32 100644 --- a/internal/view/web/layout/dashboard.go +++ b/internal/view/web/layout/dashboard.go @@ -3,6 +3,7 @@ package layout import ( "github.com/eduardolat/pgbackweb/internal/view/reqctx" "github.com/eduardolat/pgbackweb/internal/view/web/component" + "github.com/eduardolat/pgbackweb/internal/view/web/htmx" "github.com/maragudk/gomponents" "github.com/maragudk/gomponents/components" "github.com/maragudk/gomponents/html" @@ -30,6 +31,7 @@ func Dashboard(reqCtx reqctx.Ctx, params DashboardParams) gomponents.Node { head(), }, Body: []gomponents.Node{ + htmx.HxIndicator("#header-indicator"), components.Classes{ "w-screen h-screen bg-base-200": true, "flex justify-start overflow-hidden": true, diff --git a/internal/view/web/layout/dashboard_header.go b/internal/view/web/layout/dashboard_header.go index 1b6694d..4d11482 100644 --- a/internal/view/web/layout/dashboard_header.go +++ b/internal/view/web/layout/dashboard_header.go @@ -29,6 +29,7 @@ func dashboardHeader() gomponents.Node { }), component.StarOnGithub(component.SizeMd), dashboardHeaderCheckForUpdates(), + component.HxLoadingMd("header-indicator"), ), html.Div( html.Class("flex justify-end items-center space-x-2"),