fix: keep decision center records visible during health flaps

This commit is contained in:
Codex
2026-05-17 15:51:37 +00:00
parent 9cfd9c83fa
commit 5be3f37d67
@@ -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 加载失败") }));
}