feat(account-migration): アカウント移行ログのフィルターを追加 (MisskeyIO#919)
This commit is contained in:
parent
43e5b8d5f8
commit
ff85d650bf
7 changed files with 82 additions and 8 deletions
|
@ -1498,7 +1498,9 @@ _accountMigration:
|
||||||
migrationConfirm: "Really migrate this account to {account}? Once started, this process cannot be stopped or taken back, and you will not be able to use this account in its original state anymore."
|
migrationConfirm: "Really migrate this account to {account}? Once started, this process cannot be stopped or taken back, and you will not be able to use this account in its original state anymore."
|
||||||
movedAndCannotBeUndone: "\nThis account has been migrated.\nMigration cannot be reversed."
|
movedAndCannotBeUndone: "\nThis account has been migrated.\nMigration cannot be reversed."
|
||||||
postMigrationNote: "This account will unfollow all accounts it is currently following 24 hours after migration finishes.\nBoth the number of follows and followers will then become zero. To avoid your followers from being unable to see followers only posts of this account, they will however continue following this account."
|
postMigrationNote: "This account will unfollow all accounts it is currently following 24 hours after migration finishes.\nBoth the number of follows and followers will then become zero. To avoid your followers from being unable to see followers only posts of this account, they will however continue following this account."
|
||||||
movedTo: "New account:"
|
movedTo: "Migrated account:"
|
||||||
|
movedToServer: "Migrated server"
|
||||||
|
movedFromServer: "Original server"
|
||||||
_achievements:
|
_achievements:
|
||||||
earnedAt: "Unlocked at"
|
earnedAt: "Unlocked at"
|
||||||
_types:
|
_types:
|
||||||
|
|
8
locales/index.d.ts
vendored
8
locales/index.d.ts
vendored
|
@ -6004,6 +6004,14 @@ export interface Locale extends ILocale {
|
||||||
* 移行先のアカウント:
|
* 移行先のアカウント:
|
||||||
*/
|
*/
|
||||||
"movedTo": string;
|
"movedTo": string;
|
||||||
|
/**
|
||||||
|
* 移行先のサーバー
|
||||||
|
*/
|
||||||
|
"movedToServer": string;
|
||||||
|
/**
|
||||||
|
* 移行元のサーバー
|
||||||
|
*/
|
||||||
|
"movedFromServer": string;
|
||||||
};
|
};
|
||||||
"_achievements": {
|
"_achievements": {
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1511,6 +1511,8 @@ _accountMigration:
|
||||||
movedAndCannotBeUndone: "\nアカウントは移行されています。\n移行を取り消すことはできません。"
|
movedAndCannotBeUndone: "\nアカウントは移行されています。\n移行を取り消すことはできません。"
|
||||||
postMigrationNote: "このアカウントからのフォロー解除は移行操作から24時間後に実行されます。\nこのアカウントのフォロー・フォロワー数は0になっています。フォロワーの解除はされないため、あなたのフォロワーはこのアカウントのフォロワー向け投稿を引き続き閲覧できます。"
|
postMigrationNote: "このアカウントからのフォロー解除は移行操作から24時間後に実行されます。\nこのアカウントのフォロー・フォロワー数は0になっています。フォロワーの解除はされないため、あなたのフォロワーはこのアカウントのフォロワー向け投稿を引き続き閲覧できます。"
|
||||||
movedTo: "移行先のアカウント:"
|
movedTo: "移行先のアカウント:"
|
||||||
|
movedToServer: "移行先のサーバー"
|
||||||
|
movedFromServer: "移行元のサーバー"
|
||||||
|
|
||||||
_achievements:
|
_achievements:
|
||||||
earnedAt: "獲得日時"
|
earnedAt: "獲得日時"
|
||||||
|
|
|
@ -1496,6 +1496,8 @@ _accountMigration:
|
||||||
movedAndCannotBeUndone: "\n이사한 계정입니다.\n이사는 취소할 수 없습니다."
|
movedAndCannotBeUndone: "\n이사한 계정입니다.\n이사는 취소할 수 없습니다."
|
||||||
postMigrationNote: "이 계정의 팔로잉 해제는 이사 후 24시간 뒤에 실행됩니다.\n이 계정의 팔로우 및 팔로워 수는 0으로 표시됩니다. 팔로워 해제는 이루어지지 않으므로, 당신의 팔로워는 이 계정의 팔로워 한정 게시물을 계속해서 열람할 수 있습니다."
|
postMigrationNote: "이 계정의 팔로잉 해제는 이사 후 24시간 뒤에 실행됩니다.\n이 계정의 팔로우 및 팔로워 수는 0으로 표시됩니다. 팔로워 해제는 이루어지지 않으므로, 당신의 팔로워는 이 계정의 팔로워 한정 게시물을 계속해서 열람할 수 있습니다."
|
||||||
movedTo: "이사할 계정:"
|
movedTo: "이사할 계정:"
|
||||||
|
movedToServer: "이사한 서버"
|
||||||
|
movedFromServer: "기존 서버"
|
||||||
_achievements:
|
_achievements:
|
||||||
earnedAt: "달성 일시"
|
earnedAt: "달성 일시"
|
||||||
_types:
|
_types:
|
||||||
|
|
|
@ -62,6 +62,8 @@ export const paramDef = {
|
||||||
untilId: { type: 'string', format: 'misskey:id' },
|
untilId: { type: 'string', format: 'misskey:id' },
|
||||||
movedFromId: { type: 'string', format: 'misskey:id', nullable: true },
|
movedFromId: { type: 'string', format: 'misskey:id', nullable: true },
|
||||||
movedToId: { type: 'string', format: 'misskey:id', nullable: true },
|
movedToId: { type: 'string', format: 'misskey:id', nullable: true },
|
||||||
|
from: { type: 'string', enum: ['local', 'remote', 'all'], nullable: true },
|
||||||
|
to: { type: 'string', enum: ['local', 'remote', 'all'], nullable: true },
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -86,6 +88,28 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
query.andWhere('accountMoveLogs.movedToId = :movedToId', { movedToId: ps.movedToId });
|
query.andWhere('accountMoveLogs.movedToId = :movedToId', { movedToId: ps.movedToId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ps.from != null || ps.to != null) {
|
||||||
|
query
|
||||||
|
.innerJoin('accountMoveLogs.movedFrom', 'movedFrom')
|
||||||
|
.innerJoin('accountMoveLogs.movedTo', 'movedTo');
|
||||||
|
|
||||||
|
if (ps.from === 'local') {
|
||||||
|
query.andWhere('movedFrom.host IS NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps.from === 'remote') {
|
||||||
|
query.andWhere('movedFrom.host IS NOT NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps.to === 'local') {
|
||||||
|
query.andWhere('movedTo.host IS NULL');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps.to === 'remote') {
|
||||||
|
query.andWhere('movedTo.host IS NOT NULL');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const accountMoveLogs = await query.limit(ps.limit).getMany();
|
const accountMoveLogs = await query.limit(ps.limit).getMany();
|
||||||
|
|
||||||
return await this.userAccountMoveLogEntityService.packMany(accountMoveLogs, me);
|
return await this.userAccountMoveLogEntityService.packMany(accountMoveLogs, me);
|
||||||
|
|
|
@ -2,13 +2,29 @@
|
||||||
<MkStickyContainer>
|
<MkStickyContainer>
|
||||||
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
||||||
<MkSpacer :contentMax="900">
|
<MkSpacer :contentMax="900">
|
||||||
<div style="display: flex; gap: var(--margin); flex-wrap: wrap;">
|
<div style="display: flex; flex-direction: column; gap: var(--margin); flex-wrap: wrap;">
|
||||||
<MkInput v-model="movedFromId" style="margin: 0; flex: 1;">
|
<div :class="$style.inputs">
|
||||||
<template #label> {{ i18n.ts.moveFromId }}</template>
|
<MkSelect v-model="from" :class="$style.input">
|
||||||
</MkInput>
|
<template #label>{{ i18n.ts._accountMigration.movedFromServer }}</template>
|
||||||
<MkInput v-model="movedToId" style="margin: 0; flex: 1;">
|
<option value="all">{{ i18n.ts.all }}</option>
|
||||||
<template #label> {{ i18n.ts.movedToId }}</template>
|
<option value="remote">{{ i18n.ts.remote }}</option>
|
||||||
</MkInput>
|
<option value="local">{{ i18n.ts.local }}</option>
|
||||||
|
</MkSelect>
|
||||||
|
<MkSelect v-model="to" :class="$style.input">
|
||||||
|
<template #label>{{ i18n.ts._accountMigration.movedToServer }}</template>
|
||||||
|
<option value="all">{{ i18n.ts.all }}</option>
|
||||||
|
<option value="remote">{{ i18n.ts.remote }}</option>
|
||||||
|
<option value="local">{{ i18n.ts.local }}</option>
|
||||||
|
</MkSelect>
|
||||||
|
</div>
|
||||||
|
<div :class="$style.inputs">
|
||||||
|
<MkInput v-model="movedFromId" :class="$style.input">
|
||||||
|
<template #label> {{ i18n.ts.moveFromId }}</template>
|
||||||
|
</MkInput>
|
||||||
|
<MkInput v-model="movedToId" :class="$style.input">
|
||||||
|
<template #label> {{ i18n.ts.movedToId }}</template>
|
||||||
|
</MkInput>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<MkPagination v-slot="{items}" ref="logs" :pagination="pagination" style="margin-top: var(--margin);">
|
<MkPagination v-slot="{items}" ref="logs" :pagination="pagination" style="margin-top: var(--margin);">
|
||||||
|
@ -48,11 +64,15 @@ import { i18n } from '@/i18n.js';
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
import { userPage } from '@/filters/user.js';
|
import { userPage } from '@/filters/user.js';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
|
import MkSelect from '@/components/MkSelect.vue';
|
||||||
|
|
||||||
const logs = shallowRef<InstanceType<typeof MkPagination>>();
|
const logs = shallowRef<InstanceType<typeof MkPagination>>();
|
||||||
|
|
||||||
const movedToId = ref('');
|
const movedToId = ref('');
|
||||||
const movedFromId = ref('');
|
const movedFromId = ref('');
|
||||||
|
const from = ref('all');
|
||||||
|
const to = ref('all');
|
||||||
|
|
||||||
const pagination = {
|
const pagination = {
|
||||||
endpoint: 'admin/show-user-account-move-logs' as const,
|
endpoint: 'admin/show-user-account-move-logs' as const,
|
||||||
|
@ -60,6 +80,8 @@ const pagination = {
|
||||||
params: computed(() => ({
|
params: computed(() => ({
|
||||||
movedFromId: movedFromId.value === '' ? null : movedFromId.value,
|
movedFromId: movedFromId.value === '' ? null : movedFromId.value,
|
||||||
movedToId: movedToId.value === '' ? null : movedToId.value,
|
movedToId: movedToId.value === '' ? null : movedToId.value,
|
||||||
|
from: from.value,
|
||||||
|
to: to.value,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -95,4 +117,14 @@ definePageMetadata(() => ({
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inputs {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
margin: 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -9699,6 +9699,10 @@ export type operations = {
|
||||||
movedFromId?: string | null;
|
movedFromId?: string | null;
|
||||||
/** Format: misskey:id */
|
/** Format: misskey:id */
|
||||||
movedToId?: string | null;
|
movedToId?: string | null;
|
||||||
|
/** @enum {string|null} */
|
||||||
|
from?: 'local' | 'remote' | 'all';
|
||||||
|
/** @enum {string|null} */
|
||||||
|
to?: 'local' | 'remote' | 'all';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue