diff --git a/dashboard/src/components/SystemBackupList.vue b/dashboard/src/components/SystemBackupList.vue index b1d3d606d..a5e4fbdde 100644 --- a/dashboard/src/components/SystemBackupList.vue +++ b/dashboard/src/components/SystemBackupList.vue @@ -164,16 +164,7 @@ async function refreshBackups() { result.forEach(function (backup) { backup.site = sites.value.find(t => t.id === backup.siteId); - - // filled when opening the info dialog - we only show apps for the moment - backup.contents = backup.dependsOn.filter(c => c.indexOf('app_') === 0).map(c => { - return { - id: c, - label: null, - fqdn: null, - stats: null - }; - }); + backup.appCount = backup.dependsOn.filter(c => c.indexOf('app_') === 0).length; }); backups.value = result; @@ -195,6 +186,7 @@ const infoDialog = useTemplateRef('infoDialog'); const infoBackup = ref({ contents: [] }); async function onInfo(backup) { infoBackup.value = backup; + infoBackup.value.contents = []; infoDialog.value.open(); // amend detailed app info @@ -207,20 +199,27 @@ async function onInfo(backup) { appsById[app.id] = app; }); - for (const content of infoBackup.value.contents) { - const match = content.id.match(/app_(.*?)_.*/); // *? means non-greedy + for (const contentId of infoBackup.value.dependsOn) { + const match = contentId.match(/(mail|app)_(.*?)_.*/); // *? means non-greedy if (!match) continue; - const [error, backup] = await backupsModel.get(content.id); + const [error, backup] = await backupsModel.get(contentId); if (error) console.error(error); + const content = { id: null, label: null, fqdn: null, stats: null }; content.stats = backup.stats; - const app = appsById[match[1]]; - if (app) { - content.id = app.id; - content.label = app.label; - content.fqdn = app.fqdn; + if (match[1] === 'mail') { + content.id = 'mail'; + content.label = 'Mail Server'; } else { - content.id = match[1]; + const app = appsById[match[2]]; + if (app) { + content.id = app.id; + content.label = app.label; + content.fqdn = app.fqdn; + } else { // uninstalled app + content.id = match[2]; + } } + infoBackup.value.contents.push(content); } } @@ -313,7 +312,8 @@ defineExpose({ refresh });
{{ $t('backups.backupDetails.list', { appCount: infoBackup.contents.length }) }}: