Chore: disable change port on clashx

This commit is contained in:
Dreamacro 2020-06-16 23:01:32 +08:00
parent 3acae645af
commit f730bc7380
2 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,7 @@ interface InputProps extends BaseComponentProps {
inside?: boolean inside?: boolean
autoFocus?: boolean autoFocus?: boolean
type?: string type?: string
disabled?: boolean
onChange?: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void onChange?: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void
onBlur?: (event?: React.FocusEvent<HTMLInputElement>) => void onBlur?: (event?: React.FocusEvent<HTMLInputElement>) => void
} }
@ -23,6 +24,7 @@ export function Input (props: InputProps) {
inside = false, inside = false,
autoFocus = false, autoFocus = false,
type = 'text', type = 'text',
disabled = false,
onChange = noop, onChange = noop,
onBlur = noop onBlur = noop
} = props } = props
@ -30,6 +32,7 @@ export function Input (props: InputProps) {
return ( return (
<input <input
disabled={disabled}
className={classname} className={classname}
style={style} style={style}
value={value} value={value}

View File

@ -152,6 +152,7 @@ export default function Settings () {
</Col> </Col>
<Col span={8}> <Col span={8}>
<Input <Input
disabled={clashXData.isClashX}
value={info.socks5ProxyPort} value={info.socks5ProxyPort}
onChange={socks5ProxyPort => set('socks5ProxyPort', +socks5ProxyPort)} onChange={socks5ProxyPort => set('socks5ProxyPort', +socks5ProxyPort)}
onBlur={handleSocksPortSave} onBlur={handleSocksPortSave}
@ -166,6 +167,7 @@ export default function Settings () {
</Col> </Col>
<Col span={8}> <Col span={8}>
<Input <Input
disabled={clashXData.isClashX}
value={info.httpProxyPort} value={info.httpProxyPort}
onChange={httpProxyPort => set('httpProxyPort', +httpProxyPort)} onChange={httpProxyPort => set('httpProxyPort', +httpProxyPort)}
onBlur={handleHttpPortSave} onBlur={handleHttpPortSave}