Skip to content

Commit

Permalink
Fix profiler detail-view bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyixin-cmd authored Aug 22, 2022
1 parent 4a2b1b6 commit 8b1815f
Showing 1 changed file with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -134,7 +134,7 @@ type SelectListItem<T> = {
label: string;
};

const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans, units}) => {
const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans, units, descriptions}) => {
const {t} = useTranslation(['profiler', 'common']);
const [environment, setEnvironment] = useState<environmentType>();
const [distributed, setDistributed] = useState<distributedData>();
Expand All @@ -153,7 +153,6 @@ const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans
const [tableData2, setTableData2] = useState<Event[]>();
const [tableLoading2, settableLoading2] = useState(true);
const [trainData, setTrainData] = useState<trainType>();
const [descriptions, setDescriptions] = useState<any>();
useEffect(() => {
settableLoading(true);
settableLoading2(true);
Expand Down Expand Up @@ -497,22 +496,21 @@ const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans
},
[t]
);
const gettTooltip: (name: string) => JSX.Element = useCallback(
(name: string) => {
const tooltips = (
<div
style={{
width: rem(700),
color: '#333333',
fontWeight: 400
}}
dangerouslySetInnerHTML={{__html: descriptions ? descriptions[name] : ''}}
></div>
);
return tooltips;
},
[descriptions]
);
const gettTooltip: (name: string) => JSX.Element = (name: string) => {
console.log('descriptions', descriptions);

const tooltips = (
<div
style={{
width: rem(700),
color: '#333333',
fontWeight: 400
}}
dangerouslySetInnerHTML={{__html: descriptions ? descriptions[name] : ''}}
></div>
);
return tooltips;
};
const getPopupContainers = (trigger: any) => {
return trigger.parentElement;
};
Expand Down

0 comments on commit 8b1815f

Please sign in to comment.