From bcecca7ab7191ba22415ef824a339a26d410dec1 Mon Sep 17 00:00:00 2001 From: Memory <134070804+Memory2314@users.noreply.github.com> Date: Fri, 5 Sep 2025 11:57:51 +0800 Subject: [PATCH] feat: add fetch timeout configuration --- src/main/config/profile.ts | 8 ++++--- src/main/utils/template.ts | 1 + .../src/components/settings/mihomo-config.tsx | 22 +++++++++++++++++++ src/renderer/src/locales/en-US.json | 1 + src/renderer/src/locales/fa-IR.json | 1 + src/renderer/src/locales/ru-RU.json | 1 + src/renderer/src/locales/zh-CN.json | 1 + src/shared/types.d.ts | 1 + 8 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/main/config/profile.ts b/src/main/config/profile.ts index 20b1dc6..10f4be4 100644 --- a/src/main/config/profile.ts +++ b/src/main/config/profile.ts @@ -129,7 +129,7 @@ export async function createProfile(item: Partial): Promise): Promise): Promise { pauseSSID = [], delayTestUrl, userAgent, + subscriptionTimeout = 30000, mihomoCpuPriority = 'PRIORITY_NORMAL', proxyCols = 'auto' } = appConfig || {} @@ -49,6 +50,27 @@ const MihomoConfig: React.FC = () => { }} > + +
+ { + let num = parseInt(v) + await patchAppConfig({ subscriptionTimeout: num * 1000 }) + }} + onBlur={async (e) => { + let num = parseInt(e.target.value) + if (isNaN(num)) num = 30 + if (num < 30) num = 30 + await patchAppConfig({ subscriptionTimeout: num * 1000 }) + }} + /> + {t('common.seconds')} +
+