From dd4c411d228626126625019c9c7f9f60ea15e562 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 26 Dec 2022 09:22:10 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=80=E3=83=83=E3=82=B7=E3=83=A5=E3=83=9C?= =?UTF-8?q?=E3=83=BC=E3=83=89=E3=81=AB=E3=83=A2=E3=83=87=E3=83=AC=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E3=83=BC=E4=B8=80=E8=A6=A7=E3=82=92=E8=A1=A8=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/api/endpoints/admin/show-users.ts | 4 +- .../src/pages/admin/overview.moderators.vue | 52 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 packages/client/src/pages/admin/overview.moderators.vue diff --git a/packages/backend/src/server/api/endpoints/admin/show-users.ts b/packages/backend/src/server/api/endpoints/admin/show-users.ts index 5471ef9b4..33e1be804 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-users.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-users.ts @@ -26,7 +26,7 @@ export const paramDef = { properties: { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, offset: { type: 'integer', default: 0 }, - sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt'] }, + sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt', '+lastActiveDate', '-lastActiveDate'] }, state: { type: 'string', enum: ['all', 'alive', 'available', 'admin', 'moderator', 'adminOrModerator', 'silenced', 'suspended'], default: 'all' }, origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'combined' }, username: { type: 'string', nullable: true, default: null }, @@ -82,6 +82,8 @@ export default class extends Endpoint { case '-createdAt': query.orderBy('user.createdAt', 'ASC'); break; case '+updatedAt': query.orderBy('user.updatedAt', 'DESC', 'NULLS LAST'); break; case '-updatedAt': query.orderBy('user.updatedAt', 'ASC', 'NULLS FIRST'); break; + case '+lastActiveDate': query.orderBy('user.lastActiveDate', 'DESC', 'NULLS LAST'); break; + case '-lastActiveDate': query.orderBy('user.lastActiveDate', 'ASC', 'NULLS FIRST'); break; default: query.orderBy('user.id', 'ASC'); break; } diff --git a/packages/client/src/pages/admin/overview.moderators.vue b/packages/client/src/pages/admin/overview.moderators.vue new file mode 100644 index 000000000..b27477e9f --- /dev/null +++ b/packages/client/src/pages/admin/overview.moderators.vue @@ -0,0 +1,52 @@ + + + + +