From 5be3f37d67880c8fb2014e49095f44bf2bac7b1f Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 17 May 2026 15:51:37 +0000 Subject: [PATCH] fix: keep decision center records visible during health flaps --- src/components/frontend/src/decision-center.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/frontend/src/decision-center.tsx b/src/components/frontend/src/decision-center.tsx index 53d141a2..4e1ba735 100644 --- a/src/components/frontend/src/decision-center.tsx +++ b/src/components/frontend/src/decision-center.tsx @@ -174,11 +174,15 @@ export function DecisionCenterPage({ microservices, onRaw, apiBaseUrl = "/api" } setState((prev: any) => ({ ...prev, loading: true, error: "" })); try { const query = filteredQuery(filters); - const [health, records] = await Promise.all([ - requestJson(`${apiBaseUrl}/microservices/decision-center/health`), - requestJson(decisionApi(apiBaseUrl, `/api/records?${query}`)), - ]); - setState({ loading: false, error: "", health, records: Array.isArray(records.records) ? records.records : [], refreshedAt: new Date() }); + const records = await requestJson(decisionApi(apiBaseUrl, `/api/records?${query}`)); + let health: any = state.health; + let healthError = ""; + try { + health = await requestJson(`${apiBaseUrl}/microservices/decision-center/health`); + } catch (err) { + healthError = errorMessage(err, "Decision Center health 检查失败"); + } + setState({ loading: false, error: healthError, health, records: Array.isArray(records.records) ? records.records : [], refreshedAt: new Date() }); } catch (err) { setState((prev: any) => ({ ...prev, loading: false, error: errorMessage(err, "Decision Center 加载失败") })); }