mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-11-07 16:44:16 +01:00
Add a way to see the backup location
This commit is contained in:
parent
9519f6418d
commit
bfa87a2131
@ -134,6 +134,23 @@ export default {
|
||||
this.enableBackups = !!this.newServerSettings.backupSchedule
|
||||
this.maxBackupSize = this.newServerSettings.maxBackupSize || 1
|
||||
this.cronExpression = this.newServerSettings.backupSchedule || '30 1 * * *'
|
||||
|
||||
this.loadBackupLocation()
|
||||
},
|
||||
loadBackupLocation() {
|
||||
this.processing = true
|
||||
this.$axios
|
||||
.$get('/api/backups/location')
|
||||
.then((data) => {
|
||||
this.backupLocation = data.backupLocation
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to load backup location', error)
|
||||
this.$toast.error('Failed to load backup location')
|
||||
})
|
||||
.finally(() => {
|
||||
this.processing = false
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -188,6 +188,7 @@
|
||||
"LabelBackToUser": "Back to User",
|
||||
"LabelBackupsEnableAutomaticBackups": "Enable automatic backups",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Backups saved in /metadata/backups",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsMaxBackupSize": "Maximum backup size (in GB)",
|
||||
"LabelBackupsMaxBackupSizeHelp": "As a safeguard against misconfiguration, backups will fail if they exceed the configured size.",
|
||||
"LabelBackupsNumberToKeep": "Number of backups to keep",
|
||||
@ -711,4 +712,4 @@
|
||||
"ToastSocketFailedToConnect": "Socket failed to connect",
|
||||
"ToastUserDeleteFailed": "Failed to delete user",
|
||||
"ToastUserDeleteSuccess": "User deleted"
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,12 @@ class BackupController {
|
||||
})
|
||||
}
|
||||
|
||||
getBackupLocation(req, res) {
|
||||
res.json({
|
||||
backupLocation: this.backupManager.backupLocation
|
||||
})
|
||||
}
|
||||
|
||||
create(req, res) {
|
||||
this.backupManager.requestCreateBackup(res)
|
||||
}
|
||||
|
@ -26,6 +26,10 @@ class BackupManager {
|
||||
this.backups = []
|
||||
}
|
||||
|
||||
get backupLocation() {
|
||||
return this.BackupPath
|
||||
}
|
||||
|
||||
get backupSchedule() {
|
||||
return global.ServerSettings.backupSchedule
|
||||
}
|
||||
|
@ -187,6 +187,7 @@ class ApiRouter {
|
||||
this.router.get('/backups/:id/download', BackupController.middleware.bind(this), BackupController.download.bind(this))
|
||||
this.router.get('/backups/:id/apply', BackupController.middleware.bind(this), BackupController.apply.bind(this))
|
||||
this.router.post('/backups/upload', BackupController.middleware.bind(this), BackupController.upload.bind(this))
|
||||
this.router.get('/backups/location', BackupController.middleware.bind(this), BackupController.getBackupLocation.bind(this))
|
||||
|
||||
//
|
||||
// File System Routes
|
||||
|
Loading…
Reference in New Issue
Block a user