mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-30 22:26:38 +08:00
bf71bc540b
- 将设备类型与状态码饼图的断点由 xl 降为 lg,在大屏/笔记本视口下保持双列展示 - 修复 valueCountDistribution 在 ClickHouse 查询出错时静默吞掉错误的缺陷,引入 logger.ErrorF 捕获 - 补充 unreleased 变更日志
49 lines
973 B
TypeScript
49 lines
973 B
TypeScript
import {
|
|
Card,
|
|
CardContent,
|
|
CardDescription,
|
|
CardHeader,
|
|
CardTitle,
|
|
} from '@/components/ui/card';
|
|
|
|
import { RankChart } from './rank-chart';
|
|
|
|
type RankCardItem = {
|
|
label: string;
|
|
value: number;
|
|
};
|
|
|
|
type RankCardProps = {
|
|
title: string;
|
|
description: string;
|
|
items: RankCardItem[];
|
|
color?: string;
|
|
};
|
|
|
|
export function RankCard({
|
|
title,
|
|
description,
|
|
items,
|
|
color = '#3b82f6',
|
|
}: RankCardProps) {
|
|
return (
|
|
<Card className='border-dashed shadow-none'>
|
|
<CardHeader className='pb-3'>
|
|
<CardTitle className='text-sm font-semibold text-foreground'>
|
|
{title}
|
|
</CardTitle>
|
|
<CardDescription className='text-xs text-muted-foreground'>
|
|
{description}
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent className='pt-0'>
|
|
<RankChart
|
|
items={items}
|
|
color={color}
|
|
emptyMessage={`暂无 ${title} 数据`}
|
|
/>
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
}
|