mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-17 19:28:58 +01:00
25ebb73756
* add Move activity * add endpoint to move from local to remote * follow move activity coming to inbox * fix move endpoint * add known-as endpoint to create account alias * add migration page * add route to migration page * add move and known-as endpoints * fix dependnecies error * fix new endpoints * fix move activity id * fix refollow * add movedToUri and alsoKnownAs to api * fix moveToUri indicator * fix missing context * add chengelog * rename MkMoved to MkAccountMoved * add missing semicolon * fix targetUri * fix followings query * remove redundant null check
73 lines
1.8 KiB
Vue
73 lines
1.8 KiB
Vue
<template>
|
|
<div class="_gaps_m">
|
|
<FormSection>
|
|
<template #label>{{ i18n.ts.moveTo }}</template>
|
|
<MkInput v-model="moveToAccount" manual-save>
|
|
<template #prefix><i class="ti ti-plane-departure"></i></template>
|
|
<template #label>{{ i18n.ts.moveToLabel }}</template>
|
|
</MkInput>
|
|
</FormSection>
|
|
<FormInfo warn>{{ i18n.ts.moveAccountDescription }}</FormInfo>
|
|
|
|
<FormSection>
|
|
<template #label>{{ i18n.ts.moveFrom }}</template>
|
|
<MkInput v-model="accountAlias" manual-save>
|
|
<template #prefix><i class="ti ti-plane-arrival"></i></template>
|
|
<template #label>{{ i18n.ts.moveFromLabel }}</template>
|
|
</MkInput>
|
|
</FormSection>
|
|
<FormInfo warn>{{ i18n.ts.moveFromDescription }}</FormInfo>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts" setup>
|
|
import { ref, watch } from 'vue';
|
|
import FormSection from '@/components/form/section.vue';
|
|
import FormInfo from '@/components/MkInfo.vue';
|
|
import MkInput from '@/components/MkInput.vue';
|
|
import * as os from '@/os';
|
|
import { i18n } from '@/i18n';
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
const moveToAccount = ref('');
|
|
const accountAlias = ref('');
|
|
|
|
async function move(): Promise<void> {
|
|
const account = moveToAccount.value;
|
|
const confirm = await os.confirm({
|
|
type: 'warning',
|
|
text: i18n.t('migrationConfirm', { account: account.toString() }),
|
|
});
|
|
if (confirm.canceled) return;
|
|
os.apiWithDialog('i/move', {
|
|
moveToAccount: account,
|
|
});
|
|
}
|
|
|
|
async function save(): Promise<void> {
|
|
const account = accountAlias.value;
|
|
os.apiWithDialog('i/known-as', {
|
|
alsoKnownAs: account,
|
|
});
|
|
}
|
|
|
|
watch(accountAlias, async () => {
|
|
await save();
|
|
});
|
|
|
|
watch(moveToAccount, async () => {
|
|
await move();
|
|
});
|
|
|
|
definePageMetadata({
|
|
title: i18n.ts.migration,
|
|
icon: 'ti ti-plane',
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.description {
|
|
font-size: .85em;
|
|
padding: 1rem;
|
|
}
|
|
</style>
|