mirror of
https://github.com/Dvorinka/beszel.git
synced 2026-06-03 21:02:56 +00:00
feat(site): enhance monitoring dashboard and public status pages
Implement incident tracking for public status pages, improve the monitoring dashboard UI with better grouping and loading states, and refine domain resolution logic. - feat(hub): add incident support to public status pages - feat(hub): implement immediate monitor checks on creation and resume - feat(hub): improve domain status detection using DNS fallback when WHOIS fails - feat(site): redesign monitoring dashboard with categorized cards - feat(site): add incident detail view and management in the dashboard - feat(site): add active incidents section to public status pages - feat(site): add "Add System" functionality to systems table - refactor(site): improve calendar view responsiveness and loading states - style(site): add skeleton components for better UX during data fetching
This commit is contained in:
@@ -2,6 +2,7 @@ package monitors
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -251,6 +252,13 @@ func (h *APIHandler) createMonitor(e *core.RequestEvent) error {
|
||||
// Add to scheduler
|
||||
h.scheduler.AddMonitor(record)
|
||||
|
||||
// Run initial check immediately so the monitor shows real status instead of pending
|
||||
go func() {
|
||||
if _, err := h.scheduler.RunManualCheck(record.Id); err != nil {
|
||||
log.Printf("[monitor-api] Initial check failed for %s: %v", record.Id, err)
|
||||
}
|
||||
}()
|
||||
|
||||
return e.JSON(http.StatusCreated, recordToResponse(record))
|
||||
}
|
||||
|
||||
@@ -485,6 +493,13 @@ func (h *APIHandler) resumeMonitor(e *core.RequestEvent) error {
|
||||
|
||||
h.scheduler.UpdateMonitor(record)
|
||||
|
||||
// Run an immediate check so the monitor shows real status instead of pending
|
||||
go func() {
|
||||
if _, err := h.scheduler.RunManualCheck(record.Id); err != nil {
|
||||
log.Printf("[monitor-api] Resume check failed for %s: %v", record.Id, err)
|
||||
}
|
||||
}()
|
||||
|
||||
return e.JSON(http.StatusOK, recordToResponse(record))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user