feat: 完善全栈 Dashboard 项目 - UI优化、Docker支持、账单系统等
This commit is contained in:
@@ -19,24 +19,33 @@ interface Props {
|
||||
}
|
||||
|
||||
const logTypeMap: Record<number, { color: string; label: string }> = {
|
||||
1: { color: 'green', label: '充值' },
|
||||
2: { color: 'blue', label: '消费' },
|
||||
3: { color: 'orange', label: '管理' },
|
||||
4: { color: 'purple', label: '系统' },
|
||||
5: { color: 'red', label: '错误' },
|
||||
6: { color: 'cyan', label: '退款' },
|
||||
1: { color: '#7DB87D', label: '充值' },
|
||||
2: { color: '#C8956C', label: '消费' },
|
||||
3: { color: '#E8A850', label: '管理' },
|
||||
4: { color: '#9B8EC2', label: '系统' },
|
||||
5: { color: '#D4645C', label: '错误' },
|
||||
6: { color: '#7BA4C8', label: '退款' },
|
||||
}
|
||||
|
||||
export default function RecentLogs({ logs, loading }: Props) {
|
||||
if (!loading && logs.length === 0) {
|
||||
return <Card title={<><HistoryOutlined /> 最近操作日志</>}><Empty description="暂无日志" /></Card>
|
||||
return (
|
||||
<Card title={<><HistoryOutlined style={{ color: '#C8956C' }} /> 最近操作日志</>} className="stat-accent">
|
||||
<Empty description="暂无日志" />
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Card title={<><HistoryOutlined /> 最近操作日志</>} loading={loading} hoverable>
|
||||
<Card
|
||||
title={<><HistoryOutlined style={{ color: '#C8956C' }} /> 最近操作日志</>}
|
||||
loading={loading}
|
||||
hoverable
|
||||
className="stat-accent"
|
||||
>
|
||||
<Timeline
|
||||
items={logs.slice(0, 10).map((log) => {
|
||||
const typeInfo = logTypeMap[log.type] || { color: 'default', label: '未知' }
|
||||
const typeInfo = logTypeMap[log.type] || { color: '#A69278', label: '未知' }
|
||||
return {
|
||||
color: typeInfo.color,
|
||||
children: (
|
||||
|
||||
Reference in New Issue
Block a user