mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-03-24 00:16:39 +01:00
Merge pull request #2133 from mfcar/mf/backup
Add more information to the backup page
This commit is contained in:
commit
102c90c4e8
@ -164,6 +164,7 @@ export default {
|
||||
this.$axios
|
||||
.$get('/api/backups')
|
||||
.then((data) => {
|
||||
this.$emit('loaded', data.backupLocation)
|
||||
this.setBackups(data.backups || [])
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<app-settings-content :header-text="$strings.HeaderBackups" :description="$strings.MessageBackupsDescription">
|
||||
<div v-if="backupLocation" class="flex items-center mb-4">
|
||||
<span class="material-icons-outlined text-2xl text-black-50 mr-2">folder</span>
|
||||
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelBackupLocation }}:</span>
|
||||
<div class="text-gray-100 pl-4">{{ backupLocation }}</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center py-2">
|
||||
<ui-toggle-switch v-model="enableBackups" small :disabled="updatingServerSettings" @input="updateBackupsSettings" />
|
||||
<ui-tooltip :text="$strings.LabelBackupsEnableAutomaticBackupsHelp">
|
||||
@ -11,7 +17,7 @@
|
||||
<div v-if="enableBackups" class="mb-6">
|
||||
<div class="flex items-center pl-6 mb-2">
|
||||
<span class="material-icons-outlined text-2xl text-black-50 mr-2">schedule</span>
|
||||
<div class="w-48">
|
||||
<div class="w-40">
|
||||
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.HeaderSchedule }}:</span>
|
||||
</div>
|
||||
<div class="text-gray-100">{{ scheduleDescription }}</div>
|
||||
@ -20,7 +26,7 @@
|
||||
|
||||
<div v-if="nextBackupDate" class="flex items-center pl-6 py-0.5 px-2">
|
||||
<span class="material-icons-outlined text-2xl text-black-50 mr-2">event</span>
|
||||
<div class="w-48">
|
||||
<div class="w-40">
|
||||
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelNextBackupDate }}:</span>
|
||||
</div>
|
||||
<div class="text-gray-100">{{ nextBackupDate }}</div>
|
||||
@ -43,7 +49,7 @@
|
||||
</ui-tooltip>
|
||||
</div>
|
||||
|
||||
<tables-backups-table />
|
||||
<tables-backups-table @loaded="backupsLoaded" />
|
||||
|
||||
<modals-backup-schedule-modal v-model="showCronBuilder" :cron-expression.sync="cronExpression" />
|
||||
</app-settings-content>
|
||||
@ -65,7 +71,8 @@ export default {
|
||||
maxBackupSize: 1,
|
||||
cronExpression: '',
|
||||
newServerSettings: {},
|
||||
showCronBuilder: false
|
||||
showCronBuilder: false,
|
||||
backupLocation: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -98,6 +105,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
backupsLoaded(backupLocation) {
|
||||
this.backupLocation = backupLocation
|
||||
},
|
||||
updateBackupsSettings() {
|
||||
if (isNaN(this.maxBackupSize) || this.maxBackupSize <= 0) {
|
||||
this.$toast.error('Invalid maximum backup size')
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Autoren",
|
||||
"LabelAutoDownloadEpisodes": "Episoden automatisch herunterladen",
|
||||
"LabelBackToUser": "Zurück zum Benutzer",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Automatische Sicherung aktivieren",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Backups werden in /metadata/backups gespeichert",
|
||||
"LabelBackupsMaxBackupSize": "Maximale Sicherungsgröße (in GB)",
|
||||
@ -711,4 +712,4 @@
|
||||
"ToastSocketFailedToConnect": "Verbindung zum WebSocket fehlgeschlagen",
|
||||
"ToastUserDeleteFailed": "Benutzer konnte nicht gelöscht werden",
|
||||
"ToastUserDeleteSuccess": "Benutzer gelöscht"
|
||||
}
|
||||
}
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Authors",
|
||||
"LabelAutoDownloadEpisodes": "Auto Download Episodes",
|
||||
"LabelBackToUser": "Back to User",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Enable automatic backups",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Backups saved in /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Maximum backup size (in GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Autores",
|
||||
"LabelAutoDownloadEpisodes": "Descargar Episodios Automáticamente",
|
||||
"LabelBackToUser": "Regresar a Usuario",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Habilitar Respaldo Automático",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Respaldo Guardado en /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Tamaño Máximo de Respaldos (en GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Auteurs",
|
||||
"LabelAutoDownloadEpisodes": "Téléchargement automatique d’épisode",
|
||||
"LabelBackToUser": "Revenir à l’Utilisateur",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Activer les sauvegardes automatiques",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Sauvegardes Enregistrées dans /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Taille maximale de la sauvegarde (en Go)",
|
||||
@ -711,4 +712,4 @@
|
||||
"ToastSocketFailedToConnect": "Échec de la connexion WebSocket",
|
||||
"ToastUserDeleteFailed": "Échec de la suppression de l’utilisateur",
|
||||
"ToastUserDeleteSuccess": "Utilisateur supprimé"
|
||||
}
|
||||
}
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Authors",
|
||||
"LabelAutoDownloadEpisodes": "Auto Download Episodes",
|
||||
"LabelBackToUser": "Back to User",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Enable automatic backups",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Backups saved in /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Maximum backup size (in GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Authors",
|
||||
"LabelAutoDownloadEpisodes": "Auto Download Episodes",
|
||||
"LabelBackToUser": "Back to User",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Enable automatic backups",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Backups saved in /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Maximum backup size (in GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Autori",
|
||||
"LabelAutoDownloadEpisodes": "Automatski preuzmi epizode",
|
||||
"LabelBackToUser": "Nazad k korisniku",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Uključi automatski backup",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Backups spremljeni u /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Maksimalna količina backupa (u GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Autori",
|
||||
"LabelAutoDownloadEpisodes": "Auto Download Episodi",
|
||||
"LabelBackToUser": "Torna a Utenti",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Abilita backup Automatico",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "I Backup saranno salvati in /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Dimensione massima backup (in GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Autoriai",
|
||||
"LabelAutoDownloadEpisodes": "Automatiškai atsisiųsti epizodus",
|
||||
"LabelBackToUser": "Grįžti į naudotoją",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Įjungti automatinį atsarginių kopijų kūrimą",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Atsarginės kopijos bus išsaugotos /metadata/backups aplanke",
|
||||
"LabelBackupsMaxBackupSize": "Maksimalus atsarginių kopijų dydis (GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Auteurs",
|
||||
"LabelAutoDownloadEpisodes": "Afleveringen automatisch downloaden",
|
||||
"LabelBackToUser": "Terug naar gebruiker",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Automatische back-ups inschakelen",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Back-ups opgeslagen in /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Maximale back-up-grootte (in GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Autorzy",
|
||||
"LabelAutoDownloadEpisodes": "Automatyczne pobieranie odcinków",
|
||||
"LabelBackToUser": "Powrót",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Włącz automatyczne kopie zapasowe",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Kopie zapasowe są zapisywane w folderze /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Maksymalny łączny rozmiar backupów (w GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "Авторы",
|
||||
"LabelAutoDownloadEpisodes": "Скачивать эпизоды автоматически",
|
||||
"LabelBackToUser": "Назад к пользователю",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "Включить автоматическое бэкапирование",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "Бэкапы сохраняются в /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "Максимальный размер бэкапа (в GB)",
|
||||
|
@ -186,6 +186,7 @@
|
||||
"LabelAuthors": "作者",
|
||||
"LabelAutoDownloadEpisodes": "自动下载剧集",
|
||||
"LabelBackToUser": "返回到用户",
|
||||
"LabelBackupLocation": "Backup Location",
|
||||
"LabelBackupsEnableAutomaticBackups": "启用自动备份",
|
||||
"LabelBackupsEnableAutomaticBackupsHelp": "备份保存到 /metadata/backups",
|
||||
"LabelBackupsMaxBackupSize": "最大备份大小 (GB)",
|
||||
|
@ -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()
|
||||
|
@ -26,6 +26,10 @@ class BackupManager {
|
||||
this.backups = []
|
||||
}
|
||||
|
||||
get backupLocation() {
|
||||
return this.BackupPath
|
||||
}
|
||||
|
||||
get backupSchedule() {
|
||||
return global.ServerSettings.backupSchedule
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user