import React, { useState } from 'react'; import { Table, Input, Button, Tag, Progress, Space, Typography, Row, Col, Statistic, Descriptions, Tabs, Card } from 'antd'; import { SearchOutlined, PlusOutlined, SettingOutlined, PoweroffOutlined, ClusterOutlined, ArrowRightOutlined, CloseOutlined, DashboardOutlined, HeatMapOutlined, InfoCircleOutlined, LineChartOutlined, ThunderboltOutlined } from '@ant-design/icons'; import { DEVICES } from '../constants'; import { motion, AnimatePresence } from 'motion/react'; const { Text, Title } = Typography; export default function Devices() { const [selectedDeviceId, setSelectedDeviceId] = useState(null); const selectedDevice = DEVICES.find(d => d.id === selectedDeviceId); const columns = [ { title: '节点身份', dataIndex: 'name', key: 'name', render: (text: string, record: any) => ( {text} {record.id} | {record.type} ), }, { title: '负载/状态', key: 'status', render: (record: any) => ( {record.status.toUpperCase()} {record.cpu}% ), }, { title: '能量效率', dataIndex: 'battery', key: 'battery', render: (percent: number) => ( {percent}% ), }, { title: '类型', dataIndex: 'battery', key: 'battery', render: (percent: number) => ( {percent}% ), }, { title: '管理', key: 'action', align: 'right' as const, render: () => ( ({ ...d, key: d.id }))} pagination={false} sticky scroll={{ y: 'calc(100vh - 250px)' }} onRow={(record) => ({ onClick: () => setSelectedDeviceId(record.id), className: selectedDeviceId === record.id ? 'bg-blue-50' : '', style: { cursor: 'pointer' } })} /> {selectedDevice && (
Asset Intelligence / v4.0 {selectedDevice.name} {selectedDevice.type} ID: {selectedDevice.id}
{selectedDevice.name} {selectedDevice.id} {selectedDevice.type} {selectedDevice.lastUpdate} FW_2.5.4_REL MQTT_SSL
该设备目前运行正常,已通过节点身份验证,正在进行全量数据透传。
) }, { key: '2', label: '运行状态', children: (
负载率} value={selectedDevice.cpu} suffix="%" valueStyle={{ fontSize: 16, fontFamily: 'monospace' }} /> 核心温度} value={selectedDevice.temp} suffix="°C" valueStyle={{ fontSize: 16, fontFamily: 'monospace', color: '#f5222d' }} /> 剩余能量} value={selectedDevice.battery} suffix="%" valueStyle={{ fontSize: 16, fontFamily: 'monospace', color: '#52c41a' }} /> 系统健康} value={98.2} suffix="%" valueStyle={{ fontSize: 16, fontFamily: 'monospace' }} />
实时动态 (SIGNAL)
上行链路速率 1.2 Mbps
下行链路速率 0.4 Mbps
当前信号强度 EXCELLENT
) } ]} />
)} ); }