archive: display the site name of latest backup

This commit is contained in:
Girish Ramakrishnan
2025-10-14 16:50:25 +02:00
parent 1f60c6dd21
commit d3d668d930
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -91,10 +91,17 @@ async function onArchive() {
}
onMounted(async () => {
const [error, result] = await appsModel.backups(props.app.id);
let [error, result] = await appsModel.backups(props.app.id);
if (error) return console.error(error);
latestBackup.value = result[0] || null;
if (latestBackup.value) {
[error, result] = await appsModel.listBackupSites(props.app.id);
if (error) return console.error(error);
latestBackup.value.siteName = result.find((s) => s.id === latestBackup.value.siteId).name;
}
});
</script>
@@ -120,7 +127,7 @@ onMounted(async () => {
<div v-if="app.type !== APP_TYPES.PROXIED">
<label>{{ $t('app.archive.title') }}</label>
<div v-html="$t('app.archive.description')"></div>
<p class="text-bold text-success" v-if="latestBackup" v-html="$t('app.archive.latestBackupInfo', { date: prettyLongDate(latestBackup.creationTime) })"></p>
<p class="text-bold text-success" v-if="latestBackup" v-html="$t('app.archive.latestBackupInfo', { date: prettyLongDate(latestBackup.creationTime), siteName: latestBackup.siteName })"></p>
<p class="text-warning" v-else v-html="$t('app.archive.noBackup')"></p>
<Button :disabled="!latestBackup" @click="onArchive()">{{ $t('app.archive.action') }}</Button>
</div>