import React, { useState } from 'react'; import { Form, Input, Select, Switch, Button, Row, Col, Card as AntdCard, Tag, Table, message, Typography, Space, Modal, } from 'antd'; import { CloudOutlined, TeamOutlined, BellOutlined, DatabaseOutlined, CalendarOutlined, CheckCircleOutlined, SyncOutlined, DownloadOutlined, FileTextOutlined, DeleteOutlined, RestOutlined, } from '@ant-design/icons'; const { Text } = Typography; const BasicSettings = () => { const [form] = Form.useForm(); const handleSave = () => { message.success('设置已保存'); }; // 设备接入状态数据 const deviceStatusData = [ { name: '逆变器', count: '5/5', status: '正常', color: '#52c41a' }, { name: '汇流箱', count: '20/20', status: '正常', color: '#52c41a' }, { name: '摄像头', count: '12/12', status: '正常', color: '#52c41a' }, { name: '无人机', count: '2/2', status: '正常', color: '#52c41a' }, { name: 'API接口', count: '正常', status: '正常', color: '#52c41a' }, { name: 'Modbus', count: '正常', status: '正常', color: '#52c41a' }, ]; // 服务配置数据 const serviceConfigData = [ { name: 'MQTT配置', value: 'tcp://localhost:1883', status: '离线', statusColor: '#8c8c8c' }, { name: '视频服务配置', value: '待接入 RTSP / WebRTC 服务', status: '待处理', statusColor: '#fa8c16' }, { name: 'AI服务配置', value: 'http://ai-service.local', status: '待处理', statusColor: '#fa8c16' }, { name: 'API密钥管理', value: '正常', status: '正常', statusColor: '#52c41a' }, ]; // 视频服务配置数据 const videoServiceData = [ { name: '视频服务数', value: '1' }, { name: '启用服务数', value: '1' }, { name: '摄像头总数', value: '3' }, { name: '离线摄像头', value: '3' }, { name: '在线流数量', value: '0' }, { name: '服务状态', value: 'ONLINE', statusColor: '#52c41a' }, { name: 'API地址', value: 'http://127.0.0.1:9997' }, { name: 'HLS地址', value: 'http://127.0.0.1:8888' }, { name: 'WebRTC地址', value: 'http://127.0.0.1:8889' }, { name: '检测结果', value: 'HTTP 401 - http://127.0.0.1...' }, ]; // MQTT接入状态数据 const mqttStatusData = [ { name: '启用状态', value: '已启用', statusColor: '#52c41a' }, { name: '连接状态', value: '已连接', statusColor: '#52c41a' }, { name: 'Broker', value: 'tcp://localhost:1883' }, { name: '客户端ID', value: 'solar-platform-backend' }, { name: '遥测主题', value: 'pv/+/device/+/telemetry' }, { name: '状态主题', value: 'pv/+/device/+/status' }, { name: '最近连接', value: '2026-05-07 18:30:40' }, { name: '最近错误', value: '-' }, ]; // MQTT消息日志数据 const mqttLogData = [ { topic: 'pv/1/device/ROBOT-01/ack', device: 'ROBOT-01', type: 'ACK', parse: 'SUCCESS' }, { topic: 'pv/1/device/ROBOT-01/ack', device: 'ROBOT-01', type: 'ACK', parse: 'SUCCESS' }, { topic: 'pv/1/device/CAM-02/status', device: 'CAM-02', type: 'STATUS', parse: 'SUCCESS' }, { topic: 'pv/1/device/INV-A02/telemetry', device: 'INV-A02', type: 'TELEMETRY', parse: 'SUCCESS' }, ]; // WebSocket状态数据 const wsStatusData = [ { name: '服务状态', value: '已启用', statusColor: '#52c41a' }, { name: '前端连接', value: '已连接', statusColor: '#52c41a' }, { name: 'Endpoint', value: '/ws/pv' }, { name: '在线连接数', value: '2' }, { name: '最近推送', value: '-' }, { name: '推送时间', value: '-' }, { name: '前端端点', value: 'ws://47.100.102.7:10469/de...' }, { name: '最近错误', value: '-' }, ]; return (