2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2022-12-23 06:21:55 +00:00
|
|
|
<template>
|
|
|
|
<div :class="$style.root">
|
2023-04-01 04:42:40 +00:00
|
|
|
<Transition :name="defaultStore.state.animation ? '_transition_zoom' : ''" mode="out-in">
|
2022-12-26 05:34:46 +00:00
|
|
|
<MkLoading v-if="fetching"/>
|
|
|
|
<div v-else class="users">
|
2023-08-13 12:02:25 +00:00
|
|
|
<MkA v-for="(user, i) in newUsers" :key="user.id" :to="`/admin/user/${user.id}`" class="user">
|
2022-12-26 05:34:46 +00:00
|
|
|
<MkUserCardMini :user="user"/>
|
|
|
|
</MkA>
|
|
|
|
</div>
|
2022-12-30 04:37:14 +00:00
|
|
|
</Transition>
|
2022-12-23 06:21:55 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { useInterval } from '@/scripts/use-interval.js';
|
2022-12-23 06:21:55 +00:00
|
|
|
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import { defaultStore } from '@/store.js';
|
2022-12-23 06:21:55 +00:00
|
|
|
|
|
|
|
let newUsers = $ref(null);
|
|
|
|
let fetching = $ref(true);
|
|
|
|
|
|
|
|
const fetch = async () => {
|
|
|
|
const _newUsers = await os.api('admin/show-users', {
|
|
|
|
limit: 5,
|
|
|
|
sort: '+createdAt',
|
|
|
|
origin: 'local',
|
|
|
|
});
|
|
|
|
newUsers = _newUsers;
|
|
|
|
fetching = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
useInterval(fetch, 1000 * 60, {
|
|
|
|
immediate: true,
|
|
|
|
afterMounted: true,
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.root {
|
|
|
|
&:global {
|
|
|
|
> .users {
|
|
|
|
.chart-move {
|
|
|
|
transition: transform 1s ease;
|
|
|
|
}
|
|
|
|
|
|
|
|
display: grid;
|
2022-12-23 23:46:30 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
2022-12-23 06:21:55 +00:00
|
|
|
grid-gap: 12px;
|
|
|
|
|
|
|
|
> .user:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|