mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 11:42:19 +08:00
fix a little
This commit is contained in:
parent
b80dbfbcfd
commit
f1b83ee070
|
@ -4,6 +4,8 @@ export const defaultConfig: IAppConfig = {
|
|||
proxyDisplayMode: 'simple',
|
||||
proxyDisplayOrder: 'default',
|
||||
autoCheckUpdate: true,
|
||||
useNameserverPolicy: false,
|
||||
nameserverPolicy: {},
|
||||
sysProxy: { enable: false, mode: 'manual' }
|
||||
}
|
||||
|
||||
|
|
|
@ -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) => (
|
||||
<div key={index} className="mt-2 flex">
|
||||
<Input
|
||||
fullWidth
|
||||
|
|
|
@ -23,8 +23,15 @@ const Settings: React.FC = () => {
|
|||
})
|
||||
|
||||
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 (
|
||||
<BasePage
|
||||
|
@ -76,6 +83,20 @@ const Settings: React.FC = () => {
|
|||
</SettingItem>
|
||||
</SettingCard>
|
||||
<SettingCard>
|
||||
<SettingItem title="订阅拉取 UA" divider>
|
||||
<Input
|
||||
size="sm"
|
||||
className="w-[60%]"
|
||||
value={ua}
|
||||
placeholder="默认 clash-meta"
|
||||
onValueChange={(v) => {
|
||||
setUa(v)
|
||||
debounce(() => {
|
||||
patchAppConfig({ userAgent: v })
|
||||
}, 2000)
|
||||
}}
|
||||
></Input>
|
||||
</SettingItem>
|
||||
<SettingItem title="延迟测试地址" divider>
|
||||
<Input
|
||||
size="sm"
|
||||
|
|
Loading…
Reference in New Issue
Block a user