diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 1759a7a..8ed6675 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -40,7 +40,7 @@ export default { auto: 'Auto', off: 'Off', proxiesPreviewType: 'Proxies preview type', - urlForLatencyTest: 'Url for latency test', + urlForLatencyTest: 'URL for latency test', autoCloseConns: 'Automatically close all connections', useTwemoji: 'Use Twemoji Mozilla Font', autoSwitchTheme: 'Automatically switch theme', @@ -66,4 +66,5 @@ export default { lg: 'Large size', switchEndpoint: 'Switch Endpoint', switchLanguage: 'Switch Language', + requestTimeoutDuration: 'Request Timeout Duration', } diff --git a/src/i18n/zh.ts b/src/i18n/zh.ts index e36bedc..4cb4bbc 100644 --- a/src/i18n/zh.ts +++ b/src/i18n/zh.ts @@ -66,4 +66,5 @@ export default { lg: '超大尺寸', switchEndpoint: '切换后端', switchLanguage: '切换语言', + requestTimeoutDuration: '请求超时时间', } diff --git a/src/pages/Config.tsx b/src/pages/Config.tsx index c8d630e..6dfb2af 100644 --- a/src/pages/Config.tsx +++ b/src/pages/Config.tsx @@ -2,7 +2,14 @@ import { createForm } from '@felte/solid' import { validator } from '@felte/validator-zod' import { useI18n } from '@solid-primitives/i18n' import { useNavigate } from '@solidjs/router' -import { For, Show, createSignal, onMount } from 'solid-js' +import { + For, + ParentComponent, + Show, + children, + createSignal, + onMount, +} from 'solid-js' import { z } from 'zod' import { Button } from '~/components' import { @@ -23,6 +30,7 @@ import { proxiesPreviewType, renderInTwoColumn, renderProxiesInSamePage, + requestTimeoutDuration, setAutoCloseConns, setAutoSwitchTheme, setFavDayTheme, @@ -31,6 +39,7 @@ import { setProxiesPreviewType, setRenderInTwoColumn, setRenderProxiesInSamePage, + setRequestTimeoutDuration, setSelectedEndpoint, setTableSize, setTwemoji, @@ -47,6 +56,12 @@ const dnsQueryFormSchema = z.object({ type: z.string(), }) +const ConfigTitle: ParentComponent = (props) => ( +
+ {children(() => props.children)()} +
+) + const DNSQueryForm = () => { const [t] = useI18n() const request = useRequest() @@ -73,6 +88,7 @@ const DNSQueryForm = () => {
+
setUrlForLatencyTest(e.target.value)} />
-
{t('autoCloseConns')}
+ + {t('requestTimeoutDuration')} ({t('ms')}) + + + setRequestTimeoutDuration(Number(e.target.value))} + /> +
+ +
+ {t('autoCloseConns')} { return (
-
{t('renderInTwoColumns')}
+ {t('renderInTwoColumns')} + { />
-
- {t('renderProxiesInSamePage')} -
+ {t('renderProxiesInSamePage')} + { }} />
+
-
{t('autoSwitchTheme')}
+ {t('autoSwitchTheme')} + { }} />
+
-
{t('favDayTheme')}
+ {t('favDayTheme')} +
-
{t('favNightTheme')}
+ {t('favNightTheme')} {
-
{t('proxiesPreviewType')}
+ {t('proxiesPreviewType')} {
-
{t('tableSize')}
+ {t('tableSize')}