fix: URL test url

This commit is contained in:
wonfen 2026-04-03 12:13:04 +08:00
parent b7ae5f0ac9
commit 51578c03b0
No known key found for this signature in database
GPG Key ID: CEAFD6C73AB2001F
6 changed files with 22 additions and 10 deletions

View File

@ -252,15 +252,27 @@ impl SilentUpdater {
true true
} }
Ok(Ok(Err(e))) => { Ok(Ok(Err(e))) => {
logging!(warn, Type::System, "Startup install failed: {e}, will retry next launch"); logging!(
warn,
Type::System,
"Startup install failed: {e}, will retry next launch"
);
false false
} }
Ok(Err(e)) => { Ok(Err(e)) => {
logging!(warn, Type::System, "Startup install task panicked: {e}, will retry next launch"); logging!(
warn,
Type::System,
"Startup install task panicked: {e}, will retry next launch"
);
false false
} }
Err(_) => { Err(_) => {
logging!(warn, Type::System, "Startup install timed out (30s), will retry next launch"); logging!(
warn,
Type::System,
"Startup install timed out (30s), will retry next launch"
);
false false
} }
}; };
@ -283,8 +295,7 @@ impl SilentUpdater {
use tauri_plugin_dialog::{DialogExt as _, MessageDialogButtons, MessageDialogKind}; use tauri_plugin_dialog::{DialogExt as _, MessageDialogButtons, MessageDialogKind};
let title = clash_verge_i18n::t!("notifications.updateReady.title").to_string(); let title = clash_verge_i18n::t!("notifications.updateReady.title").to_string();
let body = clash_verge_i18n::t!("notifications.updateReady.body") let body = clash_verge_i18n::t!("notifications.updateReady.body").replace("{version}", version);
.replace("{version}", version);
let install_now = clash_verge_i18n::t!("notifications.updateReady.installNow").to_string(); let install_now = clash_verge_i18n::t!("notifications.updateReady.installNow").to_string();
let later = clash_verge_i18n::t!("notifications.updateReady.later").to_string(); let later = clash_verge_i18n::t!("notifications.updateReady.later").to_string();

View File

@ -614,7 +614,7 @@ export const GroupsEditorViewer = (props: Props) => {
/> />
<TextField <TextField
autoComplete="new-password" autoComplete="new-password"
placeholder="http://cp.cloudflare.com" placeholder="http://cp.cloudflare.com/generate_204"
size="small" size="small"
sx={{ width: 'calc(100% - 150px)' }} sx={{ width: 'calc(100% - 150px)' }}
{...field} {...field}

View File

@ -66,7 +66,8 @@ export const ProxyHead = ({
const { verge } = useVerge() const { verge } = useVerge()
const defaultLatencyUrl = const defaultLatencyUrl =
verge?.default_latency_test?.trim() || 'http://cp.cloudflare.com' verge?.default_latency_test?.trim() ||
'http://cp.cloudflare.com/generate_204'
useEffect(() => { useEffect(() => {
delayManager.setUrl(groupName, testUrl?.trim() || url || defaultLatencyUrl) delayManager.setUrl(groupName, testUrl?.trim() || url || defaultLatencyUrl)

View File

@ -383,7 +383,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
spellCheck="false" spellCheck="false"
sx={{ width: 250, marginLeft: 'auto' }} sx={{ width: 250, marginLeft: 'auto' }}
value={values.defaultLatencyTest} value={values.defaultLatencyTest}
placeholder="http://cp.cloudflare.com" placeholder="http://cp.cloudflare.com/generate_204"
onChange={(e) => onChange={(e) =>
setValues((v) => ({ ...v, defaultLatencyTest: e.target.value })) setValues((v) => ({ ...v, defaultLatencyTest: e.target.value }))
} }

View File

@ -340,7 +340,7 @@ export async function cmdGetProxyDelay(
url?: string, url?: string,
) { ) {
// 确保URL不为空 // 确保URL不为空
const testUrl = url || 'http://cp.cloudflare.com' const testUrl = url || 'http://cp.cloudflare.com/generate_204'
try { try {
// 不再在前端编码代理名称,由后端统一处理编码 // 不再在前端编码代理名称,由后端统一处理编码

View File

@ -120,7 +120,7 @@ class DelayManager {
`[DelayManager] 获取测试URL组: ${group}, URL: ${url || '未设置'}`, `[DelayManager] 获取测试URL组: ${group}, URL: ${url || '未设置'}`,
) )
// 如果未设置URL返回默认URL // 如果未设置URL返回默认URL
return url || 'http://cp.cloudflare.com' return url || 'http://cp.cloudflare.com/generate_204'
} }
setListener( setListener(