1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-28 23:08:17 +09:00

Adminページのユーザー一覧フィルターに利用可能アカウントを追加 (#5430)

* Adminページのユーザー一覧フィルターにアクティブアカウントを追加

* validator update

* availableに
This commit is contained in:
Satsuki Yanagi 2019-09-21 21:35:22 +09:00 committed by syuilo
parent 1b7454ca77
commit 61642539b1
3 changed files with 4 additions and 0 deletions

View File

@ -1547,6 +1547,7 @@ admin/views/users.vue:
state:
title: "状態"
all: "すべて"
available: "利用可能"
admin: "管理者"
moderator: "モデレーター"
adminOrModerator: "管理者+モデレーター"

View File

@ -42,6 +42,7 @@
<ui-select v-model="state">
<template #label>{{ $t('users.state.title') }}</template>
<option value="all">{{ $t('users.state.all') }}</option>
<option value="available">{{ $t('users.state.available') }}</option>
<option value="admin">{{ $t('users.state.admin') }}</option>
<option value="moderator">{{ $t('users.state.moderator') }}</option>
<option value="silenced">{{ $t('users.state.silenced') }}</option>

View File

@ -33,6 +33,7 @@ export const meta = {
state: {
validator: $.optional.str.or([
'all',
'available',
'admin',
'moderator',
'adminOrModerator',
@ -67,6 +68,7 @@ export default define(meta, async (ps, me) => {
const query = Users.createQueryBuilder('user');
switch (ps.state) {
case 'available': query.where('user.isSuspended = FALSE'); break;
case 'admin': query.where('user.isAdmin = TRUE'); break;
case 'moderator': query.where('user.isModerator = TRUE'); break;
case 'adminOrModerator': query.where('user.isAdmin = TRUE OR isModerator = TRUE'); break;