全站汉化 + antd zhCN locale
This commit is contained in:
1 parent
2e4594fa77
commit
b96323eb99
9 files changed
+134
-136
No files matched your search
@@ -7,9 +7,9 @@ import api from '../../api/client'
|
||||
const { Title } = Typography
|
||||
|
||||
const strategies = [
|
||||
{ value: 'round-robin', label: 'Round Robin' },
|
||||
{ value: 'weighted', label: 'Weighted' },
|
||||
{ value: 'least-conn', label: 'Least Connections' },
|
||||
{ value: 'round-robin', label: '轮询 (Round-Robin)' },
|
||||
{ value: 'weighted', label: '权重 (Weighted)' },
|
||||
{ value: 'least-conn', label: '最少连接 (Least Connections)' },
|
||||
]
|
||||
|
||||
export default function SettingsPage() {
|
||||
@@ -36,8 +36,8 @@ export default function SettingsPage() {
|
||||
try {
|
||||
await api.put(`/nodes/strategy?strategy=${val}&multicast_enabled=${multicastEnabled}`)
|
||||
setStrategy(val)
|
||||
message.success('Strategy updated')
|
||||
} catch { message.error('Failed') }
|
||||
message.success('策略已更新')
|
||||
} catch { message.error('更新失败') }
|
||||
setSaving(false)
|
||||
}
|
||||
|
||||
@@ -45,36 +45,36 @@ export default function SettingsPage() {
|
||||
setMulticastEnabled(val)
|
||||
try {
|
||||
await api.put(`/nodes/strategy?strategy=${strategy}&multicast_enabled=${val}`)
|
||||
message.success('Multicast setting updated')
|
||||
} catch { message.error('Failed') }
|
||||
message.success('组播设置已更新')
|
||||
} catch { message.error('更新失败') }
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: 720 }}>
|
||||
<Title level={3} style={{ marginBottom: 24 }}>Settings</Title>
|
||||
<Title level={3} style={{ marginBottom: 24 }}>系统设置</Title>
|
||||
|
||||
<Card title="Load Balancing" style={{ marginBottom: 24 }}>
|
||||
<Descriptions column={1} labelStyle={{ width: 180 }}>
|
||||
<Descriptions.Item label="Strategy">
|
||||
<Card title="负载均衡" style={{ marginBottom: 24 }}>
|
||||
<Descriptions column={1} labelStyle={{ width: 140 }}>
|
||||
<Descriptions.Item label="均衡策略">
|
||||
<Select
|
||||
value={strategy}
|
||||
onChange={saveStrategy}
|
||||
options={strategies}
|
||||
loading={saving}
|
||||
style={{ width: 240 }}
|
||||
style={{ width: 280 }}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
|
||||
<Card title="Multicast">
|
||||
<Descriptions column={1} labelStyle={{ width: 180 }}>
|
||||
<Descriptions.Item label="Enable Multicast">
|
||||
<Card title="组播设置">
|
||||
<Descriptions column={1} labelStyle={{ width: 140 }}>
|
||||
<Descriptions.Item label="启用组播">
|
||||
<Switch checked={multicastEnabled} onChange={toggleMulticast} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="Network Status">
|
||||
<Descriptions.Item label="网络状态">
|
||||
<span style={{ color: multicastAvailable ? '#52c41a' : '#999' }}>
|
||||
{multicastAvailable ? 'Available' : 'Unavailable (fallback to unicast)'}
|
||||
{multicastAvailable ? '可用 — 优先使用组播分发' : '不可用 — 回退至单播'}
|
||||
</span>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
|
||||
Reference in new issue
Block a user