未验证 提交 8b1815f3 编写于 作者: R RotPublic 提交者: GitHub

Fix profiler detail-view bug

上级 4a2b1b67
......@@ -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<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>();
......@@ -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);
......@@ -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;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册