Skip to content

Commit 99d2ecb

Browse files
authored
Merge pull request #769 from actiontech/feature/sqle-ee-issue-2586
feat(workbench): Enable navigation to SQL order details from workbench
2 parents 049eb69 + fb4c275 commit 99d2ecb

File tree

25 files changed

+776
-88
lines changed

25 files changed

+776
-88
lines changed

packages/base/src/locale/en-US/dmsDataSource.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export default {
6060
'If you do not enable the SQL audit service, the DB instance cannot be used in SQL audit related services, are you sure to close it?',
6161
needAuditForSqlQuery: 'Whether SQL query needs audit',
6262
allowQueryWhenLessThanAuditLevel: 'Highest audit level for running queries',
63+
allowExecuteNonDqlInWorkflow:
64+
'Allow executing non-DQL SQL via workflow in SQL workbench',
65+
allowExecuteNonDqlInWorkflowTips:
66+
'When enabled, allows executing non-DQL SQL statements via workflow in SQL workbench',
6367
passwordTips:
6468
'The current DB instance password you have configured will not be displayed here. if you do not fill in the password when submitting, the DB instance password will not be changed.',
6569
needUpdatePassword: 'Update password',

packages/base/src/locale/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ const initReactI18n = () => {
6161
[SupportLanguage.zhCN]: allZhCN,
6262
[SupportLanguage.enUS]: allEnUS
6363
},
64-
// #if [DEV]
65-
debug: true,
66-
// #endif
6764
lng: LocalStorageWrapper.getOrDefault(
6865
StorageKey.Language,
6966
DEFAULT_LANGUAGE

packages/base/src/locale/zh-CN/dmsCloudBeaver.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default {
2626
operationTime: '操作时间',
2727
service: '数据源',
2828
operationDetail: '操作详情',
29+
relatedWorkflow: '关联工单',
2930
sessionId: '会话ID',
3031
operationIP: '操作IP',
3132
auditResult: '审核结果',

packages/base/src/locale/zh-CN/dmsDataSource.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ export default {
8181
allowQueryWhenLessThanAuditLevel: '自动放行的最高审核等级',
8282
allowQueryWhenLessThanAuditLevelTips:
8383
'低于或等于此等级的审核结果将自动放行',
84+
allowExecuteNonDqlInWorkflow: '通过工单上线执行工作台非DQL类型SQL',
85+
allowExecuteNonDqlInWorkflowTips:
86+
'开启后,允许通过工单上线执行工作台非DQL类型的SQL语句',
8487
dataExportAuditRuleTemplate: '数据导出审核规则模板',
8588
dataExportAuditRuleTemplateTips:
8689
'此功能强制开启审核,请为数据导出选择规则模板',

packages/base/src/page/CloudBeaver/List/__snapshots__/index.test.tsx.snap

Lines changed: 89 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
599599
<col />
600600
<col />
601601
<col />
602+
<col />
602603
<col
603604
style="width: 82px;"
604605
/>
@@ -631,6 +632,12 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
631632
>
632633
操作详情
633634
</th>
635+
<th
636+
class="ant-table-cell"
637+
scope="col"
638+
>
639+
关联工单
640+
</th>
634641
<th
635642
class="ant-table-cell ellipsis-column-width"
636643
scope="col"
@@ -783,6 +790,15 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
783790
 
784791
</div>
785792
</td>
793+
<td
794+
style="padding: 0px; border: 0px; height: 0px;"
795+
>
796+
<div
797+
style="height: 0px; overflow: hidden;"
798+
>
799+
 
800+
</div>
801+
</td>
786802
</tr>
787803
<tr
788804
class="ant-table-row ant-table-row-level-0"
@@ -869,6 +885,11 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
869885
</div>
870886
</div>
871887
</td>
888+
<td
889+
class="ant-table-cell"
890+
>
891+
-
892+
</td>
872893
<td
873894
class="ant-table-cell ellipsis-column-width"
874895
>
@@ -1175,6 +1196,11 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
11751196
</div>
11761197
</div>
11771198
</td>
1199+
<td
1200+
class="ant-table-cell"
1201+
>
1202+
-
1203+
</td>
11781204
<td
11791205
class="ant-table-cell ellipsis-column-width"
11801206
>
@@ -1436,6 +1462,11 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
14361462
>
14371463
success
14381464
</td>
1465+
<td
1466+
class="ant-table-cell"
1467+
>
1468+
-
1469+
</td>
14391470
<td
14401471
class="ant-table-cell ellipsis-column-width"
14411472
>
@@ -1666,6 +1697,11 @@ exports[`test base/CloudBeaver/List filter data with search 1`] = `
16661697
>
16671698
-
16681699
</td>
1700+
<td
1701+
class="ant-table-cell"
1702+
>
1703+
-
1704+
</td>
16691705
<td
16701706
class="ant-table-cell ellipsis-column-width"
16711707
>
@@ -2308,6 +2344,7 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
23082344
<col />
23092345
<col />
23102346
<col />
2347+
<col />
23112348
<col
23122349
style="width: 82px;"
23132350
/>
@@ -2340,6 +2377,12 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
23402377
>
23412378
操作详情
23422379
</th>
2380+
<th
2381+
class="ant-table-cell"
2382+
scope="col"
2383+
>
2384+
关联工单
2385+
</th>
23432386
<th
23442387
class="ant-table-cell ellipsis-column-width"
23452388
scope="col"
@@ -2492,6 +2535,15 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
24922535
 
24932536
</div>
24942537
</td>
2538+
<td
2539+
style="padding: 0px; border: 0px; height: 0px;"
2540+
>
2541+
<div
2542+
style="height: 0px; overflow: hidden;"
2543+
>
2544+
 
2545+
</div>
2546+
</td>
24952547
</tr>
24962548
<tr
24972549
class="ant-table-row ant-table-row-level-0"
@@ -2578,6 +2630,11 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
25782630
</div>
25792631
</div>
25802632
</td>
2633+
<td
2634+
class="ant-table-cell"
2635+
>
2636+
-
2637+
</td>
25812638
<td
25822639
class="ant-table-cell ellipsis-column-width"
25832640
>
@@ -2884,6 +2941,11 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
28842941
</div>
28852942
</div>
28862943
</td>
2944+
<td
2945+
class="ant-table-cell"
2946+
>
2947+
-
2948+
</td>
28872949
<td
28882950
class="ant-table-cell ellipsis-column-width"
28892951
>
@@ -3145,6 +3207,11 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
31453207
>
31463208
success
31473209
</td>
3210+
<td
3211+
class="ant-table-cell"
3212+
>
3213+
-
3214+
</td>
31483215
<td
31493216
class="ant-table-cell ellipsis-column-width"
31503217
>
@@ -3375,6 +3442,11 @@ exports[`test base/CloudBeaver/List render init table 1`] = `
33753442
>
33763443
-
33773444
</td>
3445+
<td
3446+
class="ant-table-cell"
3447+
>
3448+
-
3449+
</td>
33783450
<td
33793451
class="ant-table-cell ellipsis-column-width"
33803452
>
@@ -4017,6 +4089,7 @@ exports[`test base/CloudBeaver/List render table when request return failed 1`]
40174089
<col />
40184090
<col />
40194091
<col />
4092+
<col />
40204093
<col
40214094
style="width: 82px;"
40224095
/>
@@ -4049,6 +4122,12 @@ exports[`test base/CloudBeaver/List render table when request return failed 1`]
40494122
>
40504123
操作详情
40514124
</th>
4125+
<th
4126+
class="ant-table-cell"
4127+
scope="col"
4128+
>
4129+
关联工单
4130+
</th>
40524131
<th
40534132
class="ant-table-cell ellipsis-column-width"
40544133
scope="col"
@@ -4201,13 +4280,22 @@ exports[`test base/CloudBeaver/List render table when request return failed 1`]
42014280
 
42024281
</div>
42034282
</td>
4283+
<td
4284+
style="padding: 0px; border: 0px; height: 0px;"
4285+
>
4286+
<div
4287+
style="height: 0px; overflow: hidden;"
4288+
>
4289+
 
4290+
</div>
4291+
</td>
42044292
</tr>
42054293
<tr
42064294
class="ant-table-placeholder"
42074295
>
42084296
<td
42094297
class="ant-table-cell"
4210-
colspan="11"
4298+
colspan="12"
42114299
>
42124300
<div
42134301
class="ant-table-expanded-row-fixed"

packages/base/src/page/CloudBeaver/List/column.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@ import {
55
import { IListCBOperationLogsParams } from '@actiontech/shared/lib/api/base/service/CBOperationLogs/index.d';
66
import { ICBOperationLog } from '@actiontech/shared/lib/api/base/service/common';
77
import { t } from '../../../locale';
8-
import { formatTime } from '@actiontech/dms-kit';
8+
import { formatTime, ROUTE_PATHS } from '@actiontech/dms-kit';
99
import ResultIconRender from 'sqle/src/components/AuditResultMessage/ResultIconRender';
1010
import { OperationOperationTypeEnum } from '@actiontech/shared/lib/api/base/service/common.enum';
1111
import { CustomAvatar } from '@actiontech/dms-kit';
12-
import { SQLRenderer, BasicTypographyEllipsis } from '@actiontech/shared';
12+
import {
13+
SQLRenderer,
14+
BasicTypographyEllipsis,
15+
TypedLink
16+
} from '@actiontech/shared';
1317
export type CBOperationListFilterParamType = PageInfoWithoutIndexAndSize<
1418
IListCBOperationLogsParams & {
1519
page_index: number;
1620
},
1721
'project_uid'
1822
>;
1923
export const CBOperationListColumns = (
24+
projectID: string,
2025
onOpenDrawer: (record: ICBOperationLog) => void
2126
): ActiontechTableColumn<ICBOperationLog, CBOperationListFilterParamType> => {
2227
return [
@@ -67,6 +72,27 @@ export const CBOperationListColumns = (
6772
return operation?.operation_detail ?? '-';
6873
}
6974
},
75+
{
76+
dataIndex: 'workflow_id',
77+
title: t('dmsCloudBeaver.operationList.column.relatedWorkflow'),
78+
render: (value: ICBOperationLog['workflow_id']) => {
79+
if (!value) {
80+
return '-';
81+
}
82+
return (
83+
<TypedLink
84+
target="_blank"
85+
to={ROUTE_PATHS.SQLE.SQL_EXEC_WORKFLOW.detail}
86+
params={{
87+
projectID,
88+
workflowId: value
89+
}}
90+
>
91+
{value}
92+
</TypedLink>
93+
);
94+
}
95+
},
7096
{
7197
dataIndex: 'session_id',
7298
title: t('dmsCloudBeaver.operationList.column.sessionId'),

packages/base/src/page/CloudBeaver/List/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ const CBOperationLogsList: React.FC<CBOperationLogsListProps> = ({
179179
dispatch(updateCBSqlOperationRecord({ cbSqlOperationRecord }));
180180
};
181181

182-
return CBOperationListColumns(onOpenDrawer);
183-
}, [dispatch]);
182+
return CBOperationListColumns(projectID, onOpenDrawer);
183+
}, [dispatch, projectID]);
184184

185185
const { filterButtonMeta, filterContainerMeta, updateAllSelectedFilterItem } =
186186
useTableFilterContainer(columns, updateTableFilterInfo);

0 commit comments

Comments
 (0)