Skip to content

Commit e5e2317

Browse files
authored
Merge pull request #389 from actiontech/feature/sqle-issue-2527
Feature/sqle issue 2539
2 parents 15f61ed + 9a24749 commit e5e2317

File tree

37 files changed

+21636
-27111
lines changed

37 files changed

+21636
-27111
lines changed

packages/shared/lib/api/sqle/service/SqlManage/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
GetSqlManageListFilterStatusEnum,
55
GetSqlManageListSortFieldEnum,
66
GetSqlManageListSortOrderEnum,
7+
exportSqlManageV1FilterPriorityEnum,
78
exportSqlManageV1FilterSourceEnum,
89
exportSqlManageV1FilterAuditLevelEnum,
910
exportSqlManageV1FilterStatusEnum,
@@ -12,6 +13,7 @@ import {
1213
GetSqlManageListV2FilterSourceEnum,
1314
GetSqlManageListV2FilterAuditLevelEnum,
1415
GetSqlManageListV2FilterStatusEnum,
16+
GetSqlManageListV2FilterPriorityEnum,
1517
GetSqlManageListV2SortFieldEnum,
1618
GetSqlManageListV2SortOrderEnum
1719
} from './index.enum';
@@ -77,6 +79,8 @@ export interface IExportSqlManageV1Params {
7779

7880
filter_business?: string;
7981

82+
filter_priority?: exportSqlManageV1FilterPriorityEnum;
83+
8084
filter_instance_id?: string;
8185

8286
filter_source?: exportSqlManageV1FilterSourceEnum;
@@ -143,6 +147,8 @@ export interface IGetSqlManageListV2Params {
143147

144148
filter_business?: string;
145149

150+
filter_priority?: GetSqlManageListV2FilterPriorityEnum;
151+
146152
fuzzy_search_endpoint?: string;
147153

148154
fuzzy_search_schema_name?: string;

packages/shared/lib/api/sqle/service/SqlManage/index.enum.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ export enum GetSqlManageListSortOrderEnum {
4040
'desc' = 'desc'
4141
}
4242

43+
export enum exportSqlManageV1FilterPriorityEnum {
44+
'high' = 'high',
45+
46+
'low' = 'low'
47+
}
48+
4349
export enum exportSqlManageV1FilterSourceEnum {
4450
'audit_plan' = 'audit_plan',
4551

@@ -106,6 +112,12 @@ export enum GetSqlManageListV2FilterStatusEnum {
106112
'manual_audited' = 'manual_audited'
107113
}
108114

115+
export enum GetSqlManageListV2FilterPriorityEnum {
116+
'high' = 'high',
117+
118+
'low' = 'low'
119+
}
120+
109121
export enum GetSqlManageListV2SortFieldEnum {
110122
'first_appear_timestamp' = 'first_appear_timestamp',
111123

packages/shared/lib/api/sqle/service/common.d.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import {
1818
FilterMetaFilterInputTypeEnum,
1919
FilterMetaFilterOpTypeEnum,
2020
GetWorkflowTasksItemV1StatusEnum,
21+
HighPriorityConditionTypeEnum,
22+
HighPriorityConditionReqOperatorEnum,
2123
InstanceAuditPlanInfoActiveStatusEnum,
2224
InstanceAuditPlanResV1ActiveStatusEnum,
2325
OperationRecordListStatusEnum,
@@ -85,6 +87,10 @@ export interface IAuditPlan {
8587

8688
audit_plan_type?: string;
8789

90+
high_priority_conditions?: IHighPriorityConditionReq[];
91+
92+
need_mark_high_priority_sql?: boolean;
93+
8894
rule_template_name?: string;
8995
}
9096

@@ -103,6 +109,8 @@ export interface IAuditPlanMetaV1 {
103109

104110
audit_plan_type_desc?: string;
105111

112+
high_priority_conditions?: IHighPriorityCondition[];
113+
106114
instance_type?: string;
107115
}
108116

@@ -149,6 +157,10 @@ export interface IAuditPlanRes {
149157

150158
audit_plan_type?: IAuditPlanTypeResBase;
151159

160+
high_priority_conditions?: IHighPriorityCondition[];
161+
162+
need_mark_high_priority_sql?: boolean;
163+
152164
rule_template_name?: string;
153165
}
154166

@@ -1524,6 +1536,28 @@ export interface IGetWorkflowsResV1 {
15241536
total_nums?: number;
15251537
}
15261538

1539+
export interface IHighPriorityCondition {
1540+
desc?: string;
1541+
1542+
enums_value?: IEnumsValue[];
1543+
1544+
key?: string;
1545+
1546+
operator?: IOperator;
1547+
1548+
type?: HighPriorityConditionTypeEnum;
1549+
1550+
value?: string;
1551+
}
1552+
1553+
export interface IHighPriorityConditionReq {
1554+
key?: string;
1555+
1556+
operator?: HighPriorityConditionReqOperatorEnum;
1557+
1558+
value?: string;
1559+
}
1560+
15271561
export interface IInstanceAdditionalParamResV1 {
15281562
description?: string;
15291563

@@ -1742,6 +1776,12 @@ export interface IOperationUser {
17421776
user_name?: string;
17431777
}
17441778

1779+
export interface IOperator {
1780+
operator_enums_value?: IEnumsValue[];
1781+
1782+
operator_value?: string;
1783+
}
1784+
17451785
export interface IOptimizationDetail {
17461786
basic_summary?: IOptimizationsummary;
17471787

packages/shared/lib/api/sqle/service/common.enum.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,24 @@ export enum GetWorkflowTasksItemV1StatusEnum {
180180
'manually_executed' = 'manually_executed'
181181
}
182182

183+
export enum HighPriorityConditionTypeEnum {
184+
'string' = 'string',
185+
186+
'int' = 'int',
187+
188+
'bool' = 'bool',
189+
190+
'password' = 'password'
191+
}
192+
193+
export enum HighPriorityConditionReqOperatorEnum {
194+
'>' = '>',
195+
196+
'=' = '=',
197+
198+
'<' = '<'
199+
}
200+
183201
export enum InstanceAuditPlanInfoActiveStatusEnum {
184202
'normal' = 'normal',
185203

packages/sqle/src/locale/zh-CN/managementConf.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ export default {
7070

7171
scanTypeParams: {
7272
title: '编辑扫描详情·{{typeName}}',
73+
hightPriorityConditions: {
74+
mark: '标记高优先级SQL',
75+
standard: '标准',
76+
threshold: '阈值',
77+
operator: '运算符'
78+
},
7379
auditTemplate: {
7480
ruleTemplate: {
7581
label: '审核规则模版',

packages/sqle/src/locale/zh-CN/sqlManagement.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ export default {
4545
SQLFingerprint: 'SQL指纹',
4646
source: '来源',
4747
instanceName: '数据源',
48+
priority: '优先级',
49+
highPriority: '高优先',
50+
lowPriority: '低优先',
4851
auditResult: '审核结果',
4952
firstOccurrence: '初次出现时间',
5053
lastOccurrence: '最后一次出现时间',
@@ -78,6 +81,7 @@ export default {
7881
notice: '提示'
7982
},
8083
assignee: '与我相关',
84+
viewHighPrioritySql: '查看高优先级SQL',
8185
rule: '审核规则'
8286
},
8387
statusReport: {

packages/sqle/src/page/SqlManagement/__snapshots__/index.test.tsx.snap

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,19 @@ exports[`page/SqlManagement render sql management page 1`] = `
285285
<div
286286
class="ant-space css-dev-only-do-not-override-1kh50jg ant-space-horizontal ant-space-align-center"
287287
>
288+
<div
289+
class="ant-space-item"
290+
style="margin-right: 8px;"
291+
>
292+
<button
293+
class="ant-btn css-dev-only-do-not-override-czn7jp ant-btn-default ant-btn-sm actiontech-table-actions-button switch-btn-default basic-button-wrapper css-geipcv"
294+
type="button"
295+
>
296+
<span>
297+
查看高优先级SQL
298+
</span>
299+
</button>
300+
</div>
288301
<div
289302
class="ant-space-item"
290303
style="margin-right: 8px;"
@@ -459,6 +472,7 @@ exports[`page/SqlManagement render sql management page 1`] = `
459472
/>
460473
<col />
461474
<col />
475+
<col />
462476
<col
463477
style="width: 200px;"
464478
/>
@@ -535,6 +549,12 @@ exports[`page/SqlManagement render sql management page 1`] = `
535549
>
536550
Schema
537551
</th>
552+
<th
553+
class="ant-table-cell"
554+
scope="col"
555+
>
556+
优先级
557+
</th>
538558
<th
539559
class="ant-table-cell"
540560
scope="col"
@@ -684,13 +704,22 @@ exports[`page/SqlManagement render sql management page 1`] = `
684704
 
685705
</div>
686706
</td>
707+
<td
708+
style="padding: 0px; border: 0px; height: 0px;"
709+
>
710+
<div
711+
style="height: 0px; overflow: hidden;"
712+
>
713+
 
714+
</div>
715+
</td>
687716
</tr>
688717
<tr
689718
class="ant-table-placeholder"
690719
>
691720
<td
692721
class="ant-table-cell"
693-
colspan="12"
722+
colspan="13"
694723
>
695724
<div
696725
class="ant-table-expanded-row-fixed"

0 commit comments

Comments
 (0)