Unverified Commit 7fd4ab89 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Fix] fix-query-checkpoint-function (#2817)

* fix-query-checkpoint-function * Spotless Apply --------- Co-authored-by: 's avatarZzm0809 <Zzm0809@users.noreply.github.com>
parent 118d3361
...@@ -27,7 +27,8 @@ import { ...@@ -27,7 +27,8 @@ import {
zoomOptions zoomOptions
} from '@/components/Flink/FlinkDag/config'; } from '@/components/Flink/FlinkDag/config';
import { buildDag, regConnect, updateDag } from '@/components/Flink/FlinkDag/functions'; import { buildDag, regConnect, updateDag } from '@/components/Flink/FlinkDag/functions';
import { getData } from '@/services/api'; import EllipsisMiddle from '@/components/Typography/EllipsisMiddle';
import { getDataByParamsReturnResult } from '@/services/BusinessCrud';
import { API_CONSTANTS } from '@/services/endpoints'; import { API_CONSTANTS } from '@/services/endpoints';
import { Jobs } from '@/types/DevOps/data'; import { Jobs } from '@/types/DevOps/data';
import { DagreLayout } from '@antv/layout'; import { DagreLayout } from '@antv/layout';
...@@ -35,7 +36,7 @@ import { Edge, Graph } from '@antv/x6'; ...@@ -35,7 +36,7 @@ import { Edge, Graph } from '@antv/x6';
import { Rectangle } from '@antv/x6-geometry'; import { Rectangle } from '@antv/x6-geometry';
import { Selection } from '@antv/x6-plugin-selection'; import { Selection } from '@antv/x6-plugin-selection';
import { register } from '@antv/x6-react-shape'; import { register } from '@antv/x6-react-shape';
import { Drawer, Select, Slider, Table, Tabs, TabsProps, Typography } from 'antd'; import { Drawer, Select, Slider, Table, Tabs, TabsProps, Tag, Typography } from 'antd';
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import './index.css'; import './index.css';
...@@ -66,7 +67,13 @@ const RenderCheckpoint = (id: string, checkPoints: any) => { ...@@ -66,7 +67,13 @@ const RenderCheckpoint = (id: string, checkPoints: any) => {
return; return;
} }
getData(API_CONSTANTS.READ_CHECKPOINT, { path: selectPath, operatorId: id }).then((res) => { getDataByParamsReturnResult(API_CONSTANTS.READ_CHECKPOINT, {
path: selectPath,
operatorId: id
}).then((res) => {
if (!res || res.code !== 0) {
return;
}
const genData = Object.keys(res.data).map((x) => { const genData = Object.keys(res.data).map((x) => {
const datum = res.data[x]; const datum = res.data[x];
return { return {
...@@ -112,10 +119,21 @@ const RenderCheckpoint = (id: string, checkPoints: any) => { ...@@ -112,10 +119,21 @@ const RenderCheckpoint = (id: string, checkPoints: any) => {
<Select <Select
defaultValue={selectPath} defaultValue={selectPath}
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder='Select a person' placeholder='Select a Checkpoint'
optionFilterProp='children' optionFilterProp='children'
options={checkpointArray.map((x) => { options={checkpointArray.map((x) => {
return { label: x.id, value: x.path }; return {
label: (
<>
<Tag color='success'>CheckPoint Id: {x.id}</Tag>
<Tag color='processing'>
CheckPoint Path:<EllipsisMiddle maxCount={40}>{x.path}</EllipsisMiddle>
</Tag>
<Tag color='processing'>Type:{x.checkpointType}</Tag>
</>
),
value: x.path
};
})} })}
onChange={(path) => { onChange={(path) => {
setSelectPath(path); setSelectPath(path);
......
...@@ -54,7 +54,8 @@ const handleBizError = (result: ResponseStructure) => { ...@@ -54,7 +54,8 @@ const handleBizError = (result: ResponseStructure) => {
WarningNotification(msg, l('app.response.error')); WarningNotification(msg, l('app.response.error'));
break; break;
case ErrorCode.EXCEPTION: case ErrorCode.EXCEPTION:
if (Boolean(getValueFromLocalStorage(ENABLE_MODEL_TIP))) { const valueFromLocalStorage = getValueFromLocalStorage(ENABLE_MODEL_TIP);
if (valueFromLocalStorage === 'true') {
ErrorNotification(data, l('app.response.exception')); ErrorNotification(data, l('app.response.exception'));
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment