import Link from 'next/link'
export type DashboardPageProps = {}
export default function DashboardPage(props: DashboardPageProps) {
return (
{/* 欢迎区域 - 全宽 */}
IP代理管理控制台
上次更新: {new Date().toLocaleString('zh-CN')}
{/* 主体内容 - 双栏布局 */}
{/* 左侧栏 - 占比较大 */}
{/* 代理资源统计卡片组 */}
{/* 代理使用图表 */}
{/* IP代理列表 */}
| IP地址 |
位置 |
状态 |
请求次数 |
成功率 |
操作 |
{[1, 2, 3, 4, 5].map((item) => (
))}
{/* 右侧栏 - 占比较小 */}
{/* 代理资源分布 */}
资源分布
IP地区分布饼图
中国
42%
美国
28%
欧洲
16%
其他
14%
{/* 系统告警 */}
{/* 系统状态 */}
)
}
// 数据卡片组件 - 显示关键指标
function DataCard({
title,
value,
change,
isIncrease,
icon,
}: {
title: string;
value: string;
change: string;
isIncrease: boolean;
icon: React.ReactNode;
}) {
return (
{title}
{value}
{change}
相比上周期
{icon}
)
}
// 代理IP内容行组件
function ContentRow({
ip,
location,
status,
requests,
successRate,
}: {
ip: string;
location: string;
status: 'active' | 'warning' | 'error';
requests: number;
successRate: string;
}) {
const statusConfig = {
active: {color: 'bg-green-100 text-green-800 border-green-200', label: '在线'},
warning: {color: 'bg-yellow-100 text-yellow-800 border-yellow-200', label: '不稳定'},
error: {color: 'bg-red-100 text-red-800 border-red-200', label: '离线'},
}
return (
|
{ip}
|
{location}
|
{statusConfig[status].label}
|
{requests.toLocaleString()}
|
{successRate}
|
|
)
}
// 告警通知组件
function AlertItem({
title,
severity,
time,
message,
}: {
title: string;
severity: 'high' | 'medium' | 'low';
time: string;
message: string;
}) {
const severityConfig = {
high: {color: 'bg-red-50 border-red-200', dot: 'bg-red-500'},
medium: {color: 'bg-yellow-50 border-yellow-200', dot: 'bg-yellow-500'},
low: {color: 'bg-blue-50 border-blue-200', dot: 'bg-blue-500'},
}
return (
)
}
// 系统状态条组件
function StatusBar({
title,
value,
status,
}: {
title: string;
value: number;
status: 'normal' | 'warning' | 'error';
}) {
const statusConfig = {
normal: {color: 'bg-green-500', bgColor: 'bg-green-100'},
warning: {color: 'bg-yellow-500', bgColor: 'bg-yellow-100'},
error: {color: 'bg-red-500', bgColor: 'bg-red-100'},
}
return (
)
}