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 @@ -110,7 +110,7 @@ exports[`base/Nav/SideMenu/UserMenu/BasicVersionModal render snap when open is t
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-error-p0p1 93c9fa7e2
dev-zjrc-sql-audit-report-summary f4fab7b02
</article>
</div>
<div
Expand Down Expand Up @@ -345,7 +345,7 @@ exports[`base/Nav/SideMenu/UserMenu/BasicVersionModal render snap when open is t
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-error-p0p1 93c9fa7e2
dev-zjrc-sql-audit-report-summary f4fab7b02
</article>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ce render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-error-p0p1 93c9fa7e2
dev-zjrc-sql-audit-report-summary f4fab7b02
</article>
</div>
<div
Expand Down Expand Up @@ -1312,7 +1312,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ce render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-error-p0p1 93c9fa7e2
dev-zjrc-sql-audit-report-summary f4fab7b02
</article>
</div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ee render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-error-p0p1 93c9fa7e2
dev-zjrc-sql-audit-report-summary f4fab7b02
</article>
</div>
<div
Expand Down Expand Up @@ -352,7 +352,7 @@ exports[`base/Nav/SideMenu/UserMenu/VersionModal-ee render snap when open is tru
class="ant-typography css-dev-only-do-not-override-txh9fw"
>
UI:
dev-zjrc-error-p0p1 93c9fa7e2
dev-zjrc-sql-audit-report-summary f4fab7b02
</article>
</div>
<div
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/scripts/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const UI_VERSION = 'dev-zjrc-error-p0p1 93c9fa7e2';
export const UI_VERSION = 'dev-zjrc-sql-audit-report-summary f4fab7b02';
46 changes: 46 additions & 0 deletions packages/shared/lib/api/sqle/service/common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,52 @@ export interface IGetAuditTaskResV1 {
message?: string;
}

/** 任务级审核汇总 · level_summary(S2) */
export interface IAuditLevelSummary {
error_count?: number;

error_p0_count?: number;

error_p1_count?: number;

warn_count?: number;

notice_count?: number;

normal_count?: number;

sql_count?: number;
}

/** 任务级审核汇总 · rule_hit_details 单项(S3) */
export interface IAuditRuleHitDetail {
rule_name?: string;

level?: string;

error_priority?: string;

hit_count?: number;

message?: string;

sql_numbers?: number[];
}

export interface IAuditTaskSummaryResData {
level_summary?: IAuditLevelSummary;

rule_hit_details?: IAuditRuleHitDetail[];
}

export interface IGetAuditTaskSummaryResV1 {
code?: number;

data?: IAuditTaskSummaryResData;

message?: string;
}

export interface IGetAuditTaskSQLContentResV1 {
code?: number;

Expand Down
8 changes: 8 additions & 0 deletions packages/shared/lib/api/sqle/service/task/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ICreateAuditTasksGroupResV1,
ICreateAuditTaskReqV1,
IGetAuditTaskResV1,
IGetAuditTaskSummaryResV1,
IUpdateSqlFileOrderV1Req,
IGetSqlFileOrderMethodResV1,
IAuditTaskGroupResV1,
Expand Down Expand Up @@ -88,6 +89,13 @@ export interface IGetAuditTaskV1Params {

export interface IGetAuditTaskV1Return extends IGetAuditTaskResV1 {}

export interface IGetAuditTaskSummaryV1Params {
task_id: string;
}

export interface IGetAuditTaskSummaryV1Return
extends IGetAuditTaskSummaryResV1 {}

export interface IDownloadAuditFileParams {
task_id: string;
}
Expand Down
17 changes: 17 additions & 0 deletions packages/shared/lib/api/sqle/service/task/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {
IAuditTaskGroupIdV1Return,
IGetAuditTaskV1Params,
IGetAuditTaskV1Return,
IGetAuditTaskSummaryV1Params,
IGetAuditTaskSummaryV1Return,
IDownloadAuditFileParams,
IDownloadAuditFileReturn,
IGetAuditTaskSQLContentV1Params,
Expand Down Expand Up @@ -198,6 +200,21 @@ class TaskService extends ServiceBase {
);
}

public getAuditTaskSummaryV1(
params: IGetAuditTaskSummaryV1Params,
options?: AxiosRequestConfig
) {
const paramsData = this.cloneDeep(params);
const task_id = paramsData.task_id;
delete paramsData.task_id;

return this.get<IGetAuditTaskSummaryV1Return>(
`/v1/tasks/audits/${task_id}/audit_summary`,
paramsData,
options
);
}

public DownloadAuditFile(
params: IDownloadAuditFileParams,
options?: AxiosRequestConfig
Expand Down
36 changes: 35 additions & 1 deletion packages/sqle/src/locale/en-US/sqlAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,41 @@ export default {
download: 'Download audit result',
auditID: 'Audit ID',
auditRating: 'Audit rating',
auditPassRate: 'Audit pass rate'
auditPassRate: 'Audit pass rate',
sourceHeader: {
instanceName: 'Data source',
address: 'Address',
instanceDbType: 'Instance type',
instanceSchema: 'Schema',
sqlSource: 'SQL source',
sourceFiles: 'Source files',
sqlSourceEnum: {
form_data: 'Form',
sql_file: 'SQL file',
mybatis_xml_file: 'MyBatis',
zip_file: 'ZIP',
git_repository: 'GIT'
}
},
levelHitSummary: {
title: 'Level hit summary',
sqlCount: 'SQL count',
loading: 'Loading…',
loadFailed: 'Failed to load level hit summary'
},
ruleHitDetails: {
title: 'Rule hit details',
empty: 'No rule hits',
loading: 'Loading…',
loadFailed: 'Failed to load rule hit details',
columns: {
rule: 'Rule',
level: 'Level',
hitCount: 'Hit count',
message: 'Description',
sqlNumbers: 'Related SQL'
}
}
},
create: {
title: 'Create SQL audit',
Expand Down
36 changes: 35 additions & 1 deletion packages/sqle/src/locale/zh-CN/sqlAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,41 @@ export default {
download: '下载审核结果',
auditID: '审核ID',
auditRating: '审核评分',
auditPassRate: '审核通过率'
auditPassRate: '审核通过率',
sourceHeader: {
instanceName: '数据源',
address: '地址',
instanceDbType: '实例类型',
instanceSchema: 'Schema',
sqlSource: 'SQL 来源',
sourceFiles: '来源文件',
sqlSourceEnum: {
form_data: '表单',
sql_file: 'SQL 文件',
mybatis_xml_file: 'MyBatis',
zip_file: 'ZIP',
git_repository: 'GIT'
}
},
levelHitSummary: {
title: '等级命中数',
sqlCount: 'SQL 条数',
loading: '加载中…',
loadFailed: '等级命中数加载失败'
},
ruleHitDetails: {
title: '命中规则细则',
empty: '暂无规则命中',
loading: '加载中…',
loadFailed: '规则命中细则加载失败',
columns: {
rule: '规则',
level: '等级',
hitCount: '命中次数',
message: '说明',
sqlNumbers: '涉及 SQL'
}
}
},
create: {
title: '创建SQL审核',
Expand Down
Loading
Loading