Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

管理画面でPremium, Verified, Cat, Botアカウントをフィルタできるように #64

Open
wants to merge 1 commit into
base: sakura-tel/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,9 @@ voteConfirm: "Are you sure that you want to vote?"
deleteAccount: "Delete Account"
deleteAccountConfirm: "Are you sure that you want to delete this account?"
createdAt: "Created at"
bot: "Bot"
cat: "Cat"
verified: "Verified"

_template:
edit: "Edit Template..."
Expand Down
3 changes: 3 additions & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,9 @@ voteConfirm: "投票しますか?"
deleteAccount: "アカウント削除"
deleteAccountConfirm: "本当にこのアカウントを削除しますか?"
createdAt: "作成日時"
bot: "ボット"
cat: "ねこ"
verified: "公式"

_template:
edit: "定型文を編集…"
Expand Down
4 changes: 4 additions & 0 deletions src/client/pages/instance/users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<option value="moderator">{{ $ts.moderator }}</option>
<option value="silenced">{{ $ts.silence }}</option>
<option value="suspended">{{ $ts.suspend }}</option>
<option value="verified">{{ $ts.verified }}</option>
<option value="premium">{{ $ts.premium }}</option>
<option value="cat">{{ $ts.cat }}</option>
<option value="bot">{{ $ts.bot }}</option>
</MkSelect>
<MkSelect v-model:value="origin" style="margin: 0; flex: 1;">
<template #label>{{ $ts.instance }}</template>
Expand Down
5 changes: 5 additions & 0 deletions src/server/api/endpoints/admin/show-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ export const meta = {
'moderator',
'adminOrModerator',
'verified',
'premium',
'silenced',
'suspended',
'cat',
'bot',
]),
default: 'all'
},
Expand Down Expand Up @@ -78,6 +81,8 @@ export default define(meta, async (ps, me) => {
case 'alive': query.where('user.updatedAt > :date', { date: new Date(Date.now() - 1000 * 60 * 60 * 24 * 5) }); break;
case 'silenced': query.where('user.isSilenced = TRUE'); break;
case 'suspended': query.where('user.isSuspended = TRUE'); break;
case 'cat': query.where('user.isCat = TRUE'); break;
case 'bot': query.where('user.isBot = TRUE'); break;
}

switch (ps.origin) {
Expand Down