move "request data export" from "other" to "accont data"

This commit is contained in:
dakkar 2025-04-14 16:05:21 +01:00
parent 4d76243662
commit ee79061384
2 changed files with 18 additions and 27 deletions

View file

@ -168,6 +168,19 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</MkFolder>
</SearchMarker>
<SearchMarker :keywords="['account', 'export', 'data']">
<MkFolder>
<template #icon><SearchIcon><i class="ph-database ph-bold ph-lg"></i></SearchIcon></template>
<template #label><SearchLabel>{{ i18n.ts._dataRequest.title }}</SearchLabel></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>
</SearchMarker>
</div>
</div>
</SearchMarker>
@ -179,6 +192,7 @@ import MkButton from '@/components/MkButton.vue';
import MkFolder from '@/components/MkFolder.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkRadios from '@/components/MkRadios.vue';
import FormInfo from '@/components/MkInfo.vue';
import * as os from '@/os.js';
import { misskeyApi } from '@/utility/misskey-api.js';
import { selectFile } from '@/utility/select-file.js';
@ -250,6 +264,10 @@ const exportAntennas = () => {
misskeyApi('i/export-antennas', {}).then(onExportSuccess).catch(onError);
};
const exportData = () => {
misskeyApi('i/export-data', {}).then(onExportSuccess).catch(onError);
};
const importFollowing = async (ev) => {
const file = await selectFile(ev.currentTarget ?? ev.target);
misskeyApi('i/import-following', {

View file

@ -67,19 +67,6 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkFolder>
</SearchMarker>
<SearchMarker :keywords="['account', 'export', 'data']">
<MkFolder>
<template #icon><i class="ph-database ph-bold ph-lg"></i></template>
<template #label><SearchLabel>{{ i18n.ts._dataRequest.title }}</SearchLabel></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>
</SearchMarker>
<SearchMarker :keywords="['account', 'close', 'delete']">
<MkFolder>
<template #icon><SearchIcon><i class="ti ti-alert-triangle"></i></SearchIcon></template>
@ -211,20 +198,6 @@ function migrate() {
migrateOldSettings();
}
const exportData = () => {
misskeyApi('i/export-data', {}).then(() => {
os.alert({
type: 'info',
text: i18n.ts.exportRequested,
});
}).catch((ev) => {
os.alert({
type: 'error',
text: ev.message,
});
});
};
const headerActions = computed(() => []);
const headerTabs = computed(() => []);