Skip to content

Commit e0da256

Browse files
committed
chore: oic extract
1 parent 9062eb9 commit e0da256

85 files changed

Lines changed: 2230 additions & 364 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/common/network/script.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,14 @@ export async function batchDownloadScript(scriptIds: ScriptId[]): Promise<void>
101101
const MAX_DOWNLOAD_COUNT = 200;
102102
if (scriptIds.length > MAX_DOWNLOAD_COUNT) {
103103
Modal.error({
104-
title: '批量下载失败',
105-
content: `最多支持批量下载${MAX_DOWNLOAD_COUNT}个脚本,建议先取消选择部分脚本`,
104+
title: formatMessage({ id: 'src.common.network.7B0A4820', defaultMessage: '批量下载失败' }),
105+
content: formatMessage(
106+
{
107+
id: 'src.common.network.F390612A',
108+
defaultMessage: '最多支持批量下载{MAX_DOWNLOAD_COUNT}个脚本,建议先取消选择部分脚本',
109+
},
110+
{ MAX_DOWNLOAD_COUNT },
111+
),
106112
});
107113
return;
108114
}

src/component/CommonTable/component/EditTableRow.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatMessage } from '@/util/intl';
12
import { Form, GetRef, InputRef, Input, Tooltip } from 'antd';
23
import React, { useEffect, useRef, useState, useContext } from 'react';
34
import styles from '../index.less';
@@ -74,7 +75,10 @@ const EditableCell: React.FC<React.PropsWithChildren<EditableCellProps>> = ({
7475
rules={[
7576
{
7677
max: 100,
77-
message: '备注字符不允许超过100',
78+
message: formatMessage({
79+
id: 'src.component.CommonTable.component.2343D924',
80+
defaultMessage: '备注字符不允许超过100',
81+
}),
7882
},
7983
]}
8084
>

src/component/ConnectionPopover/index.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ const ConnectionPopover: React.FC<{
5151
return (
5252
<div style={{ display: 'flex' }}>
5353
<span style={{ whiteSpace: 'nowrap' }} className={styles.label}>
54-
备注:
54+
{formatMessage({
55+
id: 'src.component.ConnectionPopover.7A11191E',
56+
defaultMessage: '备注:',
57+
})}
5558
</span>
5659
<div style={{ width: '260px', wordBreak: 'break-word' }}>{database?.remark ?? '-'}</div>
5760
</div>
@@ -61,7 +64,12 @@ const ConnectionPopover: React.FC<{
6164
const dataSourceDescription = useMemo(() => {
6265
return (
6366
<div style={{ display: 'flex' }}>
64-
<span className={styles.label}>数据源:</span>
67+
<span className={styles.label}>
68+
{formatMessage({
69+
id: 'src.component.ConnectionPopover.2A18AD55',
70+
defaultMessage: '数据源:',
71+
})}
72+
</span>
6573
<div>{connection?.name || database?.dataSource?.name || '-'}</div>
6674
</div>
6775
);
@@ -70,7 +78,12 @@ const ConnectionPopover: React.FC<{
7078
const projectDescription = useMemo(() => {
7179
return (
7280
<div style={{ display: 'flex' }}>
73-
<span className={styles.label}>项目:</span>
81+
<span className={styles.label}>
82+
{formatMessage({
83+
id: 'src.component.ConnectionPopover.16ED170C',
84+
defaultMessage: '项目:',
85+
})}
86+
</span>
7487
<div>{database?.project?.name || connection?.projectName || '-'}</div>
7588
</div>
7689
);
@@ -312,6 +325,7 @@ const ConnectionPopover: React.FC<{
312325
database?.environment?.style?.toLowerCase()
313326
}
314327
/>
328+
315329
<DataBaseStatusIcon item={database} />
316330
<span style={{ marginLeft: '6px', textOverflow: 'ellipsis', overflow: 'hidden' }}>
317331
{database?.name}

src/component/Empty/ApplyDatabaseAuthEmpty/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatMessage } from '@/util/intl';
12
import { Empty } from 'antd';
23
import styles from './index.less';
34

@@ -10,7 +11,13 @@ export function ApplyDatabaseAuthEmpty({ description }: IProps) {
1011
<Empty
1112
className={styles.applyDatabaseAuthEmptyWrapper}
1213
image={Empty.PRESENTED_IMAGE_SIMPLE}
13-
description={description || '项目内暂无数据库,请联系管理员'}
14+
description={
15+
description ||
16+
formatMessage({
17+
id: 'src.component.Empty.ApplyDatabaseAuthEmpty.018D078A',
18+
defaultMessage: '项目内暂无数据库,请联系管理员',
19+
})
20+
}
1421
/>
1522
);
1623
}

src/component/Empty/DatabaseSelectEmpty/index.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatMessage } from '@/util/intl';
12
import { Empty } from 'antd';
23
import styles from './index.less';
34
import { ExportOutlined } from '@ant-design/icons';
@@ -17,16 +18,33 @@ export default ({ showIcon, height = 280 }: IProps) => {
1718
image={Empty.PRESENTED_IMAGE_SIMPLE}
1819
description={
1920
<div className={styles.description}>
20-
<div className={styles.title}>暂无数据库</div>
21+
<div className={styles.title}>
22+
{formatMessage({
23+
id: 'src.component.Empty.DatabaseSelectEmpty.9C21267F',
24+
defaultMessage: '暂无数据库',
25+
})}
26+
</div>
2127
{login.isPrivateSpace() ? (
2228
<></>
2329
) : (
2430
<div className={styles.subDescription}>
2531
{showIcon
26-
? '仅展示全部项目内的数据库,请先确认已加入项目、且项目内存在数据库。'
27-
: '仅支持选择项目内的数据库,请先确认已加入项目、且项目内存在数据库。'}
32+
? formatMessage({
33+
id: 'src.component.Empty.DatabaseSelectEmpty.953DB46B',
34+
defaultMessage:
35+
'仅展示全部项目内的数据库,请先确认已加入项目、且项目内存在数据库。',
36+
})
37+
: formatMessage({
38+
id: 'src.component.Empty.DatabaseSelectEmpty.7272411D',
39+
defaultMessage:
40+
'仅支持选择项目内的数据库,请先确认已加入项目、且项目内存在数据库。',
41+
})}
2842
<span className={styles.action} onClick={() => window.open('/#/project')}>
29-
管理项目{showIcon && <ExportOutlined style={{ marginLeft: 4 }} />}
43+
{formatMessage({
44+
id: 'src.component.Empty.DatabaseSelectEmpty.8F714B05',
45+
defaultMessage: '管理项目',
46+
})}
47+
{showIcon && <ExportOutlined style={{ marginLeft: 4 }} />}
3048
</span>
3149
</div>
3250
)}

src/component/Empty/DatasourceSelectEmpty/index.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatMessage } from '@/util/intl';
12
import { Divider, Empty } from 'antd';
23
import styles from './index.less';
34
import { SettingOutlined } from '@@node_modules/@ant-design/icons/lib';
@@ -15,7 +16,10 @@ export default ({ height = 160 }: IProps) => {
1516
<Empty
1617
className={styles.datasourceSelectCannotCreateEmpty}
1718
image={Empty.PRESENTED_IMAGE_SIMPLE}
18-
description="暂无数据源,请联系管理员"
19+
description={formatMessage({
20+
id: 'src.component.Empty.DatasourceSelectEmpty.AD7EB9CC',
21+
defaultMessage: '暂无数据源,请联系管理员',
22+
})}
1923
/>
2024
}
2125
{...createPermission(IManagerResourceType.resource, actionTypes.create)}
@@ -25,14 +29,21 @@ export default ({ height = 160 }: IProps) => {
2529
className={styles.empty}
2630
style={{ height }}
2731
image={Empty.PRESENTED_IMAGE_SIMPLE}
28-
description="暂无数据源"
32+
description={formatMessage({
33+
id: 'src.component.Empty.DatasourceSelectEmpty.41EBD586',
34+
defaultMessage: '暂无数据源',
35+
})}
2936
/>
37+
3038
<Divider />
3139

3240
<div className={styles.setting}>
3341
<SettingOutlined color="#1890ff" />
3442
<span className={styles.action} onClick={() => window.open('/#/datasource')}>
35-
管理数据源
43+
{formatMessage({
44+
id: 'src.component.Empty.DatasourceSelectEmpty.6DC59C18',
45+
defaultMessage: '管理数据源',
46+
})}
3647
</span>
3748
</div>
3849
</div>

src/component/Empty/ProjectSelectEmpty/index.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1+
import { formatMessage } from '@/util/intl';
12
import { Divider, Empty } from 'antd';
23
import styles from './index.less';
34
import { SettingOutlined } from '@ant-design/icons';
45
export default () => {
56
return (
67
<div className={styles.projectSelectEmptyWrapper}>
7-
<Empty className={styles.empty} image={Empty.PRESENTED_IMAGE_SIMPLE} description="暂无项目" />
8+
<Empty
9+
className={styles.empty}
10+
image={Empty.PRESENTED_IMAGE_SIMPLE}
11+
description={formatMessage({
12+
id: 'src.component.Empty.ProjectSelectEmpty.256B8DEF',
13+
defaultMessage: '暂无项目',
14+
})}
15+
/>
816
<Divider />
917
<div className={styles.setting}>
1018
<SettingOutlined color="#1890ff" />
1119
<span className={styles.action} onClick={() => window.open('/#/project')}>
12-
管理项目
20+
{formatMessage({
21+
id: 'src.component.Empty.ProjectSelectEmpty.E8AA0AD9',
22+
defaultMessage: '管理项目',
23+
})}
1324
</span>
1425
</div>
1526
</div>

src/component/Empty/RecentlyDatabaseEmpty/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatMessage } from '@/util/intl';
12
import { Empty } from 'antd';
23
import styles from './index.less';
34

@@ -12,7 +13,14 @@ export default ({ height = 268, color }: IProps) => {
1213
style={{ height }}
1314
image={Empty.PRESENTED_IMAGE_SIMPLE}
1415
className={styles.databaseEmpty}
15-
description={<span style={{ color }}>暂无最近访问的数据库</span>}
16+
description={
17+
<span style={{ color }}>
18+
{formatMessage({
19+
id: 'src.component.Empty.RecentlyDatabaseEmpty.94C7FC75',
20+
defaultMessage: '暂无最近访问的数据库',
21+
})}
22+
</span>
23+
}
1624
/>
1725
);
1826
};

src/component/ExecuteSqlDetailModal/constant.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,16 @@ export enum DirtyRowActionEnum {
124124
}
125125

126126
export const DirtyRowActionLabelMap = {
127-
[DirtyRowActionEnum.SKIP]: '跳过清理',
128-
[DirtyRowActionEnum.REMIGRATE]: '清理并更新目标库',
129-
[DirtyRowActionEnum.RAISE_ERROR]: '任务失败',
127+
[DirtyRowActionEnum.SKIP]: formatMessage({
128+
id: 'src.component.ExecuteSqlDetailModal.1F699B52',
129+
defaultMessage: '跳过清理',
130+
}),
131+
[DirtyRowActionEnum.REMIGRATE]: formatMessage({
132+
id: 'src.component.ExecuteSqlDetailModal.86528F49',
133+
defaultMessage: '清理并更新目标库',
134+
}),
135+
[DirtyRowActionEnum.RAISE_ERROR]: formatMessage({
136+
id: 'src.component.ExecuteSqlDetailModal.B88E979F',
137+
defaultMessage: '任务失败',
138+
}),
130139
};

src/component/ODCSetting/Item/SecretKeyItem/CopyOpertaion.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { formatMessage } from '@/util/intl';
12
import { useCallback } from 'react';
23
import { Button, Tooltip } from 'antd';
34
import { CopyOutlined, CheckOutlined } from '@ant-design/icons';
@@ -18,10 +19,22 @@ const CopyOperation = ({ password }) => {
1819
}, []);
1920

2021
return (
21-
<Tooltip title={countdown > 0 ? '复制成功' : ''}>
22+
<Tooltip
23+
title={
24+
countdown > 0
25+
? formatMessage({
26+
id: 'src.component.ODCSetting.Item.SecretKeyItem.0BCDF242',
27+
defaultMessage: '复制成功',
28+
})
29+
: ''
30+
}
31+
>
2232
<Button type="link" style={{ padding: 0, marginRight: 8, gap: 0 }} onClick={handleCopyClick}>
2333
{countdown > 0 ? <CheckOutlined /> : <CopyOutlined />}
24-
复制密钥
34+
{formatMessage({
35+
id: 'src.component.ODCSetting.Item.SecretKeyItem.F18D75FE',
36+
defaultMessage: '复制密钥',
37+
})}
2538
</Button>
2639
</Tooltip>
2740
);

0 commit comments

Comments
 (0)