mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 11:25:13 +00:00
ダッシュボードにモデレーター一覧を表示
This commit is contained in:
parent
c801434d11
commit
dd4c411d22
2 changed files with 55 additions and 1 deletions
|
@ -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<typeof meta, typeof paramDef> {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
52
packages/client/src/pages/admin/overview.moderators.vue
Normal file
52
packages/client/src/pages/admin/overview.moderators.vue
Normal file
|
@ -0,0 +1,52 @@
|
|||
<template>
|
||||
<div>
|
||||
<MkLoading v-if="fetching"/>
|
||||
<div v-else :class="$style.root">
|
||||
<MkA v-for="user in moderators" :key="user.id" v-user-preview="user.id" class="user" :to="`/user-info/${user.id}`">
|
||||
<MkAvatar :user="user" class="avatar" :show-indicator="true" :disable-link="true"/>
|
||||
</MkA>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import * as os from '@/os';
|
||||
import number from '@/filters/number';
|
||||
import { i18n } from '@/i18n';
|
||||
|
||||
let moderators: any = $ref(null);
|
||||
let fetching = $ref(true);
|
||||
|
||||
onMounted(async () => {
|
||||
moderators = await os.api('admin/show-users', {
|
||||
sort: '+lastActiveDate',
|
||||
state: 'adminOrModerator',
|
||||
limit: 30,
|
||||
});
|
||||
|
||||
fetching = false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
.root {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(30px, 40px));
|
||||
grid-gap: 12px;
|
||||
place-content: center;
|
||||
|
||||
&:global {
|
||||
> .user {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
aspect-ratio: 1;
|
||||
|
||||
> .avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in a new issue