From 0c599488280d7bc43da1e4a26fc02ceae75ce047 Mon Sep 17 00:00:00 2001 From: tetsuya-ki <64536338+tetsuya-ki@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:11:38 +0000 Subject: [PATCH 1/4] =?UTF-8?q?Feat:=20=E3=82=B3=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=83=AB=E3=83=91=E3=83=8D=E3=83=AB=E5=86=85?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E4=B8=80=E8=A6=A7?= =?UTF-8?q?=E3=81=A7=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=81=A8?= =?UTF-8?q?=E8=AA=AC=E6=98=8E=E3=81=A7=E6=A4=9C=E7=B4=A2=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB(#14789)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/server/api/endpoints/admin/drive/files.ts | 12 ++++++++++++ packages/frontend/src/pages/admin/files.vue | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/admin/drive/files.ts b/packages/backend/src/server/api/endpoints/admin/drive/files.ts index 915d777e77..0ffcdcd6ec 100644 --- a/packages/backend/src/server/api/endpoints/admin/drive/files.ts +++ b/packages/backend/src/server/api/endpoints/admin/drive/files.ts @@ -43,6 +43,8 @@ export const paramDef = { default: null, description: 'The local host is represented with `null`.', }, + name: { type: 'string', nullable: true }, + comment: { type: 'string', nullable: true }, }, required: [], } as const; @@ -81,6 +83,16 @@ export default class extends Endpoint { // eslint- } } + if (ps.name) { + // 前方一致検索(%と_は無害化) + query.andWhere('file.name ilike :name', { name: ps.name.replaceAll('%', '\\%').replaceAll('_', '\\_') + '%' }); + } + + if (ps.comment) { + // 前方一致検索(%と_は無害化) + query.andWhere('file.comment ilike :comment', { comment: ps.comment.replaceAll('%', '\\%').replaceAll('_', '\\_') + '%' }); + } + const files = await query.limit(ps.limit).getMany(); return await this.driveFileEntityService.packMany(files, { detail: true, withUser: true, self: true }); diff --git a/packages/frontend/src/pages/admin/files.vue b/packages/frontend/src/pages/admin/files.vue index 4cc859227f..c13f70a8fe 100644 --- a/packages/frontend/src/pages/admin/files.vue +++ b/packages/frontend/src/pages/admin/files.vue @@ -28,6 +28,14 @@ SPDX-License-Identifier: AGPL-3.0-only +
+ + + + + + +
@@ -51,6 +59,8 @@ const type = ref(null); const searchHost = ref(''); const userId = ref(''); const viewMode = ref('grid'); +const name = ref(''); +const comment = ref(''); const pagination = { endpoint: 'admin/drive/files' as const, limit: 10, @@ -59,6 +69,8 @@ const pagination = { userId: (userId.value && userId.value !== '') ? userId.value : null, origin: origin.value, hostname: (searchHost.value && searchHost.value !== '') ? searchHost.value : null, + name: (name.value && name.value !== '') ? name.value : null, + comment: (comment.value && comment.value !== '') ? comment.value : null, })), }; From 1226bd6511feccab338d2f27609e3a529040ddc9 Mon Sep 17 00:00:00 2001 From: tetsuya-ki <64536338+tetsuya-ki@users.noreply.github.com> Date: Sat, 19 Oct 2024 15:12:00 +0000 Subject: [PATCH 2/4] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3a5e41787..82da39f266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Client - Enhance: Bull DashboardでRelationship Queueの状態も確認できるように (Cherry-picked from https://github.com/MisskeyIO/misskey/pull/751) +- Feat: コントロールパネル内のファイル一覧でファイル名と説明で検索できるように(#14789) ### Server - From 576564f24f6841741c6369e48e3540d872f1d25a Mon Sep 17 00:00:00 2001 From: tetsuya-ki <64536338+tetsuya-ki@users.noreply.github.com> Date: Sun, 20 Oct 2024 05:57:52 +0000 Subject: [PATCH 3/4] =?UTF-8?q?build-misskey-js-with-types=E3=82=92?= =?UTF-8?q?=E5=AE=9F=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/misskey-js/src/autogen/types.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/misskey-js/src/autogen/types.ts b/packages/misskey-js/src/autogen/types.ts index 698c08826a..d4e4937d18 100644 --- a/packages/misskey-js/src/autogen/types.ts +++ b/packages/misskey-js/src/autogen/types.ts @@ -6812,6 +6812,8 @@ export type operations = { * @default null */ hostname?: string | null; + name?: string | null; + comment?: string | null; }; }; }; From 2d8e6afaa9ada4a0d53112fda92918ac91673417 Mon Sep 17 00:00:00 2001 From: tetsuya-ki <64536338+tetsuya-ki@users.noreply.github.com> Date: Sun, 20 Oct 2024 06:13:19 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=83=88=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=83=91=E3=83=8D=E3=83=AB=E3=81=AE=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E4=B8=80=E8=A6=A7=E3=81=AB=E3=81=82?= =?UTF-8?q?=E3=82=8B=E6=A4=9C=E7=B4=A2=E9=A0=85=E7=9B=AE=E3=81=AE=E5=85=88?= =?UTF-8?q?=E9=A0=AD=E4=BA=8C=E3=81=A4=E4=BB=A5=E5=A4=96=E3=82=92=E3=83=95?= =?UTF-8?q?=E3=82=A9=E3=83=AB=E3=83=80=E3=81=AB=E6=A0=BC=E7=B4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/frontend/src/pages/admin/files.vue | 36 ++++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/frontend/src/pages/admin/files.vue b/packages/frontend/src/pages/admin/files.vue index c13f70a8fe..2d36f9ef05 100644 --- a/packages/frontend/src/pages/admin/files.vue +++ b/packages/frontend/src/pages/admin/files.vue @@ -20,22 +20,25 @@ SPDX-License-Identifier: AGPL-3.0-only -
- - - - - - -
-
- - - - - - -
+ + +
+ + + + + + +
+
+ + + + + + +
+
@@ -49,6 +52,7 @@ import XHeader from './_header_.vue'; import MkInput from '@/components/MkInput.vue'; import MkSelect from '@/components/MkSelect.vue'; import MkFileListForAdmin from '@/components/MkFileListForAdmin.vue'; +import MkFolder from '@/components/MkFolder.vue'; import * as os from '@/os.js'; import { lookupFile } from '@/scripts/admin-lookup.js'; import { i18n } from '@/i18n.js';