mirror of
https://github.com/Dvorinka/beszel.git
synced 2026-06-03 21:02:56 +00:00
feat(site): enhance monitoring, domain, and system tracking
Build Docker images / Hub (push) Failing after 5m57s
Build Docker images / Hub (push) Failing after 5m57s
- Improve domain lookup by adding CNAME and SRV record support
- Enhance domain status logic to include expiry and DNS resolution verification
- Update monitoring API to perform synchronous initial checks for immediate status updates
- Refactor site UI:
- Add tag filtering to domains and monitors tables
- Improve calendar view with better visual indicators for today and events
- Update monitor detail view with improved status badges and pending states
- Simplify home page layout by removing redundant card wrappers
- Update localization files for numerous languages to support new UI elements
- Add `cleanEndpointsConfig` to hub to safely reuse Docker network settings during container updates
This commit is contained in:
@@ -252,12 +252,16 @@ 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)
|
||||
}
|
||||
}()
|
||||
// Run initial check synchronously so the monitor shows real status immediately
|
||||
if _, err := h.scheduler.RunManualCheck(record.Id); err != nil {
|
||||
log.Printf("[monitor-api] Initial check failed for %s: %v", record.Id, err)
|
||||
}
|
||||
|
||||
// Re-fetch the updated record to get the new status
|
||||
updatedRecord, err := h.app.FindRecordById("monitors", record.Id)
|
||||
if err == nil {
|
||||
record = updatedRecord
|
||||
}
|
||||
|
||||
return e.JSON(http.StatusCreated, recordToResponse(record))
|
||||
}
|
||||
@@ -494,11 +498,15 @@ 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)
|
||||
}
|
||||
}()
|
||||
if _, err := h.scheduler.RunManualCheck(record.Id); err != nil {
|
||||
log.Printf("[monitor-api] Resume check failed for %s: %v", record.Id, err)
|
||||
}
|
||||
|
||||
// Re-fetch the updated record to get the new status
|
||||
updatedRecord, err := h.app.FindRecordById("monitors", record.Id)
|
||||
if err == nil {
|
||||
record = updatedRecord
|
||||
}
|
||||
|
||||
return e.JSON(http.StatusOK, recordToResponse(record))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user