|
@@ -0,0 +1,53 @@
|
|
|
+import React from 'react';
|
|
|
+import { Avatar, Typography, List, Space } from 'antd';
|
|
|
+import { UserOutlined, RightOutlined } from '@ant-design/icons';
|
|
|
+
|
|
|
+const { Text } = Typography;
|
|
|
+
|
|
|
+const settings = [
|
|
|
+ { key: 'hardware', label: '硬件管理' },
|
|
|
+ { key: 'network', label: '网络节点' },
|
|
|
+ { key: 'protocol', label: '检查协议' },
|
|
|
+ { key: 'ai', label: '人工智能' },
|
|
|
+ { key: 'image', label: '图像处理' },
|
|
|
+ { key: 'task', label: '任务管理' },
|
|
|
+ { key: 'log', label: '日志清理' },
|
|
|
+];
|
|
|
+
|
|
|
+const Profile: React.FC = () => {
|
|
|
+ // 假设用户名和头像
|
|
|
+ const username = '用户名';
|
|
|
+
|
|
|
+ const handleItemClick = (item: (typeof settings)[0]) => {
|
|
|
+ // TODO: 跳转到对应设置页面
|
|
|
+ // 可以用react-router等
|
|
|
+ // e.g. navigate(`/settings/${item.key}`)
|
|
|
+ console.log(`跳转到设置页面: ${item.label}`);
|
|
|
+ };
|
|
|
+
|
|
|
+ return (
|
|
|
+ <div style={{ maxWidth: 400, margin: '0 auto', padding: 24 }}>
|
|
|
+ <Space align="center" style={{ marginBottom: 32 }}>
|
|
|
+ <Avatar size={64} icon={<UserOutlined />} />
|
|
|
+ <Text strong style={{ fontSize: 20, marginLeft: 16 }}>
|
|
|
+ {username}
|
|
|
+ </Text>
|
|
|
+ </Space>
|
|
|
+ <List
|
|
|
+ itemLayout="horizontal"
|
|
|
+ dataSource={settings}
|
|
|
+ renderItem={(item) => (
|
|
|
+ <List.Item
|
|
|
+ onClick={() => handleItemClick(item)}
|
|
|
+ style={{ cursor: 'pointer' }}
|
|
|
+ actions={[<RightOutlined key="arrow" />]}
|
|
|
+ >
|
|
|
+ <List.Item.Meta title={item.label} />
|
|
|
+ </List.Item>
|
|
|
+ )}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default Profile;
|