Skip to content

Commit

Permalink
zancun
Browse files Browse the repository at this point in the history
  • Loading branch information
song-xiao-lin committed Nov 7, 2024
1 parent 3e46124 commit 0c2ae6e
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,12 @@ export const ConfigNetworkPage: React.FC<ConfigNetworkPageProp> = (props) => {
setCertificateParams(newArr)
currentIndex.current = ClientCertificates.length
}
setParams((v) => ({...v, ...rsp, DisallowDomain: rsp.DisallowDomain.filter((item) => item)}))
setParams((v) => ({
...v,
...rsp,
DisallowDomain: rsp.DisallowDomain.filter((item) => item),
MaxContentLength: +rsp.MaxContentLength / (1024 * 1024) || 10
}))
setLoading(false)
})
})
Expand Down Expand Up @@ -263,8 +268,12 @@ export const ConfigNetworkPage: React.FC<ConfigNetworkPageProp> = (props) => {
})

const ipcSubmit = useMemoizedFn((params: GlobalNetworkConfig, isNtml?: boolean) => {
console.log("SetGlobalNetworkConfig", params)
ipcRenderer.invoke("SetGlobalNetworkConfig", params).then(() => {
const realParams: GlobalNetworkConfig = {
...params,
MaxContentLength: +params.MaxContentLength * 1024 * 1024
}
console.log("SetGlobalNetworkConfig", realParams)
ipcRenderer.invoke("SetGlobalNetworkConfig", realParams).then(() => {
yakitInfo("更新配置成功")
update()
if (isNtml) setVisible(false)
Expand Down Expand Up @@ -869,7 +878,7 @@ export const ConfigNetworkPage: React.FC<ConfigNetworkPageProp> = (props) => {
<YakitInput
suffix='M'
size='small'
value={params.MaxContentLength === "0" ? 10 : params.MaxContentLength || 10}
value={params.MaxContentLength}
onChange={(e) => {
let value = e.target.value.replace(/\D/g, "")
if (value.length > 1 && value.startsWith("0")) {
Expand Down

0 comments on commit 0c2ae6e

Please sign in to comment.