app archive: fix download config

This commit is contained in:
Girish Ramakrishnan
2025-10-06 22:31:17 +02:00
parent b3eb6ccde3
commit 28c0d63f89
5 changed files with 27 additions and 36 deletions
+5 -11
View File
@@ -12,8 +12,10 @@ import AppRestoreDialog from '../components/AppRestoreDialog.vue';
import Section from '../components/Section.vue';
import ArchivesModel from '../models/ArchivesModel.js';
import { download } from '../utils.js';
import BackupSitesModel from '../models/BackupSitesModel.js';
const archivesModel = ArchivesModel.create();
const backupSitesModel = BackupSitesModel.create();
const columns = {
icon: {}, // archived
@@ -98,19 +100,11 @@ async function onRestore(archive) {
}
async function onDownloadConfig(archive) {
// secrets and tokens already come with placeholder characters we remove them
// TODO fill tmp from target config
const tmp = {
remotePath: archive.remotePath,
// encrypted: !!props.config.password // we add this just to help the import UI
};
// Object.keys(props.config).forEach((k) => {
// if (props.config[k] !== SECRET_PLACEHOLDER) tmp[k] = props.config[k];
// });
const [backupConfigError, backupConfig] = await backupSitesModel.generateBackupConfig(archive);
if (backupConfigError) return console.error(backupConfigError);
const filename = `${archive.appConfig.fqdn}-archive-config-${(new Date(archive.creationTime)).toISOString().split('T')[0]}.json`;
download(filename, JSON.stringify(tmp, null, 4));
download(filename, JSON.stringify(backupConfig, null, 4));
}
onMounted(async () => {