This commit is contained in:
go0p
2026-08-06 15:11:35 +08:00
committed by go0p
parent 841f663ed5
commit 1b896bc45d
11 changed files with 126 additions and 130 deletions
-7
View File
@@ -1,7 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(<App/>);
+17
View File
@@ -0,0 +1,17 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import App from './App';
// 获取根元素
const container = document.getElementById('root');
if (!container) throw new Error('Failed to find the root element');
// 创建根
const root = createRoot(container);
// 渲染应用
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);
@@ -1,5 +1,5 @@
import React from 'react';
import { Card, Input, Space, Button, Select, InputNumber, Form, Table } from 'antd';
import React, { useRef } from 'react';
import { Card, Input, Space, Button, Select, InputNumber, Form, Table, Tooltip, Popover } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
import { ProxyConfig } from '@/types/proxy';
@@ -143,16 +143,16 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
}
];
const buttonRef = useRef(null);
return (
<div>
<Space style={{ marginBottom: 16, justifyContent: 'flex-end', width: '100%' }}>
<Button
type="primary"
icon={<PlusOutlined />}
onClick={onAdd}
>
</Button>
<Popover content="添加代理" trigger="hover">
<Button ref={buttonRef} onClick={onAdd}>
</Button>
</Popover>
</Space>
<Table
dataSource={proxyConfigs}
+3 -2
View File
@@ -2,11 +2,12 @@ import React from 'react';
import { createRoot } from 'react-dom/client';
import { App } from 'antd';
import { OptionsPage } from './OptionsPage';
import zhCN from 'antd/locale/zh_CN';
import '@/styles/global.css';
const container = document.getElementById('root');
const root = createRoot(container!);
if (!container) throw new Error('Failed to find the root element');
const root = createRoot(container);
root.render(
<App>