|
@@ -1,6 +1,6 @@
|
|
|
import type { ReactNode } from 'react';
|
|
import type { ReactNode } from 'react';
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
-import { Button, Form, Input, InputNumber, Space, Tooltip } from 'antd';
|
|
|
|
|
|
|
+import { Button, Form, Input, InputNumber, Select, Space, Switch, Tooltip } from 'antd';
|
|
|
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
|
import { MinusOutlined, PlusOutlined } from '@ant-design/icons';
|
|
|
import { useFieldArray, useFormContext } from 'react-hook-form';
|
|
import { useFieldArray, useFormContext } from 'react-hook-form';
|
|
|
|
|
|
|
@@ -35,6 +35,12 @@ function StringList({ name, label, placeholder }: StringListProps) {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// xray-core 26.9.30 accepts exactly these autoSystemWfpBlockLeak values.
|
|
|
|
|
+const WFP_BLOCK_LEAK_OPTIONS = [
|
|
|
|
|
+ { value: 'dns', label: 'dns' },
|
|
|
|
|
+ { value: 'misconfigtun', label: 'misconfigtun' },
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
export default function TunFields() {
|
|
export default function TunFields() {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
return (
|
|
return (
|
|
@@ -42,6 +48,13 @@ export default function TunFields() {
|
|
|
<FormField name={['settings', 'name']} label={t('pages.inbounds.info.interfaceName')}>
|
|
<FormField name={['settings', 'name']} label={t('pages.inbounds.info.interfaceName')}>
|
|
|
<Input placeholder="xray0" />
|
|
<Input placeholder="xray0" />
|
|
|
</FormField>
|
|
</FormField>
|
|
|
|
|
+ <FormField
|
|
|
|
|
+ name={['settings', 'desc']}
|
|
|
|
|
+ label={t('pages.inbounds.form.tunDesc')}
|
|
|
|
|
+ tooltip={t('pages.inbounds.form.tunDescTooltip')}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Input id="tun-desc" placeholder="Wintun" />
|
|
|
|
|
+ </FormField>
|
|
|
<FormField name={['settings', 'mtu']} label="MTU">
|
|
<FormField name={['settings', 'mtu']} label="MTU">
|
|
|
<InputNumber min={0} />
|
|
<InputNumber min={0} />
|
|
|
</FormField>
|
|
</FormField>
|
|
@@ -77,6 +90,26 @@ export default function TunFields() {
|
|
|
>
|
|
>
|
|
|
<Input placeholder="auto" />
|
|
<Input placeholder="auto" />
|
|
|
</FormField>
|
|
</FormField>
|
|
|
|
|
+ <FormField
|
|
|
|
|
+ name={['settings', 'autoSystemDnsToGateway']}
|
|
|
|
|
+ label={t('pages.inbounds.form.autoSystemDnsToGateway')}
|
|
|
|
|
+ tooltip={t('pages.inbounds.form.autoSystemDnsToGatewayTooltip')}
|
|
|
|
|
+ valueProp="checked"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Switch id="tun-auto-dns-gateway" />
|
|
|
|
|
+ </FormField>
|
|
|
|
|
+ <FormField
|
|
|
|
|
+ name={['settings', 'autoSystemWfpBlockLeak']}
|
|
|
|
|
+ label={t('pages.inbounds.form.autoSystemWfpBlockLeak')}
|
|
|
|
|
+ tooltip={t('pages.inbounds.form.autoSystemWfpBlockLeakTooltip')}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Select
|
|
|
|
|
+ id="tun-wfp-block-leak"
|
|
|
|
|
+ mode="multiple"
|
|
|
|
|
+ allowClear
|
|
|
|
|
+ options={WFP_BLOCK_LEAK_OPTIONS}
|
|
|
|
|
+ />
|
|
|
|
|
+ </FormField>
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|