mirror of
https://github.com/Dvorinka/beszel.git
synced 2026-06-03 21:02:56 +00:00
feat(site): overhaul domain and monitor detail views
Build Docker images / Hub (push) Failing after 1m21s
Build Docker images / Hub (push) Failing after 1m21s
Refactor the domain and monitor detail pages to use a new modular component architecture. This includes: - Implementing `domain-info-sections.tsx` and `monitor-info-sections.tsx` to provide structured, card-based information layouts. - Enhancing domain details with new sections for DNS, SSL, SEO, and hosting information. - Improving monitor details with enhanced uptime visualizations and response time statistics. - Updating the PageSpeed check API to support an optional API key from environment variables. - Cleaning up UI components and improving code formatting in the monitors table. - Updating localization files to support new UI strings.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/henrygd/beszel/internal/entities/monitor"
|
||||
"github.com/henrygd/beszel/internal/hub/pagespeed"
|
||||
"github.com/henrygd/beszel/internal/hub/utils"
|
||||
"github.com/pocketbase/dbx"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
@@ -641,10 +642,11 @@ func (h *APIHandler) runPageSpeedCheck(e *core.RequestEvent) error {
|
||||
return e.BadRequestError("strategy must be 'mobile' or 'desktop'", nil)
|
||||
}
|
||||
|
||||
checker := pagespeed.NewChecker("")
|
||||
apiKey, _ := utils.GetEnv("PAGESPEED_API_KEY")
|
||||
checker := pagespeed.NewChecker(apiKey)
|
||||
metrics, err := checker.CheckURL(url, strategy)
|
||||
if err != nil {
|
||||
return e.InternalServerError("PageSpeed check failed", err)
|
||||
return e.BadRequestError("PageSpeed check failed: "+err.Error(), err)
|
||||
}
|
||||
|
||||
vitals := pagespeed.GetCoreWebVitalsStatus(metrics)
|
||||
|
||||
Reference in New Issue
Block a user