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
22 changes: 22 additions & 0 deletions packages/shared/lib/api/sqle/service/SqlDEVRecord/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export interface IGetSqlDEVRecordListParams {

filter_instance_name?: string;

filter_db_type?: string;

filter_source?: GetSqlDEVRecordListFilterSourceEnum;

filter_creator?: string;
Expand All @@ -31,3 +33,23 @@ export interface IGetSqlDEVRecordListParams {
}

export interface IGetSqlDEVRecordListReturn extends IGetSqlDEVRecordListResp {}

export interface IExportSqlDEVRecordParams {
project_name: string;

fuzzy_search_sql_fingerprint?: string;

filter_instance_name?: string;

filter_db_type?: string;

filter_source?: GetSqlDEVRecordListFilterSourceEnum;

filter_creator?: string;

filter_last_receive_time_from?: string;

filter_last_receive_time_to?: string;

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

import {
IExportSqlDEVRecordParams,
IGetSqlDEVRecordListParams,
IGetSqlDEVRecordListReturn
} from './index.d';
Expand All @@ -26,6 +27,21 @@ class SqlDEVRecordService extends ServiceBase {
options
);
}

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

return this.get<any>(
`/v1/projects/${project_name}/sql_dev_records/exports`,
paramsData,
options
);
}
}

export default new SqlDEVRecordService();
2 changes: 2 additions & 0 deletions packages/shared/lib/api/sqle/service/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,8 @@ export interface ISqlAverageExecutionTime {
export interface ISqlDEVRecord {
audit_result?: IAuditResult[];

db_type?: string;

creator?: string;

first_appear_timestamp?: string;
Expand Down
7 changes: 6 additions & 1 deletion packages/sqle/src/locale/en-US/pluginAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ export default {
sqlFingerprint: 'SQL fingerprint',
source: 'DB instance',
schema: 'Schema',
dbType: 'Database type',
result: 'Audit result',
count: 'Occurrences',
firstAppearTime: 'First appearance time',
lastReceiveTime: 'Last appearance time',
creator: 'Creator',
createWhitelist: 'Add to SQL management whitelist'
createWhitelist: 'Add to SQL management whitelist',
exportReport: 'Export report',
exporting: 'Exporting file',
exportSuccessTips: 'Export file successfully',
exportFailedTips: 'Export file failed'
},
drawerTitle: 'IDE audit result'
};
7 changes: 6 additions & 1 deletion packages/sqle/src/locale/zh-CN/pluginAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ export default {
sqlFingerprint: 'SQL指纹',
source: '数据源',
schema: 'Schema',
dbType: '数据库类型',
result: '审核结果',
count: '出现次数',
firstAppearTime: '最早出现时间',
lastReceiveTime: '最近一次出现时间',
creator: '创建人',
createWhitelist: '添加为审核SQL例外'
createWhitelist: '添加为审核SQL例外',
exportReport: '导出报表',
exporting: '正在导出文件',
exportSuccessTips: '导出文件成功',
exportFailedTips: '导出文件失败'
},
drawerTitle: 'IDE审核结果'
};
Loading
Loading