Skip to content

Commit 77ce590

Browse files
authored
[Optimization-4340] Support recover from the latest completed CheckPoint (#4438)
1 parent 9a52ddc commit 77ce590

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

  • dinky-web/src/pages
    • DevOps/JobDetail/CheckPointsTab/components
    • RegCenter/Document/components/DocumentProTable

dinky-web/src/pages/DevOps/JobDetail/CheckPointsTab/components/CkDesc.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import {
2727
RocketOutlined,
2828
SyncOutlined
2929
} from '@ant-design/icons';
30-
import { Descriptions, Space, Tag } from 'antd';
30+
import { Button, Descriptions, Space, Tag } from 'antd';
31+
import { recoveryCheckPoint } from '@/pages/DevOps/JobDetail/CheckPointsTab/components/functions';
32+
import { l } from '@/utils/intl';
3133

3234
const CkDesc = (props: JobProps) => {
3335
const { jobDetail } = props;
@@ -83,6 +85,15 @@ const CkDesc = (props: JobProps) => {
8385
{latest?.completed?.external_path ?? 'None'}
8486
</EllipsisMiddle>
8587
</Tag>
88+
{latest?.completed?.external_path ? (
89+
<Button
90+
onClick={() =>
91+
recoveryCheckPoint(jobDetail?.instance?.taskId, latest?.completed?.external_path)
92+
}
93+
>
94+
{l('devops.jobinfo.ck.recovery.recoveryTo')}
95+
</Button>
96+
) : undefined}
8697
</Descriptions.Item>
8798

8899
<Descriptions.Item label='Persist Checkpoints Externally Enabled'>

dinky-web/src/pages/RegCenter/Document/components/DocumentProTable/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ import React, { useRef, useState } from 'react';
4646
import { Select } from 'antd';
4747
import { JOB_TYPE } from '@/pages/DataStudio/Toolbar/Project/constants';
4848

49-
const FUNCTION_TYPES = Object.values(DOCUMENT_FUNCTION_TYPE_ENUMS).map(item => ({ label: item.text, value: item.value }));
49+
const FUNCTION_TYPES = Object.values(DOCUMENT_FUNCTION_TYPE_ENUMS).map((item) => ({
50+
label: item.text,
51+
value: item.value
52+
}));
5053

5154
const DocumentTableList: React.FC = () => {
5255
const [documentState, setDocumentState] = useState<DocumentState>(InitDocumentState);
@@ -130,11 +133,9 @@ const DocumentTableList: React.FC = () => {
130133
valueEnum: DOCUMENT_FUNCTION_TYPE_ENUMS,
131134
renderFormItem: (item, { type }, form) => {
132135
const currentType = form.getFieldValue('type');
133-
let options = currentType === DOCUMENT_TYPE_ENUMS.FUN_UDF.value ? FUNCTION_TYPES : JOB_TYPE;
134-
return (
135-
<Select allowClear options={options} />
136-
);
137-
},
136+
let options = currentType === DOCUMENT_TYPE_ENUMS.FUN_UDF.value ? FUNCTION_TYPES : JOB_TYPE;
137+
return <Select allowClear options={options} />;
138+
}
138139
},
139140
{
140141
title: l('rc.doc.category'),

0 commit comments

Comments
 (0)