fix(dashboard): use GetFullStatus for backup display after restart
The dashboard was using GetStatus() which returns nil after restart, showing "Még nem futott" even when backups exist. Now uses GetFullStatus() with synthesis logic, matching the backups page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -56,10 +56,12 @@ func (s *Server) dashboardHandler(w http.ResponseWriter, _ *http.Request) {
|
|||||||
// Backup status
|
// Backup status
|
||||||
data["BackupEnabled"] = s.cfg.Backup.Enabled
|
data["BackupEnabled"] = s.cfg.Backup.Enabled
|
||||||
if s.backupMgr != nil {
|
if s.backupMgr != nil {
|
||||||
dbDump, backupSt := s.backupMgr.GetStatus()
|
nextDBDump := scheduler.NextDailyRun(s.cfg.Backup.DBDumpSchedule)
|
||||||
data["DBDumpStatus"] = dbDump
|
nextBackup := scheduler.NextDailyRun(s.cfg.Backup.ResticSchedule)
|
||||||
data["BackupStatus"] = backupSt
|
fullStatus := s.backupMgr.GetFullStatus(nextDBDump, nextBackup)
|
||||||
data["BackupRunning"] = s.backupMgr.IsRunning()
|
data["DBDumpStatus"] = fullStatus.LastDBDump
|
||||||
|
data["BackupStatus"] = fullStatus.LastBackup
|
||||||
|
data["BackupRunning"] = fullStatus.Running
|
||||||
data["BackupMaxAgeHours"] = s.cfg.Monitoring.Thresholds.BackupMaxAgeHours
|
data["BackupMaxAgeHours"] = s.cfg.Monitoring.Thresholds.BackupMaxAgeHours
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user