mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-20 18:54:09 +00:00
fix: admin chart
This commit is contained in:
@@ -77,13 +77,16 @@ export const Dashboard: React.FC = React.memo(() => {
|
|||||||
}).then((res) => res.json())
|
}).then((res) => res.json())
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const data = userResponse.map((item, i) => ({
|
const data = userResponse.map((item, i) => {
|
||||||
|
const pay = payResponse.find((pay) => item.date === pay.date);
|
||||||
|
return {
|
||||||
date: dayjs(item.date).format('MM/DD'),
|
date: dayjs(item.date).format('MM/DD'),
|
||||||
userCount: item.count,
|
userCount: item.count,
|
||||||
userIncrease: item.increase,
|
userIncrease: item.increase,
|
||||||
userIncreaseRate: item.increaseRate,
|
userIncreaseRate: item.increaseRate,
|
||||||
payCount: payResponse[i].count / PRICE_SCALE
|
payCount: pay ? pay.count / PRICE_SCALE : 0
|
||||||
}));
|
};
|
||||||
|
});
|
||||||
setChatData(data);
|
setChatData(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -198,6 +201,9 @@ const CustomTooltip = ({ active, payload }: any) => {
|
|||||||
boxShadow: '2px 2px 5px rgba(0,0,0,0.2)'
|
boxShadow: '2px 2px 5px rgba(0,0,0,0.2)'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<p className="label">
|
||||||
|
日期: <strong>{data.date}</strong>
|
||||||
|
</p>
|
||||||
<p className="label">
|
<p className="label">
|
||||||
用户总数: <strong>{data.userCount}</strong>
|
用户总数: <strong>{data.userCount}</strong>
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user