Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next';
import { ConfigItem } from '@actiontech/dms-kit';
import { EditInputNumber, LabelContent } from '@actiontech/dms-kit';
import useValidatorNumber from './useValidatorNumber';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/sqle/service/common';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/base/service/common';
import { PERMISSIONS, usePermission } from '@actiontech/shared/lib/features';
export interface CBOperationLogsExpiredHoursProps {
expiredHours: number | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useTranslation } from 'react-i18next';
import { ConfigItem } from '@actiontech/dms-kit';
import { EditInputNumber, LabelContent } from '@actiontech/dms-kit';
import useValidatorNumber from './useValidatorNumber';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/sqle/service/common';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/base/service/common';
import { PERMISSIONS, usePermission } from '@actiontech/shared/lib/features';
export interface OperationRecordExpiredHoursProps {
expiredHours: number | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTranslation } from 'react-i18next';
import { ConfigItem } from '@actiontech/dms-kit';
import { EditInput, LabelContent } from '@actiontech/dms-kit';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/sqle/service/common';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/base/service/common';
import { PERMISSIONS, usePermission } from '@actiontech/shared/lib/features';
export interface UrlAddressPrefixTipsProps {
url: string | undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/page/System/GlobalSetting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useBoolean, useRequest } from 'ahooks';
import useHideConfigInputNode from '@actiontech/dms-kit/es/components/ConfigItem/hooks/useHideConfigInputNode';
import { DmsApi } from '@actiontech/shared/lib/api';
import { ResponseCode, ConfigFieldMapMeta } from '@actiontech/dms-kit';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/sqle/service/common';
import { IUpdateSystemVariablesReqV1 } from '@actiontech/shared/lib/api/base/service/common';
import { Spin } from 'antd';
import SystemBasicTitle from '../components/BasicTitle';
import OperationRecordExpiredHours from './components/OperationRecordExpiredHours';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ exports[`base/router-base-ee render base route data snap 1`] = `
workflowSqlFileStatementOverview
</div>,
"key": "workflowSqlFileStatementOverview",
"path": ":taskId/files/:fileId/sqls",
"path": ":workflowId/task/:taskId/files/:fileId/sqls",
},
],
"element": <div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ exports[`base/router-base-ce render base route data snap 1`] = `
workflowSqlFileStatementOverview
</div>,
"key": "workflowSqlFileStatementOverview",
"path": ":taskId/files/:fileId/sqls",
"path": ":workflowId/task/:taskId/files/:fileId/sqls",
},
],
"element": <div
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/router/test/router.ce.sqle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('base/router-sqle-ce', () => {

it('render SQLFileStatementOverview', async () => {
const { baseElement } = customRender([
`/sqle/project/${projectID}/exec-workflow/123/files/434/sqls`
`/sqle/project/${projectID}/exec-workflow/789/task/123/files/434/sqls`
]);

await act(async () => jest.advanceTimersByTime(300));
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/router/test/router.sqle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('base/router-sqle-ee', () => {

it('render SQLFileStatementOverview', async () => {
const { baseElement } = customRender([
`/sqle/project/${projectID}/exec-workflow/123/files/434/sqls`
`/sqle/project/${projectID}/exec-workflow/789/task/123/files/434/sqls`
]);

await act(async () => jest.advanceTimersByTime(300));
Expand Down
2 changes: 1 addition & 1 deletion packages/dms-kit/src/data/routePaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export const ROUTE_PATHS = {
},
sql_files_overview: {
prefix: '/sqle/project/:projectID/exec-workflow',
path: ':taskId/files/:fileId/sqls',
path: ':workflowId/task/:taskId/files/:fileId/sqls',
query: 'instance_name&schema'
}
},
Expand Down
30 changes: 6 additions & 24 deletions packages/shared/lib/api/sqle/service/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2069,14 +2069,6 @@ export interface IGetSystemModuleRedDotsRes {
message?: string;
}

export interface IGetSystemVariablesResV1 {
code?: number;

data?: ISystemVariablesResV1;

message?: string;
}

export interface IGetTableMetadataResV1 {
code?: number;

Expand Down Expand Up @@ -2740,6 +2732,8 @@ export interface IOptimizationsummary {
}

export interface IOptimizeSQLReq {
db_type?: string;

explain_info?: string;

instance_name?: string;
Expand Down Expand Up @@ -2813,6 +2807,10 @@ export interface IProjectScore {
score?: number;
}

export interface IReExecuteTaskOnWorkflowReq {
exec_sql_ids?: number[];
}

export interface IRecordSource {
name?: RecordSourceNameEnum;

Expand Down Expand Up @@ -3445,14 +3443,6 @@ export interface IStatisticsAuditedSQLResV1 {
risk_rate?: number;
}

export interface ISystemVariablesResV1 {
cb_operation_logs_expired_hours?: number;

operation_record_expired_hours?: number;

url?: string;
}

export interface ITable {
name?: string;
}
Expand Down Expand Up @@ -3853,14 +3843,6 @@ export interface IUpdateStagesInstanceDep {
stage_instance_id?: string;
}

export interface IUpdateSystemVariablesReqV1 {
cb_operation_logs_expired_hours?: number;

operation_record_expired_hours?: number;

url?: string;
}

export interface IUpdateTaskBackupStrategyReq {
strategy?: UpdateTaskBackupStrategyReqStrategyEnum;
}
Expand Down
9 changes: 0 additions & 9 deletions packages/shared/lib/api/sqle/service/configuration/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import {
IGetLicenseResV1,
ICheckLicenseResV1,
ISSHPublicKeyInfoV1Rsp,
IGetSystemVariablesResV1,
IUpdateSystemVariablesReqV1,
IGetWechatAuditConfigurationResV1,
IUpdateWechatConfigurationReqV1,
ITestWechatConfigurationReqV1,
Expand Down Expand Up @@ -87,13 +85,6 @@ export interface IGetSSHPublicKeyReturn extends ISSHPublicKeyInfoV1Rsp {}

export interface IGenSSHPublicKeyReturn extends IBaseRes {}

export interface IGetSystemVariablesV1Return extends IGetSystemVariablesResV1 {}

export interface IUpdateSystemVariablesV1Params
extends IUpdateSystemVariablesReqV1 {}

export interface IUpdateSystemVariablesV1Return extends IBaseRes {}

export interface IGetWechatAuditConfigurationV1Return
extends IGetWechatAuditConfigurationResV1 {}

Expand Down
23 changes: 0 additions & 23 deletions packages/shared/lib/api/sqle/service/configuration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ import {
ICheckSQLELicenseV1Return,
IGetSSHPublicKeyReturn,
IGenSSHPublicKeyReturn,
IGetSystemVariablesV1Return,
IUpdateSystemVariablesV1Params,
IUpdateSystemVariablesV1Return,
IGetWechatAuditConfigurationV1Return,
IUpdateWechatAuditConfigurationV1Params,
IUpdateWechatAuditConfigurationV1Return,
Expand Down Expand Up @@ -233,26 +230,6 @@ class ConfigurationService extends ServiceBase {
);
}

public getSystemVariablesV1(options?: AxiosRequestConfig) {
return this.get<IGetSystemVariablesV1Return>(
'/v1/configurations/system_variables',
undefined,
options
);
}

public updateSystemVariablesV1(
params: IUpdateSystemVariablesV1Params,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
return this.patch<IUpdateSystemVariablesV1Return>(
'/v1/configurations/system_variables',
paramsData,
options
);
}

public getWechatAuditConfigurationV1(options?: AxiosRequestConfig) {
return this.get<IGetWechatAuditConfigurationV1Return>(
'/v1/configurations/wechat_audit',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export interface ISQLOptimizeV2Params extends IOptimizeSQLReq {

schema_name?: string;

db_type?: string;
db_type: string;

optimization_name: string;

Expand Down
12 changes: 12 additions & 0 deletions packages/shared/lib/api/sqle/service/workflow/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
IBackupSqlListRes,
ICreateRollbackWorkflowReq,
ICreateRollbackWorkflowRes,
IReExecuteTaskOnWorkflowReq,
IGetWorkflowResV1,
IUpdateWorkflowReqV1,
IRejectWorkflowReqV1,
Expand Down Expand Up @@ -215,6 +216,17 @@ export interface IGetWorkflowAttachmentParams {
task_id: string;
}

export interface IReExecuteTaskOnWorkflowV1Params
extends IReExecuteTaskOnWorkflowReq {
project_name: string;

workflow_id: string;

task_id: string;
}

export interface IReExecuteTaskOnWorkflowV1Return extends IBaseRes {}

export interface ITerminateSingleTaskByWorkflowV1Params {
workflow_id: string;

Expand Down
23 changes: 23 additions & 0 deletions packages/shared/lib/api/sqle/service/workflow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {
ITerminateMultipleTaskByWorkflowV1Params,
ITerminateMultipleTaskByWorkflowV1Return,
IGetWorkflowAttachmentParams,
IReExecuteTaskOnWorkflowV1Params,
IReExecuteTaskOnWorkflowV1Return,
ITerminateSingleTaskByWorkflowV1Params,
ITerminateSingleTaskByWorkflowV1Return,
IGetWorkflowV1Params,
Expand Down Expand Up @@ -299,6 +301,27 @@ class WorkflowService extends ServiceBase {
);
}

public reExecuteTaskOnWorkflowV1(
params: IReExecuteTaskOnWorkflowV1Params,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
const project_name = paramsData.project_name;
delete paramsData.project_name;

const workflow_id = paramsData.workflow_id;
delete paramsData.workflow_id;

const task_id = paramsData.task_id;
delete paramsData.task_id;

return this.post<IReExecuteTaskOnWorkflowV1Return>(
`/v1/projects/${project_name}/workflows/${workflow_id}/tasks/${task_id}/re_execute`,
paramsData,
options
);
}

public terminateSingleTaskByWorkflowV1(
params: ITerminateSingleTaskByWorkflowV1Params,
options?: AxiosRequestConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class MockWorkflowApi implements MockSpyApy {
this.createRollbackWorkflow();
this.updateTaskBackupStrategy();
this.getBackupSqlList();
this.reExecuteTaskOnWorkflow();
}

public getWorkflows() {
Expand Down Expand Up @@ -349,6 +350,12 @@ VALUES ('1234567890', '[email protected]', '123456789012345678', '9876543210', '
);
return spy;
}

public reExecuteTaskOnWorkflow() {
const spy = jest.spyOn(workflow, 'reExecuteTaskOnWorkflowV1');
spy.mockImplementation(() => createSpySuccessResponse({}));
return spy;
}
}

export default new MockWorkflowApi();
4 changes: 3 additions & 1 deletion packages/sqle/src/data/EmitterKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ enum EmitterKey {
Refresh_Sql_Exec_workflow_Audit_Result_List = 'Refresh_Sql_Exec_workflow_Audit_Result_List',

Refresh_Sql_Audit_List = 'Refresh_Sql_Audit_List',
Refresh_Sql_Optimization_List = 'Refresh_Sql_Optimization_List'
Refresh_Sql_Optimization_List = 'Refresh_Sql_Optimization_List',

Sql_Retry_Execute_Done = 'Sql_Retry_Execute_Done'
}

export default EmitterKey;
5 changes: 4 additions & 1 deletion packages/sqle/src/data/ModalName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@ export enum ModalName {
Sql_Optimization_Result_Modal = 'SQL_OPTIMIZATION_RESULT_MODAL',
Sql_Optimization_Query_Plan_Flow_Modal = 'SQL_OPTIMIZATION_QUERY_PLAN_FLOW_MODAL',
Sql_Optimization_Query_Plan_Diff_Modal = 'SQL_OPTIMIZATION_QUERY_PLAN_DIFF_MODAL',
Sql_Optimization_Result_Drawer = 'SQL_OPTIMIZATION_RESULT_DRAWER'
Sql_Optimization_Result_Drawer = 'SQL_OPTIMIZATION_RESULT_DRAWER',

// sql exec workflow
Sql_Exec_Workflow_Retry_Execute_Modal = 'SQL_EXEC_WORKFLOW_RETRY_EXECUTE_MODAL'
}
7 changes: 6 additions & 1 deletion packages/sqle/src/locale/zh-CN/execWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ export default {
cancelExecScheduled: '取消定时上线',
cancelExecScheduledTips: '取消定时上线成功',
sqlExecuteConfirmTips:
'当前操作将立即执行该数据源上的SQL语句, 是否确认立即上线'
'当前操作将立即执行该数据源上的SQL语句, 是否确认立即上线',
retryExecute: '再次执行',
retryExecuteSuccess: '再次执行成功',
pleaseSelectSql: '请选择需要再次执行的SQL',
selectRetryExecuteSqlDesc: '已执行成功的SQL无法再次执行',
selectRetryExecuteSql: '选择再次执行的SQL'
}
},
taskResult: {},
Expand Down
Loading