diff --git a/locales/en-US.yml b/locales/en-US.yml index 2117fb056eed..f13ddc7bfd41 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -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." 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." - movedTo: "New account:" + movedTo: "Migrated account:" + movedToServer: "Migrated server" + movedFromServer: "Original server" _achievements: earnedAt: "Unlocked at" _types: diff --git a/locales/index.d.ts b/locales/index.d.ts index dce1d15b8015..269480fb0b5a 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -6004,6 +6004,14 @@ export interface Locale extends ILocale { * 移行先のアカウント: */ "movedTo": string; + /** + * 移行先のサーバー + */ + "movedToServer": string; + /** + * 移行元のサーバー + */ + "movedFromServer": string; }; "_achievements": { /** diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index e5038ead054b..60507f0b1f81 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1511,6 +1511,8 @@ _accountMigration: movedAndCannotBeUndone: "\nアカウントは移行されています。\n移行を取り消すことはできません。" postMigrationNote: "このアカウントからのフォロー解除は移行操作から24時間後に実行されます。\nこのアカウントのフォロー・フォロワー数は0になっています。フォロワーの解除はされないため、あなたのフォロワーはこのアカウントのフォロワー向け投稿を引き続き閲覧できます。" movedTo: "移行先のアカウント:" + movedToServer: "移行先のサーバー" + movedFromServer: "移行元のサーバー" _achievements: earnedAt: "獲得日時" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 6bc34827ae40..001aeb1248ca 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1496,6 +1496,8 @@ _accountMigration: movedAndCannotBeUndone: "\n이사한 계정입니다.\n이사는 취소할 수 없습니다." postMigrationNote: "이 계정의 팔로잉 해제는 이사 후 24시간 뒤에 실행됩니다.\n이 계정의 팔로우 및 팔로워 수는 0으로 표시됩니다. 팔로워 해제는 이루어지지 않으므로, 당신의 팔로워는 이 계정의 팔로워 한정 게시물을 계속해서 열람할 수 있습니다." movedTo: "이사할 계정:" + movedToServer: "이사한 서버" + movedFromServer: "기존 서버" _achievements: earnedAt: "달성 일시" _types: diff --git a/packages/backend/src/server/api/endpoints/admin/show-user-account-move-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-user-account-move-logs.ts index 46e4bd8cc676..ea353b75d762 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-user-account-move-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-user-account-move-logs.ts @@ -62,6 +62,8 @@ export const paramDef = { untilId: { type: 'string', format: 'misskey:id' }, movedFromId: { 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: [], } as const; @@ -86,6 +88,28 @@ export default class extends Endpoint { // eslint- 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(); return await this.userAccountMoveLogEntityService.packMany(accountMoveLogs, me); diff --git a/packages/frontend/src/pages/admin/useraccountmovelog.vue b/packages/frontend/src/pages/admin/useraccountmovelog.vue index 6a37d4b6596c..883590b2ce98 100644 --- a/packages/frontend/src/pages/admin/useraccountmovelog.vue +++ b/packages/frontend/src/pages/admin/useraccountmovelog.vue @@ -2,13 +2,29 @@ -
- - - - - - +
+
+ + + + + + + + + + + + +
+
+ + + + + + +
@@ -48,11 +64,15 @@ import { i18n } from '@/i18n.js'; import { definePageMetadata } from '@/scripts/page-metadata.js'; import { userPage } from '@/filters/user.js'; import MkFolder from '@/components/MkFolder.vue'; +import MkSwitch from '@/components/MkSwitch.vue'; +import MkSelect from '@/components/MkSelect.vue'; const logs = shallowRef>(); const movedToId = ref(''); const movedFromId = ref(''); +const from = ref('all'); +const to = ref('all'); const pagination = { endpoint: 'admin/show-user-account-move-logs' as const, @@ -60,6 +80,8 @@ const pagination = { params: computed(() => ({ movedFromId: movedFromId.value === '' ? null : movedFromId.value, movedToId: movedToId.value === '' ? null : movedToId.value, + from: from.value, + to: to.value, })), }; @@ -95,4 +117,14 @@ definePageMetadata(() => ({ flex-direction: column; } +.inputs { + display: flex; + gap: 8px; + flex-wrap: wrap; +} + +.input { + margin: 0; + flex: 1; +} diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 9990683c8828..a3998e206b7e 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -9699,6 +9699,10 @@ export type operations = { movedFromId?: string | null; /** Format: misskey:id */ movedToId?: string | null; + /** @enum {string|null} */ + from?: 'local' | 'remote' | 'all'; + /** @enum {string|null} */ + to?: 'local' | 'remote' | 'all'; }; }; };