Unverified Commit 9ef1da02 authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Optimization] optimize restart task tips (#2930)

* optimize restart task * Spotless Apply --------- Co-authored-by: 's avatarZzm0809 <Zzm0809@users.noreply.github.com>
parent 13ea40c7
......@@ -40,8 +40,8 @@ export function cancelTask(title: string, id: number, withSavePoint: boolean = t
return handleGetOption(API_CONSTANTS.CANCEL_JOB, title, { id, withSavePoint });
}
export function restartTask(id: number, savePointPath: string) {
return handleGetOption(API_CONSTANTS.RESTART_TASK, '', { id, savePointPath });
export function restartTask(id: number, savePointPath: string, title: string) {
return handleGetOption(API_CONSTANTS.RESTART_TASK, title, { id, savePointPath });
}
export function savePointTask(title: string, taskId: number, savePointType: string) {
return handleGetOption(API_CONSTANTS.SAVEPOINT, title, { taskId, savePointType });
......
......@@ -19,7 +19,8 @@
import { restartTask } from '@/pages/DataStudio/HeaderContainer/service';
import { l } from '@/utils/intl';
import { message, Modal } from 'antd';
import { ErrorMessage, SuccessMessage } from '@/utils/messages';
import { Modal } from 'antd';
export const recoveryCheckPoint = (taskId: number, path: string) => {
Modal.confirm({
......@@ -30,11 +31,11 @@ export const recoveryCheckPoint = (taskId: number, path: string) => {
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
const result = await restartTask(taskId, path);
if (result.code == 0) {
message.success(l('devops.jobinfo.ck.recovery.success'));
const result = await restartTask(taskId, path, l('devops.jobinfo.ck.recovery'));
if (result && result.code == 0) {
SuccessMessage(l('devops.jobinfo.ck.recovery.success'));
} else {
message.error(l('devops.jobinfo.ck.recovery.failed'));
ErrorMessage(l('devops.jobinfo.ck.recovery.failed'));
}
}
});
......
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