Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

profiler详情提示bug修复 #1118

Merged
merged 3 commits into from
Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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