From e15d2cd31e56d95304274274e55937bc39c11bb4 Mon Sep 17 00:00:00 2001 From: Momentry Studio Date: Tue, 27 Oct 2026 15:52:30 +0800 Subject: [PATCH] fix: Core API health check path - use /api/v1/health for all cases - Removed incorrect localhost conditional that used /health (404) - Now uses /api/v1/health for both localhost and remote access - Added console.error logging for debugging - Aligns with Core API route design --- src/views/AdminView.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/AdminView.vue b/src/views/AdminView.vue index f59166a..7e74079 100644 --- a/src/views/AdminView.vue +++ b/src/views/AdminView.vue @@ -935,16 +935,15 @@ async function testCoreApi() { testingCore.value = true coreInfo.value = null try { - const isLocalhost = coreApiUrl.value.includes('localhost') || coreApiUrl.value.includes('127.0.0.1') - // Localhost: direct /health path - // Remote: via reverse proxy at /api/v1/health - const healthUrl = isLocalhost ? `${coreApiUrl.value}/health` : `${coreApiUrl.value}/api/v1/health` + // Core API uses /api/v1/health for both localhost and remote access + const healthUrl = `${coreApiUrl.value}/api/v1/health` const resp = await fetch(healthUrl, { signal: AbortSignal.timeout(5000) }) if (!resp.ok) throw new Error(`HTTP ${resp.status}`) const data = await resp.json() coreStatus.value = 'online' coreInfo.value = { version: data.version, uptime: data.uptime_ms } } catch (e: any) { + console.error('[testCoreApi] Failed:', e.message || e) coreStatus.value = 'offline' coreInfo.value = null } finally {