Skip to content

Commit

Permalink
🐛 fix(node): Reality config
Browse files Browse the repository at this point in the history
  • Loading branch information
web-ppanel committed Dec 12, 2024
1 parent 2bcb925 commit fadd17f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 34 deletions.
2 changes: 2 additions & 0 deletions apps/admin/app/dashboard/server/form-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const securityConfigSchema = z
reality_private_key: nullableString,
reality_public_key: nullableString,
reality_short_id: nullableString,
reality_server_addr: nullableString,
reality_server_port: portSchema,
})
.nullish();

Expand Down
37 changes: 5 additions & 32 deletions apps/admin/app/dashboard/server/node-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
<>
<FormField
control={form.control}
name='config.security_config.server_address'
name='config.security_config.reality_server_addr'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.security_config.serverAddress')}</FormLabel>
Expand All @@ -658,7 +658,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
/>
<FormField
control={form.control}
name='config.security_config.server_port'
name='config.security_config.reality_server_port'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.security_config.serverPort')}</FormLabel>
Expand All @@ -678,34 +678,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
/>
<FormField
control={form.control}
name='config.security_config.proxy_protocol'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.security_config.proxyProtocol')}</FormLabel>
<Select
value={field.value}
onValueChange={(value) => {
form.setValue(field.name, value);
}}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder={t('form.security')} />
</SelectTrigger>
</FormControl>
<SelectContent>
<SelectItem value='0'>0</SelectItem>
<SelectItem value='1'>1</SelectItem>
<SelectItem value='2'>2</SelectItem>
</SelectContent>
</Select>
<FormMessage />
</FormItem>
)}
/>
<FormField
control={form.control}
name='config.security_config.private_key'
name='config.security_config.reality_private_key'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.security_config.privateKey')}</FormLabel>
Expand All @@ -724,7 +697,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
/>
<FormField
control={form.control}
name='config.security_config.public_key'
name='config.security_config.reality_public_key'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.security_config.publicKey')}</FormLabel>
Expand All @@ -743,7 +716,7 @@ export default function NodeForm<T extends { [x: string]: any }>({
/>
<FormField
control={form.control}
name='config.security_config.short_id'
name='config.security_config.reality_short_id'
render={({ field }) => (
<FormItem>
<FormLabel>{t('form.security_config.shortId')}</FormLabel>
Expand Down
1 change: 0 additions & 1 deletion apps/admin/locales/en-US/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"fingerprint": "Fingerprint",
"privateKey": "Private Key",
"privateKeyPlaceholder": "Leave blank for auto-generation",
"proxyProtocol": "Proxy Protocol",
"publicKey": "Public Key",
"publicKeyPlaceholder": "Leave blank for auto-generation",
"serverAddress": "Server Address",
Expand Down
1 change: 0 additions & 1 deletion apps/admin/locales/zh-CN/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"fingerprint": "FingerPrint",
"privateKey": "Private Key",
"privateKeyPlaceholder": "留空自动生成",
"proxyProtocol": "Proxy Protocol",
"publicKey": "Public Key",
"publicKeyPlaceholder": "留空自动生成",
"serverAddress": "Server Address",
Expand Down

0 comments on commit fadd17f

Please sign in to comment.