feat: アンテナのエクスポート・インポート (#10754)

* feat: アンテナのエクスポートに対応 (misskey-dev/misskey#10690)

* feat: アンテナのインポートに対応 (misskey-dev/misskey#10690)

* fix: タイポを修正

* feat: ユーザーリストをサポート

* fix: バグを直した

* fix: バグを直した

* fix: 適当に決めた変数名を変更

* fix

* fix: 変数の変更、リファクタリング
This commit is contained in:
Chocolate Pie
2023-05-06 08:17:55 +09:00
committed by GitHub
parent 5dfbce7571
commit 39748ea0c3
11 changed files with 384 additions and 1 deletions

View File

@@ -84,6 +84,21 @@
</MkFolder>
</div>
</FormSection>
<FormSection>
<template #label><i class="ti ti-antenna"></i> {{ i18n.ts.antennas }}</template>
<div class="_gaps_s">
<MkFolder>
<template #label>{{ i18n.ts.export }}</template>
<template #icon><i class="ti ti-download"></i></template>
<MkButton primary :class="$style.button" inline @click="exportAntennas()"><i class="ti ti-download"></i> {{ i18n.ts.export }}</MkButton>
</MkFolder>
<MkFolder v-if="$i && !$i.movedTo">
<template #label>{{ i18n.ts.import }}</template>
<template #icon><i class="ti ti-upload"></i></template>
<MkButton primary :class="$style.button" inline @click="importAntennas($event)"><i class="ti ti-upload"></i> {{ i18n.ts.import }}</MkButton>
</MkFolder>
</div>
</FormSection>
</div>
</template>
@@ -151,6 +166,10 @@ const exportMuting = () => {
os.api('i/export-mute', {}).then(onExportSuccess).catch(onError);
};
const exportAntennas = () => {
os.api('i/export-antennas', {}).then(onExportSuccess).catch(onError);
};
const importFollowing = async (ev) => {
const file = await selectFile(ev.currentTarget ?? ev.target);
os.api('i/import-following', { fileId: file.id }).then(onImportSuccess).catch(onError);
@@ -171,6 +190,11 @@ const importBlocking = async (ev) => {
os.api('i/import-blocking', { fileId: file.id }).then(onImportSuccess).catch(onError);
};
const importAntennas = async (ev) => {
const file = await selectFile(ev.currentTarget ?? ev.target);
os.api('i/import-antennas', { fileId: file.id }).then(onImportSuccess).catch(onError);
};
const headerActions = $computed(() => []);
const headerTabs = $computed(() => []);