(backups []api.Backup)
| 194 | } |
| 195 | |
| 196 | func (bm *BackupManager) displayBackups(backups []api.Backup) { |
| 197 | // Prepend active tasks from the App's global state |
| 198 | activeTasks := bm.app.GetActiveBackupsForVM(bm.vm.ID) |
| 199 | for _, task := range activeTasks { |
| 200 | // Create a fake backup entry for the running task |
| 201 | runningBackup := api.Backup{ |
| 202 | VolID: "TASK: " + task.UPID, |
| 203 | Name: utils.GetIconLabel("Backup in Progress...", "⚠️", bm.app.config.ShowIcons), |
| 204 | Date: task.StartTime, |
| 205 | Notes: fmt.Sprintf("Status: %s", task.Status), |
| 206 | Size: 0, |
| 207 | Format: "task", |
| 208 | Storage: "Unknown", |
| 209 | } |
| 210 | // Prepend |
| 211 | backups = append([]api.Backup{runningBackup}, backups...) |
| 212 | } |
| 213 | |
| 214 | bm.backupTable.DisplayBackups(backups) |
| 215 | |
| 216 | if len(backups) == 0 { |
| 217 | bm.updateInfoText("No backups found for this VM.") |
| 218 | return |
| 219 | } |
| 220 | |
| 221 | bm.updateInfoText(utils.GetIconLabel(fmt.Sprintf("Loaded %d backups (Ctrl+R to refresh)", len(backups)), "✅", bm.app.config.ShowIcons)) |
| 222 | } |
| 223 | |
| 224 | func (bm *BackupManager) updateInfoText(text string) { |
| 225 | bm.infoText.SetText(text) |
no test coverage detected