mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-05 08:13:22 +08:00
@@ -8,7 +8,7 @@ const ADMIN_BREADCRUMB_MAP: Record<string, { title: string; to: string }> = {
|
||||
chat: { title: '对话记录', to: '/chat' },
|
||||
completion: { title: '补全记录', to: '/completion' },
|
||||
model: { title: '模型管理', to: '/model' },
|
||||
'user-management': { title: '成员管理', to: '/user-management' },
|
||||
'member-management': { title: '成员管理', to: '/member-management' },
|
||||
admin: { title: '管理员', to: '/admin' },
|
||||
};
|
||||
|
||||
|
||||
@@ -51,8 +51,8 @@ const ADMIN_MENUS = [
|
||||
},
|
||||
{
|
||||
label: '成员管理',
|
||||
value: '/user-management',
|
||||
pathname: 'user-management',
|
||||
value: '/member-management',
|
||||
pathname: 'member-management',
|
||||
icon: 'icon-yonghuguanli1',
|
||||
show: true,
|
||||
disabled: false,
|
||||
|
||||
@@ -205,6 +205,7 @@ const GlobalStatistic = ({ timeRange }: { timeRange: TimeRange }) => {
|
||||
<LineCharts
|
||||
title='补全任务采纳率'
|
||||
data={acceptedPerChartData}
|
||||
formatValueTooltip={(value) => `${value.toFixed(2)}%`}
|
||||
extra={
|
||||
<>
|
||||
{timeRange === '90d' ? '最近 90 天' : '最近 24 小时'}平均采纳率为
|
||||
|
||||
@@ -9,9 +9,15 @@ interface ILineChartsProps {
|
||||
xData: (string | number)[];
|
||||
yData: number[];
|
||||
};
|
||||
formatValueTooltip?: (value: number) => string;
|
||||
}
|
||||
|
||||
const LineCharts: React.FC<ILineChartsProps> = ({ title, data, extra }) => {
|
||||
const LineCharts: React.FC<ILineChartsProps> = ({
|
||||
title,
|
||||
data,
|
||||
extra,
|
||||
formatValueTooltip,
|
||||
}) => {
|
||||
const { xData, yData } = data;
|
||||
const domRef = useRef(null);
|
||||
const echartsRef = useRef<echarts.ECharts>(null);
|
||||
@@ -75,7 +81,9 @@ const LineCharts: React.FC<ILineChartsProps> = ({ title, data, extra }) => {
|
||||
) => {
|
||||
if (params[0]) {
|
||||
const { name, seriesName, value } = params[0];
|
||||
return `<div style="font-family: G;">${name}<div>${seriesName} ${value}</div></div>`;
|
||||
return `<div style="font-family: G;">${name}<div>${seriesName} ${
|
||||
formatValueTooltip ? formatValueTooltip(value) : value
|
||||
}</div></div>`;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
||||
@@ -202,6 +202,7 @@ const MemberStatistic = ({
|
||||
<LineCharts
|
||||
title='补全任务采纳率'
|
||||
data={acceptedPerChartData}
|
||||
formatValueTooltip={(value) => `${value.toFixed(2)}%`}
|
||||
extra={
|
||||
<>
|
||||
{timeRange === '90d' ? '最近 90 天' : '最近 24 小时'}平均采纳率为
|
||||
|
||||
@@ -305,7 +305,7 @@ const MemberManage = () => {
|
||||
<Card sx={{ flex: 1, height: '100%' }}>
|
||||
<Menu anchorEl={anchorEl} open={!!anchorEl} onClose={handleClose}>
|
||||
{currentUser?.status === ConstsUserStatus.UserStatusActive && (
|
||||
<MenuItem onClick={onLockUser}>解锁成员</MenuItem>
|
||||
<MenuItem onClick={onLockUser}>锁定成员</MenuItem>
|
||||
)}
|
||||
{currentUser?.status === ConstsUserStatus.UserStatusLocked && (
|
||||
<MenuItem onClick={onUnLockUser}>解锁成员</MenuItem>
|
||||
@@ -178,6 +178,7 @@ const MemberStatistic = ({
|
||||
<LineCharts
|
||||
title='补全任务采纳率'
|
||||
data={acceptedPerChartData}
|
||||
formatValueTooltip={(value) => `${value.toFixed(2)}%`}
|
||||
extra={
|
||||
<>
|
||||
{timeRange === '90d' ? '最近 90 天' : '最近 24 小时'}平均采纳率为
|
||||
|
||||
@@ -32,7 +32,7 @@ const Dashboard = LazyLoadable(lazy(() => import('@/pages/dashboard')));
|
||||
const Chat = LazyLoadable(lazy(() => import('@/pages/chat')));
|
||||
const Completion = LazyLoadable(lazy(() => import('@/pages/completion')));
|
||||
const Model = LazyLoadable(lazy(() => import('@/pages/model')));
|
||||
const User = LazyLoadable(lazy(() => import('@/pages/user-management')));
|
||||
const MemberManage = LazyLoadable(lazy(() => import('@/pages/memberManage')));
|
||||
const Admin = LazyLoadable(lazy(() => import('@/pages/admin')));
|
||||
const Invite = LazyLoadable(lazy(() => import('@/pages/invite')));
|
||||
const Auth = LazyLoadable(lazy(() => import('@/pages/auth')));
|
||||
@@ -79,8 +79,8 @@ const routerConfig = [
|
||||
element: <Model />,
|
||||
},
|
||||
{
|
||||
path: 'user-management',
|
||||
element: <User />,
|
||||
path: 'member-management',
|
||||
element: <MemberManage />,
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
|
||||
Reference in New Issue
Block a user