various improvements to admin-user migrations UI

This commit is contained in:
Hazelnoot 2025-09-14 22:38:11 -04:00
parent 7e36e17e63
commit c83fa9fcd3
3 changed files with 44 additions and 52 deletions

26
locales/index.d.ts vendored
View file

@ -13642,35 +13642,27 @@ export interface Locale extends ILocale {
*/
"newAccount": string;
/**
* Previous accounts
* Also known as
*/
"previousAccounts": string;
/**
* Previous account IDs:
*/
"previousAccountIds": string;
/**
* Previous account URIs:
*/
"previousAccountUris": string;
/**
* Note: this list is provided by the user and is not verified.
*/
"previousAccountsNotVerified": string;
"alsoKnownAs": string;
/**
* Migrated at
*/
"accountMovedAt": string;
"accountMigratedAt": string;
/**
* Migrated to
*/
"accountMovedTo": string;
"accountMigratedTo": string;
/**
* Migration URI
*/
"accountMigrationUri": string;
/**
* Restart account migration
*/
"restartMigration": string;
/**
* Account migration was last attempted on {date}. If the migration failed or was incomplete, then you may click this button to restart the process.
* Account migration was last attempted {date}. If the migration failed or was incomplete, then you may click this button to restart the process.
*/
"restartMigrationDescription": ParameterizedString<"date">;
/**

View file

@ -110,38 +110,39 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #icon><i class="ph-airplane ph-bold ph-lg"></i></template>
<template #label>{{ i18n.ts.accountMigration }}</template>
<FormSection v-if="info.movedTo" first>
<template #label>{{ i18n.ts.newAccount }}</template>
<div class="_gaps">
<FormSection v-if="info.movedTo" first>
<template #label>{{ i18n.ts.newAccount }}</template>
<div style="display: flex; flex-direction: column; gap: 1em;">
<MkKeyValue v-if="info.movedAt" oneline>
<template #key>{{ i18n.ts.accountMigratedOn }}</template>
<template #value><MkTime :time="info.movedAt" :mode="'detail'"/></template>
</MkKeyValue>
<MkKeyValue oneline>
<template #key>{{ i18n.ts.accountMigratedTo }}</template>
<template #value>
<MkMention v-if="info.movedTo.user" :username="info.movedTo.user.username" :host="info.movedTo.user.host ?? localHost"/>
<MkLink v-else :url="info.movedTo.uri"/>
</template>
</MkKeyValue>
<div v-if="iAmAdmin" class="_gaps_s">
<MkInfo>{{ i18n.ts.restartMigrationDescription }}</MkInfo>
<MkButton inline @click="restartMigration"><i class="ph-airplane-takeoff ph-bold ph-lg"></i> {{ i18n.ts.restartMigration }}</MkButton>
<div class="_gaps_s">
<MkKeyValue oneline>
<template #key>{{ i18n.ts.accountMigrationUri }}</template>
<template #value><MkLink :url="info.movedTo.uri">{{ info.movedTo.uri }}</MkLink></template>
</MkKeyValue>
<MkKeyValue v-if="info.movedAt" oneline>
<template #key>{{ i18n.ts.accountMigratedAt }}</template>
<template #value><MkTime :time="info.movedAt" :mode="'detail'"/></template>
</MkKeyValue>
<MkKeyValue v-if="info.movedTo.user" oneline>
<template #key>{{ i18n.ts.accountMigratedTo }}</template>
<template #value><MkMention :username="info.movedTo.user.username" :host="info.movedTo.user.host ?? localHost"/></template>
</MkKeyValue>
</div>
</div>
</FormSection>
</FormSection>
<FormSection v-if="info.alsoKnownAs.length > 0">
<template #label>{{ i18n.ts.previousAccounts }}</template>
<FormSection v-if="info.alsoKnownAs?.length" first>
<template #label>{{ i18n.ts.alsoKnownAs }}</template>
<ul style="display: flex; flex-direction: column; gap: 1em;">
<li v-for="aka of info.alsoKnownAs">
<MkMention v-if="aka.user" :username="aka.user.username" :host="aka.user.host ?? localHost"/>
<MkLink v-else :url="aka.uri"/>
</li>
</ul>
</FormSection>
<ul class="_gaps_s">
<li v-for="aka of info.alsoKnownAs" :key="aka.uri">
<div style="display: flex; flex-direction: row; gap: 0.75em; align-items: center">
<MkMention v-if="aka.user" :username="aka.user.username" :host="aka.user.host ?? localHost"/>
<MkLink :url="aka.uri">({{ aka.uri }})</MkLink>
</div>
</li>
</ul>
</FormSection>
</div>
</MkFolder>
<MkFolder v-if="iAmModerator" :defaultOpen="moderationNote.length > 0" :sticky="false">
@ -188,6 +189,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.buttonStrip">
<MkButton v-if="user.host != null" inline @click="updateRemoteUser"><i class="ph-cloud-arrow-down ph-bold ph-lg"></i> {{ i18n.ts.updateRemoteUser }}</MkButton>
<MkButton v-if="user.host == null" inline accent @click="resetPassword"><i class="ph-password ph-bold ph-lg"></i> {{ i18n.ts.resetPassword }}</MkButton>
<MkButton v-if="info.movedTo && iAmAdmin" inline @click="restartMigration"><i class="ph-airplane-takeoff ph-bold ph-lg"></i> {{ i18n.ts.restartMigration }}</MkButton>
<MkButton inline accent @click="unsetUserAvatar"><i class="ph-camera-slash ph-bold ph-lg"></i> {{ i18n.ts.unsetUserAvatar }}</MkButton>
<MkButton inline accent @click="unsetUserBanner"><i class="ph-image-broken ph-bold ph-lg"></i> {{ i18n.ts.unsetUserBanner }}</MkButton>
<MkButton inline danger @click="deleteAllFiles"><i class="ph-trash ph-bold ph-lg"></i> {{ i18n.ts.deleteAllFiles }}</MkButton>

View file

@ -724,12 +724,10 @@ enableAllRead: "Enable all read-only permissions"
enableAllWrite: "Enable all write/edit permissions"
newAccount: "New account"
previousAccounts: "Previous accounts"
previousAccountIds: "Previous account IDs:"
previousAccountUris: "Previous account URIs:"
previousAccountsNotVerified: "Note: this list is provided by the user and is not verified."
accountMovedAt: "Migrated at"
accountMovedTo: "Migrated to"
alsoKnownAs: "Also known as"
accountMigratedAt: "Migrated at"
accountMigratedTo: "Migrated to"
accountMigrationUri: "Migration URI"
restartMigration: "Restart account migration"
restartMigrationDescription: "Account migration was last attempted on {date}. If the migration failed or was incomplete, then you may click this button to restart the process."
restartMigrationDescription: "Account migration was last attempted {date}. If the migration failed or was incomplete, then you may click this button to restart the process."
restartMigrationConfirm: "Are you sure you want to restart this account migration?"