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

Fix profiler detail-view bug

上级 4a2b1b67
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* limitations under the License. * 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 type {ColumnsType} from 'antd/lib/table';
import PieChart from '~/components/pieChart'; import PieChart from '~/components/pieChart';
import StackColumnChart from '~/components/StackColumnChart'; import StackColumnChart from '~/components/StackColumnChart';
...@@ -134,7 +134,7 @@ type SelectListItem<T> = { ...@@ -134,7 +134,7 @@ type SelectListItem<T> = {
label: string; 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 {t} = useTranslation(['profiler', 'common']);
const [environment, setEnvironment] = useState<environmentType>(); const [environment, setEnvironment] = useState<environmentType>();
const [distributed, setDistributed] = useState<distributedData>(); const [distributed, setDistributed] = useState<distributedData>();
...@@ -153,7 +153,6 @@ const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans ...@@ -153,7 +153,6 @@ const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans
const [tableData2, setTableData2] = useState<Event[]>(); const [tableData2, setTableData2] = useState<Event[]>();
const [tableLoading2, settableLoading2] = useState(true); const [tableLoading2, settableLoading2] = useState(true);
const [trainData, setTrainData] = useState<trainType>(); const [trainData, setTrainData] = useState<trainType>();
const [descriptions, setDescriptions] = useState<any>();
useEffect(() => { useEffect(() => {
settableLoading(true); settableLoading(true);
settableLoading2(true); settableLoading2(true);
...@@ -497,22 +496,21 @@ const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans ...@@ -497,22 +496,21 @@ const OverView: FunctionComponent<overViewProps> = ({runs, views, workers, spans
}, },
[t] [t]
); );
const gettTooltip: (name: string) => JSX.Element = useCallback( const gettTooltip: (name: string) => JSX.Element = (name: string) => {
(name: string) => { console.log('descriptions', descriptions);
const tooltips = (
<div const tooltips = (
style={{ <div
width: rem(700), style={{
color: '#333333', width: rem(700),
fontWeight: 400 color: '#333333',
}} fontWeight: 400
dangerouslySetInnerHTML={{__html: descriptions ? descriptions[name] : ''}} }}
></div> dangerouslySetInnerHTML={{__html: descriptions ? descriptions[name] : ''}}
); ></div>
return tooltips; );
}, return tooltips;
[descriptions] };
);
const getPopupContainers = (trigger: any) => { const getPopupContainers = (trigger: any) => {
return trigger.parentElement; return trigger.parentElement;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册