优化 ui

This commit is contained in:
yml2213
2026-06-22 14:21:39 +08:00
parent b08f0a647d
commit 627f06d0a0
14 changed files with 322 additions and 61 deletions
+18 -16
View File
@@ -112,8 +112,8 @@ export default function ProxyPage() {
};
return (
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 16 }}>
<div style={{ display: 'flex', flexDirection: 'column', height: '100%', gap: 8 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexShrink: 0 }}>
<h2 style={{ margin: 0 }}></h2>
<Button type="primary" onClick={handleSave} loading={loading}></Button>
</div>
@@ -122,6 +122,7 @@ export default function ProxyPage() {
form={form}
layout="vertical"
disabled={!configLoaded}
size="small"
initialValues={{
enabled: false,
whitelist_enabled: false,
@@ -131,37 +132,38 @@ export default function ProxyPage() {
whitelist_uid: '',
whitelist_ukey: '',
}}
style={{ flexShrink: 0 }}
>
<Row gutter={16}>
<Row gutter={12}>
<Col span={12}>
<Card title="代理设置" size="small" style={{ marginBottom: 16 }}>
<Form.Item name="enabled" label="启用代理" valuePropName="checked">
<Card title="代理设置" size="small" styles={{ body: { paddingBottom: 8 } }}>
<Form.Item name="enabled" label="启用代理" valuePropName="checked" style={{ marginBottom: 8 }}>
<Switch />
</Form.Item>
<Form.Item name="api_url" label="代理API地址">
<Form.Item name="api_url" label="代理API地址" style={{ marginBottom: 8 }}>
<Input placeholder="http://op.xiequ.cn/...?act=get" />
</Form.Item>
<Form.Item name="http" label="静态HTTP代理">
<Form.Item name="http" label="静态HTTP代理" style={{ marginBottom: 8 }}>
<Input placeholder="http://ip:port" />
</Form.Item>
<Form.Item name="https" label="静态HTTPS代理">
<Form.Item name="https" label="静态HTTPS代理" style={{ marginBottom: 8 }}>
<Input placeholder="http://ip:port" />
</Form.Item>
<Button onClick={handleTestProxy} loading={testing}></Button>
<Button size="small" onClick={handleTestProxy} loading={testing}></Button>
</Card>
</Col>
<Col span={12}>
<Card title="白名单管理" size="small" style={{ marginBottom: 16 }}>
<Form.Item name="whitelist_enabled" label="启用白名单自动管理" valuePropName="checked">
<Card title="白名单管理" size="small" styles={{ body: { paddingBottom: 8 } }}>
<Form.Item name="whitelist_enabled" label="启用白名单自动管理" valuePropName="checked" style={{ marginBottom: 8 }}>
<Switch />
</Form.Item>
<Form.Item name="whitelist_uid" label="协固UID">
<Form.Item name="whitelist_uid" label="协固UID" style={{ marginBottom: 8 }}>
<Input placeholder="如: 99769" />
</Form.Item>
<Form.Item name="whitelist_ukey" label="协固UKEY">
<Form.Item name="whitelist_ukey" label="协固UKEY" style={{ marginBottom: 8 }}>
<Input placeholder="如: C99371082B965B70F46DCAA87A04618B" />
</Form.Item>
<Button onClick={handleTestWhitelist} loading={testingWl}></Button>
<Button size="small" onClick={handleTestWhitelist} loading={testingWl}></Button>
</Card>
</Col>
</Row>
@@ -170,8 +172,8 @@ export default function ProxyPage() {
<Card
title="实时日志"
size="small"
style={{ flex: 1, minHeight: 200, overflow: 'auto' }}
styles={{ body: { maxHeight: 350, overflow: 'auto', fontFamily: 'monospace', fontSize: 12, padding: '8px 16px' } }}
style={{ flex: 1, overflow: 'hidden' }}
styles={{ body: { height: '100%', overflow: 'auto', fontFamily: 'monospace', fontSize: 12, padding: '8px 16px' } }}
>
{logs.length === 0 ? (
<span style={{ color: '#999' }}>"测试代理""测试白名单"</span>