mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: setting page error
This commit is contained in:
parent
3bf124dbb3
commit
6f2e74fced
@ -13,8 +13,8 @@ import { isClashX, jsBridge } from '@lib/jsBridge'
|
||||
class Settings extends React.Component<I18nProps, {}> {
|
||||
state = {
|
||||
startAtLogin: false,
|
||||
setAsSystemProxy: true,
|
||||
allowConnectFromLan: true,
|
||||
setAsSystemProxy: false,
|
||||
allowConnectFromLan: false,
|
||||
proxyMode: 'Rule',
|
||||
socks5ProxyPort: 7891,
|
||||
httpProxyPort: 7890,
|
||||
@ -51,7 +51,7 @@ class Settings extends React.Component<I18nProps, {}> {
|
||||
}
|
||||
|
||||
handleHttpPortSave = async () => {
|
||||
const [, err] = await to(updateConfig({ 'redir-port': this.state.httpProxyPort }))
|
||||
const [, err] = await to(updateConfig({ 'port': this.state.httpProxyPort }))
|
||||
if (err === null) {}
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ class Settings extends React.Component<I18nProps, {}> {
|
||||
<Col span={3} offset={3}>
|
||||
<Input
|
||||
value={socks5ProxyPort}
|
||||
onChange={socks5ProxyPort => this.setState({ socks5ProxyPort })}
|
||||
onChange={socks5ProxyPort => this.setState({ socks5ProxyPort: parseInt(socks5ProxyPort, 10) })}
|
||||
onBlur={this.handleSocksPortSave}
|
||||
/>
|
||||
</Col>
|
||||
@ -194,7 +194,7 @@ class Settings extends React.Component<I18nProps, {}> {
|
||||
<Col span={3} offset={2}>
|
||||
<Input
|
||||
value={httpProxyPort}
|
||||
onChange={httpProxyPort => this.setState({ httpProxyPort })}
|
||||
onChange={httpProxyPort => this.setState({ httpProxyPort: parseInt(httpProxyPort, 10) })}
|
||||
onBlur={this.handleHttpPortSave}
|
||||
/>
|
||||
</Col>
|
||||
|
@ -119,7 +119,7 @@ export class JsBridge {
|
||||
return new Promise<T>((resolve) => {
|
||||
this.instance.callHandler(
|
||||
handleName,
|
||||
data || undefined,
|
||||
data,
|
||||
resolve
|
||||
)
|
||||
})
|
||||
|
@ -39,7 +39,7 @@ export async function getConfig () {
|
||||
|
||||
export async function updateConfig (config: Partial<Config>) {
|
||||
const req = await getInstance()
|
||||
return req.put<void>('configs', config)
|
||||
return req.patch<void>('configs', config)
|
||||
}
|
||||
|
||||
export async function getRules () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user