upd: add frontend option to export data

This commit is contained in:
Mar0xy 2023-11-07 11:38:50 +01:00
parent fabb876256
commit e409abdd40
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
4 changed files with 43 additions and 0 deletions

View file

@ -34,6 +34,17 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
<MkFolder>
<template #icon><i class="ph-database ph-bold ph-lg"></i></template>
<template #label>{{ i18n.ts._dataRequest.title }}</template>
<div class="_gaps_m">
<FormInfo warn>{{ i18n.ts._dataRequest.warn }}</FormInfo>
<FormInfo>{{ i18n.ts._dataRequest.text }}</FormInfo>
<MkButton primary @click="exportData">{{ i18n.ts._dataRequest.button }}</MkButton>
</div>
</MkFolder>
<MkFolder>
<template #icon><i class="ph-warning ph-bold ph-lg"></i></template>
<template #label>{{ i18n.ts.closeAccount }}</template>
@ -156,6 +167,20 @@ async function updateRepliesAll(withReplies: boolean) {
await os.api('following/update-all', { withReplies });
}
const exportData = () => {
os.api('i/export-data', {}).then(() => {
os.alert({
type: 'info',
text: i18n.ts.exportRequested,
});
}).catch((ev) => {
os.alert({
type: 'error',
text: ev.message,
});
});
};
watch([
enableCondensedLineForAcct,
], async () => {