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";
|
import UsersTable from "../../components/users-table";
|
||||||
|
|
||||||
async function getData() {
|
async function getData() {
|
||||||
const users = await prisma.user.findMany();
|
return await prisma.user.findMany({
|
||||||
return users;
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
export default async function UsersPage() {
|
export default async function UsersPage() {
|
||||||
const users: User[] = await getData();
|
const users: User[] = await getData();
|
||||||
|
@ -118,11 +118,13 @@ function UsersTable({ users }: UserInterface) {
|
|||||||
},
|
},
|
||||||
onFilterDropdownOpenChange: (visible) => {
|
onFilterDropdownOpenChange: (visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
// @ts-ignore
|
||||||
setTimeout(() => searchInput.current?.select(), 100);
|
setTimeout(() => searchInput.current?.select(), 100);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
render: (text) =>
|
render: (text) =>
|
||||||
searchedColumn === dataIndex ? (
|
searchedColumn === dataIndex ? (
|
||||||
|
// @ts-ignore
|
||||||
<Highlighter
|
<Highlighter
|
||||||
highlightStyle={{ backgroundColor: "#ffc069", padding: 0 }}
|
highlightStyle={{ backgroundColor: "#ffc069", padding: 0 }}
|
||||||
searchWords={[searchText]}
|
searchWords={[searchText]}
|
||||||
|
Loading…
Reference in New Issue
Block a user