From d069a37a4930e430289fc032a2a9c5cf11618c09 Mon Sep 17 00:00:00 2001 From: Jackie Han Date: Mon, 14 Oct 2024 14:38:38 -0700 Subject: [PATCH] [Backport 2.17] Fix issues in running historical analysis and custom result index section (#897) Signed-off-by: Jackie Han --- .../components/CustomResultIndex/CustomResultIndex.tsx | 2 +- public/redux/reducers/ad.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx b/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx index 9c0693c7..c5b6447b 100644 --- a/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx +++ b/public/pages/DefineDetector/components/CustomResultIndex/CustomResultIndex.tsx @@ -99,7 +99,7 @@ function CustomResultIndex(props: CustomResultIndexProps) { disabled={props.isEdit} onChange={() => { if (enabled) { - form.setFieldValue('resultIndex', ''); + form.setFieldValue('resultIndex', undefined); } setEnabled(!enabled); }} diff --git a/public/redux/reducers/ad.ts b/public/redux/reducers/ad.ts index 3fa06ad3..5f6bbaa7 100644 --- a/public/redux/reducers/ad.ts +++ b/public/redux/reducers/ad.ts @@ -493,10 +493,8 @@ export const startHistoricalDetector = ( startTime: number, endTime: number ): APIAction => { - const baseUrl = `..${AD_NODE_API.DETECTOR}/${detectorId}`; - const url = dataSourceId - ? `${baseUrl}/${dataSourceId}/start` - : `${baseUrl}/start`; + const baseUrl = `..${AD_NODE_API.DETECTOR}/${detectorId}/start`; + const url = dataSourceId ? `${baseUrl}/${dataSourceId}` : baseUrl; return { type: START_HISTORICAL_DETECTOR,