Merge pull request #2133 from mfcar/mf/backup

Add more information to the backup page
This commit is contained in:
advplyr 2023-09-22 16:56:12 -05:00 committed by GitHub
commit 102c90c4e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 40 additions and 8 deletions

View file

@ -6,7 +6,8 @@ class BackupController {
getAll(req, res) {
res.json({
backups: this.backupManager.backups.map(b => b.toJSON())
backups: this.backupManager.backups.map(b => b.toJSON()),
backupLocation: this.backupManager.backupLocation
})
}
@ -42,6 +43,9 @@ class BackupController {
Logger.debug(`Use X-Accel to serve static file ${encodedURI}`)
return res.status(204).header({ 'X-Accel-Redirect': encodedURI }).send()
}
res.setHeader('Content-disposition', 'attachment; filename=' + req.backup.filename)
res.sendFile(req.backup.fullPath)
}
@ -65,4 +69,4 @@ class BackupController {
next()
}
}
module.exports = new BackupController()
module.exports = new BackupController()