mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import {
|
|
Datagrid,
|
|
DateField,
|
|
List,
|
|
TextField,
|
|
ShowButton,
|
|
SearchInput,
|
|
ArrayField,
|
|
SingleFieldList,
|
|
ChipField,
|
|
} from 'react-admin';
|
|
import React from 'react';
|
|
import { Box } from '@mui/material';
|
|
|
|
const PostListActionToolbar = ({ children, ...props }) => (
|
|
<Box sx={{ alignItems: 'center', display: 'flex' }}>{children}</Box>
|
|
);
|
|
|
|
export const GroupList: React.FC = () => (
|
|
<List filters={[<SearchInput key="search" source="q" alwaysOn />]}>
|
|
<Datagrid>
|
|
<TextField
|
|
source="id"
|
|
label="群组ID"
|
|
sortable={true}
|
|
sortByOrder="DESC"
|
|
/>
|
|
<TextField source="name" label="群组名称" />
|
|
<TextField source="owner" label="管理员" />
|
|
<TextField source="members.length" label="成员数量" />
|
|
<TextField source="panels.length" label="面板数量" />
|
|
<ArrayField source="roles" label="角色">
|
|
<SingleFieldList>
|
|
<ChipField source="name" />
|
|
</SingleFieldList>
|
|
</ArrayField>
|
|
<TextField source="fallbackPermissions" label="默认权限" />
|
|
<DateField source="createdAt" label="创建时间" />
|
|
<PostListActionToolbar>
|
|
<ShowButton />
|
|
</PostListActionToolbar>
|
|
</Datagrid>
|
|
</List>
|
|
);
|
|
GroupList.displayName = 'GroupList';
|