tunnel.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { useTranslation } from 'react-i18next';
  2. import { Form, Input, InputNumber, Select, Switch } from 'antd';
  3. import { HeaderMapEditor } from '@/components/form';
  4. export default function TunnelFields() {
  5. const { t } = useTranslation();
  6. return (
  7. <>
  8. <Form.Item name={['settings', 'rewriteAddress']} label={t('pages.inbounds.form.rewriteAddress')}>
  9. <Input />
  10. </Form.Item>
  11. <Form.Item name={['settings', 'rewritePort']} label={t('pages.inbounds.form.rewritePort')}>
  12. <InputNumber min={0} max={65535} />
  13. </Form.Item>
  14. <Form.Item name={['settings', 'allowedNetwork']} label={t('pages.inbounds.form.allowedNetwork')}>
  15. <Select
  16. options={[
  17. { value: 'tcp,udp', label: 'TCP, UDP' },
  18. { value: 'tcp', label: 'TCP' },
  19. { value: 'udp', label: 'UDP' },
  20. ]}
  21. />
  22. </Form.Item>
  23. <Form.Item label={t('pages.inbounds.portMap')} name={['settings', 'portMap']}>
  24. <HeaderMapEditor mode="v1" />
  25. </Form.Item>
  26. <Form.Item
  27. name={['settings', 'followRedirect']}
  28. label={t('pages.inbounds.form.followRedirect')}
  29. valuePropName="checked"
  30. >
  31. <Switch />
  32. </Form.Item>
  33. </>
  34. );
  35. }