Backup hover names the check and the capture separately

This commit is contained in:
2026-08-13 13:35:17 -04:00
parent 376b8df0fb
commit 7517146238
3 changed files with 58 additions and 11 deletions

View File

@@ -213,17 +213,30 @@ function backupClass(report) {
return ''
}
// Two dates, and they mean different things. checked = when the collector last
// CONFIRMED this config; taken = when the config was last CAPTURED, which only
// moves when something actually changed. Showing one date forced it to stand
// for both, which is what made a healthy machine look neglected.
function backupTitle(report) {
const seen = report.backuplastseen ? formatDate(report.backuplastseen) : 'never'
const checked = report.backuplastseen ? formatDate(report.backuplastseen) : 'never'
const taken = report.backupcollectedat ? formatDate(report.backupcollectedat) : null
const kind = report.backupkind
if (report.backupok === true) {
return `${report.backupkind}: checked and verified ${seen}.`
+ ' Config unchanged since, which is why the date does not move.'
return taken
? `${kind}: checked ${checked}. Verified the backup taken ${taken} is still current.`
: `${kind}: checked and verified ${checked}.`
}
if (report.backupok === false) {
return `${report.backupkind}: last confirmed ${seen}, more than`
+ ` ${report.backupstaleafterdays} day(s) ago - the backup has stopped running.`
const age = `more than ${report.backupstaleafterdays} day(s) ago`
return taken
? `${kind}: last checked ${checked}, ${age} - the backup has stopped running.`
+ ` The newest copy is the one taken ${taken}.`
: `${kind}: last checked ${checked}, ${age} - the backup has stopped running.`
}
return `${report.backupkind}: last confirmed ${seen}.`
return taken
? `${kind}: last checked ${checked}; backup taken ${taken}.`
: `${kind}: last checked ${checked}.`
}
function staleTitle(report) {