Skip to content

Commit 3e5127a

Browse files
committed
Merge branch 'cloud/202502' into dev-4.3.3
2 parents d341940 + 54fc2d8 commit 3e5127a

File tree

19 files changed

+123
-63
lines changed

19 files changed

+123
-63
lines changed

src/common/network/exportAndImport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export async function createBatchImportTask(
207207
}
208208

209209
export function getImportUploadUrl() {
210-
return odc.appConfig.network.baseUrl?.() + `/api/v2/dataTransfer/upload`;
210+
return odc.appConfig.network?.baseUrl?.() + `/api/v2/dataTransfer/upload`;
211211
}
212212

213213
export async function getCsvFileInfo(params: {

src/common/network/other.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ export const odcServerLoginUrl = '/api/v1/sso-login';
100100
export const odcServerLogoutUrl = '/api/v1/sso-logout';
101101

102102
export const uploadSSLFileUrl =
103-
odc.appConfig.network.baseUrl() + `/api/v2/objectstorage/ssl/files/batchUpload`;
103+
odc.appConfig.network?.baseUrl?.() + `/api/v2/objectstorage/ssl/files/batchUpload`;

src/common/network/table/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export async function getDataObjectDownloadUrl(
383383
return donwloadUrl;
384384
} else {
385385
return (
386-
odc.appConfig.network.baseUrl() +
386+
odc.appConfig.network?.baseUrl?.() +
387387
`/api/v2/datasource/sessions/${generateDatabaseSid(
388388
dbName,
389389
sessionId,

src/common/network/task.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ export async function downloadTaskFlow(id: number, fileName?: string) {
395395
return;
396396
}
397397
downloadFile(
398-
odc.appConfig.network.baseUrl() +
398+
odc.appConfig.network?.baseUrl?.() +
399399
`/api/v2/flow/flowInstances/${id}/tasks/download` +
400400
(fileName ? `?fileName=${fileName}` : ''),
401401
);
@@ -420,7 +420,7 @@ export async function postTaskFile(data: {
420420
}
421421

422422
export function getAsyncTaskUploadUrl() {
423-
return odc.appConfig.network.baseUrl() + '/api/v2/objectstorage/async/files/batchUpload';
423+
return odc.appConfig.network?.baseUrl?.() + '/api/v2/objectstorage/async/files/batchUpload';
424424
}
425425

426426
/**

src/component/BatchImportButton/modal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ const BatchImportModal: React.FC<IProps> = (props) => {
159159
{description}
160160
<Button
161161
type="link"
162-
href={(odc.appConfig.network.baseUrl() || '') + templatePath + '?lang=' + getLocale()}
162+
href={
163+
(odc.appConfig.network?.baseUrl?.() || '') + templatePath + '?lang=' + getLocale()
164+
}
163165
download={true}
164166
>
165167
{

src/component/Manage/ResourceSelector/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ const ResourceItem: React.FC<{
269269
}) //取消全部
270270
}
271271
</Button>
272-
{odc?.createdByMeRolesSupport?.() ? (
272+
{odc?.createdByMeRolesSupport?.() &&
273+
values?.[fieldName]?.resourceType !== IManagerResourceType.role ? (
273274
<Button
274275
type="link"
275276
disabled={disableSelectAllICreated}

src/component/Task/component/PartitionPolicyFormTable/configModal.tsx

Lines changed: 85 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
Tag,
3939
Typography,
4040
} from 'antd';
41-
import React, { useEffect, useState } from 'react';
41+
import React, { useEffect, useMemo, useState } from 'react';
4242
import { TaskPartitionStrategyMap } from '../../const';
4343
import { ITableConfig } from '../../PartitionTask/CreateModal';
4444
import { START_DATE } from './const';
@@ -207,6 +207,7 @@ const ConfigDrawer: React.FC<IProps> = (props) => {
207207
const [form] = Form.useForm();
208208
const strategies = Form.useWatch('strategies', form);
209209
const nameRuleType = Form.useWatch('nameRuleType', form);
210+
const generateCount = Form.useWatch('generateCount', form);
210211
const partitionKeyOptions =
211212
configs?.[0]?.option?.partitionKeyConfigs
212213
?.filter((item) => item?.type?.localizedMessage)
@@ -415,6 +416,88 @@ const ConfigDrawer: React.FC<IProps> = (props) => {
415416
}
416417
}, [configs, visible]);
417418

419+
const submitBtn = useMemo(() => {
420+
const isSingleGenerateCount = generateCount === 1;
421+
const isSingleGenerateCountMessage =
422+
'当前预创建分区数量过小,若调度失败恐影响业务运行,建议调整预创建分区数量至2个及以上。';
423+
const isBatchMessage = formatMessage({
424+
id: 'odc.components.PartitionPolicyTable.configModal.BatchSettingWillOverwriteThe',
425+
defaultMessage: '批量设置将覆盖原有的策略,是否确定设置?',
426+
});
427+
if (isBatch) {
428+
return (
429+
<Popconfirm
430+
overlayStyle={{ width: '216px' }}
431+
title={
432+
isSingleGenerateCount ? (
433+
<>
434+
<div>{isSingleGenerateCountMessage}</div>
435+
<div>{isBatchMessage}</div>
436+
</>
437+
) : (
438+
isBatchMessage
439+
)
440+
} /*批量设置将覆盖原有的策略,是否确定设置?*/
441+
onConfirm={handleOk}
442+
okText={formatMessage({
443+
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
444+
defaultMessage: '确定',
445+
})} /*确定*/
446+
cancelText={formatMessage({
447+
id: 'odc.components.PartitionPolicyTable.configModal.Return',
448+
defaultMessage: '返回',
449+
})} /*返回*/
450+
>
451+
<Button type="primary">
452+
{
453+
formatMessage({
454+
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
455+
defaultMessage: '确定',
456+
}) /*确定*/
457+
}
458+
</Button>
459+
</Popconfirm>
460+
);
461+
}
462+
if (isSingleGenerateCount) {
463+
return (
464+
<Popconfirm
465+
overlayStyle={{ width: '216px' }}
466+
title={isSingleGenerateCountMessage}
467+
onConfirm={handleOk}
468+
okText={formatMessage({
469+
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
470+
defaultMessage: '确定',
471+
})} /*确定*/
472+
cancelText={formatMessage({
473+
id: 'odc.components.PartitionPolicyTable.configModal.Return',
474+
defaultMessage: '返回',
475+
})} /*返回*/
476+
placement="topRight"
477+
>
478+
<Button type="primary">
479+
{
480+
formatMessage({
481+
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
482+
defaultMessage: '确定',
483+
}) /*确定*/
484+
}
485+
</Button>
486+
</Popconfirm>
487+
);
488+
}
489+
return (
490+
<Button type="primary" onClick={handleOk}>
491+
{
492+
formatMessage({
493+
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
494+
defaultMessage: '确定',
495+
}) /*确定*/
496+
}
497+
</Button>
498+
);
499+
}, [isBatch, generateCount]);
500+
418501
return (
419502
<Drawer
420503
title={
@@ -455,42 +538,7 @@ const ConfigDrawer: React.FC<IProps> = (props) => {
455538
}) /* 预览 SQL */
456539
}
457540
</Button>
458-
{isBatch ? (
459-
<Popconfirm
460-
overlayStyle={{ width: '216px' }}
461-
title={formatMessage({
462-
id: 'odc.components.PartitionPolicyTable.configModal.BatchSettingWillOverwriteThe',
463-
defaultMessage: '批量设置将覆盖原有的策略,是否确定设置?',
464-
})} /*批量设置将覆盖原有的策略,是否确定设置?*/
465-
onConfirm={handleOk}
466-
okText={formatMessage({
467-
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
468-
defaultMessage: '确定',
469-
})} /*确定*/
470-
cancelText={formatMessage({
471-
id: 'odc.components.PartitionPolicyTable.configModal.Return',
472-
defaultMessage: '返回',
473-
})} /*返回*/
474-
>
475-
<Button type="primary">
476-
{
477-
formatMessage({
478-
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
479-
defaultMessage: '确定',
480-
}) /*确定*/
481-
}
482-
</Button>
483-
</Popconfirm>
484-
) : (
485-
<Button type="primary" onClick={handleOk}>
486-
{
487-
formatMessage({
488-
id: 'odc.components.PartitionPolicyTable.configModal.Ok',
489-
defaultMessage: '确定',
490-
}) /*确定*/
491-
}
492-
</Button>
493-
)}
541+
{submitBtn}
494542
</Space>
495543
}
496544
>

src/constant/record.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -949,17 +949,17 @@ export function getEventFilterAndOptions(eventMeta: IAuditEvent[]) {
949949
const children =
950950
metas[type]?.map((value) => {
951951
return {
952-
title: AuditEventActionMap[value],
952+
title: eventMeta?.find((i) => i.action === value)?.actionName,
953953
key: value,
954954
value,
955955
};
956956
}) ?? [];
957957
filter.push({
958-
text: AuditEventMetaMap[type],
958+
text: eventMeta?.find((i) => i.type === type)?.typeName,
959959
value: type,
960960
});
961961
return {
962-
title: AuditEventMetaMap[type],
962+
title: eventMeta?.find((i) => i.type === type)?.typeName,
963963
key: type,
964964
value: type,
965965
children: children,

src/d.ts/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,9 @@ export enum AuditEventResult {
690690
export interface IAudit {
691691
id: number;
692692
type: AuditEventType;
693+
typeName: string;
693694
action: AuditEventActionType;
695+
actionName: string;
694696
connectionId: number;
695697
connectionName: string;
696698
connectionHost: string;
@@ -715,7 +717,9 @@ export interface IAuditEvent {
715717
id: number;
716718
methodSignature: string;
717719
type: AuditEventType;
720+
typeName: string;
718721
action: AuditEventActionType;
722+
actionName: string;
719723
sidExtractExpression: string;
720724
inConnection: boolean;
721725
enabled: boolean;

src/page/Datasource/Datasource/Content/List/ConnectionNameItem/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const ConnectionName: React.FC<IProps> = function ({ connection, openNewConnecti
6969
>
7070
<Icon
7171
style={{ color: DBIcon.color }}
72-
component={DBIcon.component}
72+
component={DBIcon?.component}
7373
className={styles.activeStatus}
7474
/>
7575
</Tooltip>
@@ -112,7 +112,7 @@ const ConnectionName: React.FC<IProps> = function ({ connection, openNewConnecti
112112
return (
113113
<Tooltip title={status?.errorMessage} placement="top">
114114
<Icon
115-
component={DBIcon.component}
115+
component={DBIcon?.component}
116116
style={{ filter: 'grayscale(1)' }}
117117
className={styles.activeStatus}
118118
/>

0 commit comments

Comments
 (0)