This commit is contained in:
1 parent
21a61068fb
commit
60278b9e71
38 files changed
+3452
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import { fetchAdminList } from '@/lib/admin-list'
|
||||
import { PERMS } from '@/lib/permissions'
|
||||
import { OnlineTable } from './online-table'
|
||||
|
||||
export default async function OnlineUsersPage({
|
||||
params: paramsPromise,
|
||||
searchParams,
|
||||
}: {
|
||||
params: Promise<{ locale: string }>
|
||||
searchParams: Promise<Record<string, string>>
|
||||
}) {
|
||||
const result = await fetchAdminList(
|
||||
{
|
||||
permission: PERMS.USERS_VIEW,
|
||||
model: 'user',
|
||||
searchFields: ['username', 'motto'],
|
||||
baseWhere: { online: '1' },
|
||||
defaultPerPage: 50,
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
motto: true,
|
||||
look: true,
|
||||
},
|
||||
},
|
||||
paramsPromise,
|
||||
searchParams,
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<h1 className="text-3xl font-bold tracking-tight">Online Users</h1>
|
||||
<p className="text-muted-foreground">Currently online users ({result.total} connected)</p>
|
||||
</div>
|
||||
|
||||
<OnlineTable
|
||||
data={{
|
||||
rows: result.rows,
|
||||
total: result.total,
|
||||
page: result.page,
|
||||
perPage: result.perPage,
|
||||
lastPage: result.lastPage,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user