mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 23:56:39 +08:00
用户管理页面优化
This commit is contained in:
parent
aa8859b186
commit
532ace669e
@ -4,8 +4,11 @@ import { User } from "@prisma/client";
|
||||
import UsersTable from "../../components/users-table";
|
||||
|
||||
async function getData() {
|
||||
const users = await prisma.user.findMany();
|
||||
return users;
|
||||
return await prisma.user.findMany({
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
});
|
||||
}
|
||||
export default async function UsersPage() {
|
||||
const users: User[] = await getData();
|
||||
|
@ -118,11 +118,13 @@ function UsersTable({ users }: UserInterface) {
|
||||
},
|
||||
onFilterDropdownOpenChange: (visible) => {
|
||||
if (visible) {
|
||||
// @ts-ignore
|
||||
setTimeout(() => searchInput.current?.select(), 100);
|
||||
}
|
||||
},
|
||||
render: (text) =>
|
||||
searchedColumn === dataIndex ? (
|
||||
// @ts-ignore
|
||||
<Highlighter
|
||||
highlightStyle={{ backgroundColor: "#ffc069", padding: 0 }}
|
||||
searchWords={[searchText]}
|
||||
|
Loading…
Reference in New Issue
Block a user