diff --git a/src/main/utils/template.ts b/src/main/utils/template.ts index ad23664..4806e01 100644 --- a/src/main/utils/template.ts +++ b/src/main/utils/template.ts @@ -4,6 +4,8 @@ export const defaultConfig: IAppConfig = { proxyDisplayMode: 'simple', proxyDisplayOrder: 'default', autoCheckUpdate: true, + useNameserverPolicy: false, + nameserverPolicy: {}, sysProxy: { enable: false, mode: 'manual' } } diff --git a/src/renderer/src/pages/dns.tsx b/src/renderer/src/pages/dns.tsx index e643606..a941b39 100644 --- a/src/renderer/src/pages/dns.tsx +++ b/src/renderer/src/pages/dns.tsx @@ -55,20 +55,20 @@ const DNS: React.FC = () => { if (value.trim()) { if (index < list.length) { list[index] = value - } else if (list.length < 4) { + } else { list.push(value) } } else { list.splice(index, 1) } - setValues({ ...values, [type]: list.slice(0, 4) }) + setValues({ ...values, [type]: list }) } const renderListInputs = (type: string, placeholder: string): ReactNode => { - const currentItems = values[type].slice(0, 4) - const showNewLine = currentItems.length < 4 && currentItems.every((item) => item.trim() !== '') + const currentItems = values[type] + const showNewLine = currentItems.every((item: string) => item.trim() !== '') - return [...currentItems, ...(showNewLine ? [''] : [])].slice(0, 4).map((item, index) => ( + return [...currentItems, ...(showNewLine ? [''] : [])].map((item, index) => (
{ }) const { appConfig, patchAppConfig } = useAppConfig() - const { silentStart = false, delayTestUrl, delayTestTimeout, autoCheckUpdate } = appConfig || {} + const { + silentStart = false, + delayTestUrl, + delayTestTimeout, + autoCheckUpdate, + userAgent + } = appConfig || {} const [url, setUrl] = useState(delayTestUrl) + const [ua, setUa] = useState(userAgent) return ( { + + { + setUa(v) + debounce(() => { + patchAppConfig({ userAgent: v }) + }, 2000) + }} + > +