From 8b1815f33de55fc27fb28e471ab095f898b067b6 Mon Sep 17 00:00:00 2001 From: RotPublic <63988781+xiaoyixin-cmd@users.noreply.github.com> Date: Mon, 22 Aug 2022 17:25:56 +0800 Subject: [PATCH] Fix profiler detail-view bug --- .../ProfilerPage/overview/overview.tsx | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/frontend/packages/core/src/components/ProfilerPage/overview/overview.tsx b/frontend/packages/core/src/components/ProfilerPage/overview/overview.tsx index 787599c77..2001cb039 100644 --- a/frontend/packages/core/src/components/ProfilerPage/overview/overview.tsx +++ b/frontend/packages/core/src/components/ProfilerPage/overview/overview.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import React, {FunctionComponent, useCallback, useEffect, useState} from 'react'; +import React, {FunctionComponent, useCallback, useEffect, useMemo, useState} from 'react'; import type {ColumnsType} from 'antd/lib/table'; import PieChart from '~/components/pieChart'; import StackColumnChart from '~/components/StackColumnChart'; @@ -134,7 +134,7 @@ type SelectListItem = { label: string; }; -const OverView: FunctionComponent = ({runs, views, workers, spans, units}) => { +const OverView: FunctionComponent = ({runs, views, workers, spans, units, descriptions}) => { const {t} = useTranslation(['profiler', 'common']); const [environment, setEnvironment] = useState(); const [distributed, setDistributed] = useState(); @@ -153,7 +153,6 @@ const OverView: FunctionComponent = ({runs, views, workers, spans const [tableData2, setTableData2] = useState(); const [tableLoading2, settableLoading2] = useState(true); const [trainData, setTrainData] = useState(); - const [descriptions, setDescriptions] = useState(); useEffect(() => { settableLoading(true); settableLoading2(true); @@ -497,22 +496,21 @@ const OverView: FunctionComponent = ({runs, views, workers, spans }, [t] ); - const gettTooltip: (name: string) => JSX.Element = useCallback( - (name: string) => { - const tooltips = ( -
- ); - return tooltips; - }, - [descriptions] - ); + const gettTooltip: (name: string) => JSX.Element = (name: string) => { + console.log('descriptions', descriptions); + + const tooltips = ( +
+ ); + return tooltips; + }; const getPopupContainers = (trigger: any) => { return trigger.parentElement; };