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
6 changes: 3 additions & 3 deletions packages/base/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ export default defineConfig(() => {
open: true,
proxy: {
'^(/v|/sqle/v)': {
target: 'http://10.186.62.13:11000/'
target: 'http://10.186.58.166:10003/'
},
'^/provision/v': {
target: 'http://10.186.62.13:11000/'
target: 'http://10.186.58.166:10003/'
},
'^/logo': {
target: 'http://10.186.62.13:11000/'
target: 'http://10.186.58.166:10003/'
}
},
cors: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ListDataExportWorkflowsFilterByStatusEnum } from './index.enum';
import {
ListAllDataExportWorkflowsFilterByStatusEnum,
ListDataExportWorkflowsFilterByStatusEnum
} from './index.enum';

import {
IListDataExportWorkflowsReply,
Expand All @@ -10,6 +13,31 @@ import {
IRejectDataExportWorkflowReq
} from '../common.d';

export interface IListAllDataExportWorkflowsParams {
project_uid: string;

page_size: number;

page_index?: number;

filter_by_status?: ListAllDataExportWorkflowsFilterByStatusEnum;

filter_by_create_user_uid?: string;

filter_current_step_assignee_user_uid?: string;

filter_by_db_service_uid?: string;

filter_create_time_from?: string;

filter_create_time_to?: string;

fuzzy_keyword?: string;
}

export interface IListAllDataExportWorkflowsReturn
extends IListDataExportWorkflowsReply {}

export interface IListDataExportWorkflowsParams {
project_uid: string;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
/* tslint:disable no-duplicate-string */

export enum ListAllDataExportWorkflowsFilterByStatusEnum {
'wait_for_approve' = 'wait_for_approve',

'wait_for_export' = 'wait_for_export',

'exporting' = 'exporting',

'rejected' = 'rejected',

'cancel' = 'cancel',

'failed' = 'failed',

'finish' = 'finish'
}

export enum ListDataExportWorkflowsFilterByStatusEnum {
'wait_for_approve' = 'wait_for_approve',

Expand Down
14 changes: 14 additions & 0 deletions packages/shared/lib/api/base/service/DataExportWorkflows/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import ServiceBase from '../Service.base';
import { AxiosRequestConfig } from 'axios';

import {
IListAllDataExportWorkflowsParams,
IListAllDataExportWorkflowsReturn,
IListDataExportWorkflowsParams,
IListDataExportWorkflowsReturn,
IAddDataExportWorkflowParams,
Expand All @@ -24,6 +26,18 @@ import {
} from './index.d';

class DataExportWorkflowsService extends ServiceBase {
public ListAllDataExportWorkflows(
params: IListAllDataExportWorkflowsParams,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
return this.get<IListAllDataExportWorkflowsReturn>(
'/v1/dms/projects/data_export_workflows',
paramsData,
options
);
}

public ListDataExportWorkflows(
params: IListDataExportWorkflowsParams,
options?: AxiosRequestConfig
Expand Down
6 changes: 6 additions & 0 deletions packages/shared/lib/api/base/service/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,8 @@ export interface IListDataExportWorkflow {

exported_at?: string;

project_name?: string;

project_uid?: string;

status?: ListDataExportWorkflowStatusEnum;
Expand Down Expand Up @@ -1787,6 +1789,10 @@ export interface IListMemberReply {
}

export interface IListMemberRoleWithOpRange {
member_group?: IProjectMemberGroup;

op_permissions?: IUidWithName[];

op_range_type?: ListMemberRoleWithOpRangeOpRangeTypeEnum;

range_uids?: IUidWithName[];
Expand Down
14 changes: 13 additions & 1 deletion packages/shared/lib/api/sqle/service/common.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,17 +727,29 @@ export enum WorkflowDetailResV1CurrentStepTypeEnum {
export enum WorkflowDetailResV1StatusEnum {
'wait_for_audit' = 'wait_for_audit',

'wait_for_approve' = 'wait_for_approve',

'wait_for_execution' = 'wait_for_execution',

'wait_for_export' = 'wait_for_export',

'rejected' = 'rejected',

'canceled' = 'canceled',

'cancel' = 'cancel',

'exec_failed' = 'exec_failed',

'failed' = 'failed',

'executing' = 'executing',

'finished' = 'finished'
'exporting' = 'exporting',

'finished' = 'finished',

'finish' = 'finish'
}

export enum WorkflowDetailWithInstanceStatusEnum {
Expand Down
38 changes: 38 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 @@ -33,6 +33,10 @@ import {
} from '../common.d';

import {
getGlobalDataExportWorkflowsV1FilterStatusListEnum,
getGlobalDataExportWorkflowsV1FilterProjectPriorityEnum,
getGlobalDataExportWorkflowStatisticsV1FilterStatusListEnum,
getGlobalDataExportWorkflowStatisticsV1FilterProjectPriorityEnum,
getGlobalWorkflowsV1FilterStatusListEnum,
getGlobalWorkflowsV1FilterProjectPriorityEnum,
GetGlobalWorkflowStatisticsFilterStatusListEnum,
Expand All @@ -45,6 +49,40 @@ import {
export interface IGetScheduledTaskDefaultOptionV1Return
extends IScheduledTaskDefaultOptionV1Rsp {}

export interface IGetGlobalDataExportWorkflowsV1Params {
filter_create_user_id?: string;

filter_status_list?: getGlobalDataExportWorkflowsV1FilterStatusListEnum[];

filter_project_uid?: string;

filter_instance_id?: string;

filter_project_priority?: getGlobalDataExportWorkflowsV1FilterProjectPriorityEnum;

page_index: number;

page_size: number;
}

export interface IGetGlobalDataExportWorkflowsV1Return
extends IGetWorkflowsResV1 {}

export interface IGetGlobalDataExportWorkflowStatisticsV1Params {
filter_create_user_id?: string;

filter_status_list?: getGlobalDataExportWorkflowStatisticsV1FilterStatusListEnum[];

filter_project_uid?: string;

filter_instance_id?: string;

filter_project_priority?: getGlobalDataExportWorkflowStatisticsV1FilterProjectPriorityEnum;
}

export interface IGetGlobalDataExportWorkflowStatisticsV1Return
extends IGlobalWorkflowStatisticsResV1 {}

export interface IGetGlobalWorkflowsV1Params {
filter_create_user_id?: string;

Expand Down
48 changes: 48 additions & 0 deletions packages/shared/lib/api/sqle/service/workflow/index.enum.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
/* tslint:disable no-duplicate-string */

export enum getGlobalDataExportWorkflowsV1FilterStatusListEnum {
'wait_for_approve' = 'wait_for_approve',

'wait_for_export' = 'wait_for_export',

'exporting' = 'exporting',

'failed' = 'failed',

'rejected' = 'rejected',

'cancel' = 'cancel',

'finish' = 'finish'
}

export enum getGlobalDataExportWorkflowsV1FilterProjectPriorityEnum {
'high' = 'high',

'medium' = 'medium',

'low' = 'low'
}

export enum getGlobalDataExportWorkflowStatisticsV1FilterStatusListEnum {
'wait_for_approve' = 'wait_for_approve',

'wait_for_export' = 'wait_for_export',

'exporting' = 'exporting',

'failed' = 'failed',

'rejected' = 'rejected',

'cancel' = 'cancel',

'finish' = 'finish'
}

export enum getGlobalDataExportWorkflowStatisticsV1FilterProjectPriorityEnum {
'high' = 'high',

'medium' = 'medium',

'low' = 'low'
}

export enum getGlobalWorkflowsV1FilterStatusListEnum {
'wait_for_audit' = 'wait_for_audit',

Expand Down
28 changes: 28 additions & 0 deletions packages/shared/lib/api/sqle/service/workflow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { AxiosRequestConfig } from 'axios';

import {
IGetScheduledTaskDefaultOptionV1Return,
IGetGlobalDataExportWorkflowsV1Params,
IGetGlobalDataExportWorkflowsV1Return,
IGetGlobalDataExportWorkflowStatisticsV1Params,
IGetGlobalDataExportWorkflowStatisticsV1Return,
IGetGlobalWorkflowsV1Params,
IGetGlobalWorkflowsV1Return,
IGetGlobalWorkflowStatisticsParams,
Expand Down Expand Up @@ -97,6 +101,30 @@ class WorkflowService extends ServiceBase {
);
}

public getGlobalDataExportWorkflowsV1(
params: IGetGlobalDataExportWorkflowsV1Params,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
return this.get<IGetGlobalDataExportWorkflowsV1Return>(
'/v1/dashboard/data_export_workflows',
paramsData,
options
);
}

public getGlobalDataExportWorkflowStatisticsV1(
params: IGetGlobalDataExportWorkflowStatisticsV1Params,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
return this.get<IGetGlobalDataExportWorkflowStatisticsV1Return>(
'/v1/dashboard/data_export_workflows/statistics',
paramsData,
options
);
}

public getGlobalWorkflowsV1(
params: IGetGlobalWorkflowsV1Params,
options?: AxiosRequestConfig
Expand Down
42 changes: 41 additions & 1 deletion packages/shared/lib/testUtil/mockApi/sqle/execWorkflow/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
IAuditTaskResV1,
IGetWorkflowTasksItemV2,
IWorkflowResV2,
IBackupSqlData
IBackupSqlData,
IWorkflowDetailResV1
} from '../../../../api/sqle/service/common';
import {
AuditTaskResV1AuditLevelEnum,
Expand Down Expand Up @@ -565,3 +566,42 @@ export const mockRollbackSqlData: IBackupSqlData[] = [
origin_sql: 'SELECT 2;'
}
];

export const mockGlobalDataExportWorkflowListData: IWorkflowDetailResV1[] = [
{
create_time: '2023-12-25 15:04:11',
create_user_name: 'admin',
current_step_assignee_user_name_list: ['test_user'],
desc: 'test desc',
instance_info: [
{
instance_id: '1739531854064652288',
instance_name: 'mysql-1'
}
],
project_name: 'default',
project_uid: '700300',
sql_version_name: ['v1'],
status: WorkflowDetailResV1StatusEnum.rejected,
workflow_id: '1739531854064652288',
workflow_name: 'test'
},
{
create_time: '2023-12-25 15:04:11',
create_user_name: 'admin',
current_step_assignee_user_name_list: ['test_user'],
desc: 'test desc',
instance_info: [
{
instance_id: '1739531854064652288',
instance_name: 'mysql-1'
}
],
project_name: 'test_project',
project_uid: '700301',
sql_version_name: ['v1'],
status: WorkflowDetailResV1StatusEnum.exporting,
workflow_id: '1739531854064652289',
workflow_name: 'test2'
}
];
Loading