diff --git a/frontend/src/pages/Monitor.tsx b/frontend/src/pages/Monitor.tsx index ab2a42b..76f6309 100644 --- a/frontend/src/pages/Monitor.tsx +++ b/frontend/src/pages/Monitor.tsx @@ -258,6 +258,15 @@ export default function Monitor() { // 从后端加载监控设置 const loadMonitorSettings = async () => { try { + // 加载全局代理配置(始终执行) + const configRes = await fetch('/api/config') + if (configRes.ok) { + const configJson = await configRes.json() + if (configJson.code === 0 && configJson.data) { + setGlobalProxy(configJson.data.default_proxy || '') + } + } + // 加载监控设置 const res = await fetch('/api/monitor/settings') if (res.ok) { @@ -288,15 +297,6 @@ export default function Monitor() { return { target, autoAdd: autoAddVal, minInterval: minIntervalVal, checkInterval: checkIntervalVal, pollingEnabled: pollingEnabledVal, pollingInterval: interval, replenishUseProxy: replenishUseProxyVal, browserType: browserTypeVal } } } - - // 加载全局代理配置 - const configRes = await fetch('/api/config') - if (configRes.ok) { - const configJson = await configRes.json() - if (configJson.code === 0 && configJson.data) { - setGlobalProxy(configJson.data.default_proxy || '') - } - } } catch (e) { console.error('加载监控设置失败:', e) } @@ -537,12 +537,12 @@ export default function Monitor() { disabled={!autoAdd || !globalProxy} label="补号时使用代理" description={ - globalProxy - ? `当前代理: ${globalProxy}` - : '请先在系统配置中设置代理地址(支持 http://host:port、http://user:pass@host:port、host:port:user:pass)' + globalProxy + ? `当前代理: ${globalProxy}` + : '请先在系统配置中设置代理地址(支持 http://host:port、http://user:pass@host:port、host:port:user:pass)' } - /> - + /> + {/* 浏览器选择器 */}