- SQL 执行
+
+ {formatMessage({ id: 'src.component.SQLConfig.1A5CCA98', defaultMessage: 'SQL 执行' })}
+
= function (props) {
)}
- SQL 执行
+
+ {formatMessage({ id: 'src.component.SQLConfig.A614A99E', defaultMessage: 'SQL 执行' })}
+
,
];
+
const timerExecutionItem: [string, string] = [
formatMessage({
id: 'odc.AlterDdlTask.DetailContent.ExecutionTime',
@@ -143,6 +144,7 @@ export function getItems(
//执行时间
getFormatDateTime(task?.executionTime),
];
+
const lockUsers = parameters?.lockUsers?.join(', ');
const handleDataSizeLimit = async (dataSizeLimit, handleClose) => {
@@ -186,6 +188,7 @@ export function getItems(
//任务编号
task.id,
],
+
[
formatMessage({
id: 'odc.AlterDdlTask.DetailContent.TaskType',
@@ -202,6 +205,7 @@ export function getItems(
//所属库
task?.database?.name || '-',
],
+
[
formatMessage({
id: 'odc.src.component.Task.AlterDdlTask.DetailContent.DataSource',
@@ -209,6 +213,7 @@ export function getItems(
//'所属数据源'
task?.database.dataSource?.name || '-',
],
+
hasFlow ? riskItem : null,
lockUsers
? [
@@ -234,6 +239,7 @@ export function getItems(
taskExecStrategyMap[task?.executionStrategy],
hasFlow ? 2 : 1,
],
+
[null, , 2],
[
formatMessage({
@@ -242,6 +248,7 @@ export function getItems(
//锁表超时时间
`${parameters?.lockTableTimeOutSeconds}s`,
],
+
[
formatMessage({
id: 'odc.AlterDdlTask.DetailContent.NumberOfFailedRetries',
@@ -249,6 +256,7 @@ export function getItems(
//失败重试次数
parameters?.swapTableNameRetryTimes,
],
+
[
formatMessage({
id: 'odc.AlterDdlTask.DetailContent.SourceTableCleanupPolicyAfter',
@@ -256,6 +264,7 @@ export function getItems(
//完成后源表清理策略
ClearStrategyMap[parameters?.originTableCleanStrategy],
],
+
[
formatMessage({
id: 'odc.AlterDdlTask.DetailContent.ExecutionMethod',
@@ -263,12 +272,14 @@ export function getItems(
//执行方式
taskExecStrategyMap[task?.executionStrategy],
],
+
[
formatMessage({
id: 'odc.src.component.Task.AlterDdlTask.DetailContent.TableNameSwitchingMethod',
}), //'表名切换方式'
SwapTableTypeMap[task?.parameters?.swapTableType] ?? '-',
],
+
isTimerExecution ? timerExecutionItem : null,
[
formatMessage({
@@ -278,9 +289,14 @@ export function getItems(
ErrorStrategyText[parameters.errorStrategy],
2,
],
+
setting.enableOSCLimiting
? [
- '行限流',
+ formatMessage({
+ id: 'src.component.Task.AlterDdlTask.DetailContent.FE4166B2',
+ defaultMessage: '行限流',
+ }),
+
,
+
1,
]
: null,
setting.enableOSCLimiting
? [
- '数据大小限流',
+ formatMessage({
+ id: 'src.component.Task.AlterDdlTask.DetailContent.45E8ACBB',
+ defaultMessage: '数据大小限流',
+ }),
+
,
+
1,
]
: null,
@@ -324,6 +346,7 @@ export function getItems(
task?.creator?.name || '-',
2,
],
+
[
formatMessage({
id: 'odc.AlterDdlTask.DetailContent.CreationTime',
diff --git a/src/component/Task/ApplyTablePermission/CreateModal/index.tsx b/src/component/Task/ApplyTablePermission/CreateModal/index.tsx
index 047cdba87..bb11d2e73 100644
--- a/src/component/Task/ApplyTablePermission/CreateModal/index.tsx
+++ b/src/component/Task/ApplyTablePermission/CreateModal/index.tsx
@@ -1,3 +1,4 @@
+import { formatMessage } from '@/util/intl';
/*
* Copyright 2023 OceanBase
*
@@ -66,7 +67,12 @@ export const getExpireTime = (expireTime, customExpireTime, isCustomExpireTime)
export const getExpireTimeLabel = (expireTime) => {
const label = moment(expireTime).format('YYYY-MM-DD');
- return label === MAX_DATE_LABEL ? '永不过期' : label;
+ return label === MAX_DATE_LABEL
+ ? formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.BC4488C7',
+ defaultMessage: '永不过期',
+ })
+ : label;
};
const Label: React.FC<{
@@ -80,17 +86,26 @@ const Label: React.FC<{
export const permissionOptionsMap = {
[TablePermissionType.QUERY]: {
- text: '查询',
+ text: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.82C8FE0E',
+ defaultMessage: '查询',
+ }),
docKey: 'ApplyTablePermissionQueryTip',
value: TablePermissionType.QUERY,
},
[TablePermissionType.EXPORT]: {
- text: '导出',
+ text: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.E26609A0',
+ defaultMessage: '导出',
+ }),
docKey: 'ApplyTablePermissionExportTip',
value: TablePermissionType.EXPORT,
},
[TablePermissionType.CHANGE]: {
- text: '变更',
+ text: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.D802CFB3',
+ defaultMessage: '变更',
+ }),
docKey: 'ApplyTablePermissionChangeTip',
value: TablePermissionType.CHANGE,
},
@@ -105,35 +120,59 @@ export const permissionOptions = Object.values(permissionOptionsMap)?.map(
export const expireTimeOptions = [
{
- label: '7 天',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.F357A49C',
+ defaultMessage: '7 天',
+ }),
value: '7,days',
},
{
- label: '30 天',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.DFADB0AB',
+ defaultMessage: '30 天',
+ }),
value: '30,days',
},
{
- label: '90 天',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.E06F8910',
+ defaultMessage: '90 天',
+ }),
value: '90,days',
},
{
- label: '半 年',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.76C327CA',
+ defaultMessage: '半 年',
+ }),
value: '0.5,years',
},
{
- label: '1 年',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.D6E6AE6E',
+ defaultMessage: '1 年',
+ }),
value: '1,years',
},
{
- label: '3年',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.A004AEF5',
+ defaultMessage: '3年',
+ }),
value: '3,years',
},
{
- label: '永不过期',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.705AE4C3',
+ defaultMessage: '永不过期',
+ }),
value: 'never',
},
{
- label: '自定义',
+ label: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.F4D36D95',
+ defaultMessage: '自定义',
+ }),
value: 'custom',
},
];
@@ -177,7 +216,10 @@ const CreateModal: React.FC = (props) => {
const handleCancel = (hasEdit: boolean) => {
if (hasEdit) {
Modal.confirm({
- title: '确认取消申请表权限吗?',
+ title: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.11B637AA',
+ defaultMessage: '确认取消申请表权限吗?',
+ }),
centered: true,
onOk: () => {
modalStore.changeApplyTablePermissionModal(false);
@@ -213,7 +255,12 @@ const CreateModal: React.FC = (props) => {
handleCancel(false);
setConfirmLoading(false);
if (res) {
- message.success('工单创建成功');
+ message.success(
+ formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.0D449988',
+ defaultMessage: '工单创建成功',
+ }),
+ );
openTasksPage(TaskPageType.APPLY_TABLE_PERMISSION, TaskPageScope.CREATED_BY_CURRENT_USER);
}
})
@@ -300,10 +347,18 @@ const CreateModal: React.FC = (props) => {
height: 72,
}}
/>
+
- 暂无项目,请先
+ {formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.8955ACFE',
+ defaultMessage: '暂无项目,请先',
+ })}
+
@@ -314,7 +369,10 @@ const CreateModal: React.FC = (props) => {
destroyOnClose
className={styles.createModal}
width={816}
- title="申请表权限"
+ title={formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.7DDD3557',
+ defaultMessage: '申请表权限',
+ })}
footer={
}
@@ -343,12 +407,18 @@ const CreateModal: React.FC = (props) => {
onFieldsChange={handleFieldsChange}
>
@@ -356,7 +426,10 @@ const CreateModal: React.FC = (props) => {
showSearch
style={{ width: 336 }}
options={projectOptions}
- placeholder="请选择"
+ placeholder={formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.CreateModal.DC9A3E27',
+ defaultMessage: '请选择',
+ })}
filterOption={(input, option) =>
(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
}
@@ -366,12 +439,18 @@ const CreateModal: React.FC = (props) => {
@@ -379,11 +458,17 @@ const CreateModal: React.FC = (props) => {
@@ -391,19 +476,28 @@ const CreateModal: React.FC = (props) => {
@@ -413,12 +507,18 @@ const CreateModal: React.FC = (props) => {
return (
isCustomExpireTime && (
@@ -430,20 +530,35 @@ const CreateModal: React.FC = (props) => {
-
+
diff --git a/src/component/Task/ApplyTablePermission/DetailContent/index.tsx b/src/component/Task/ApplyTablePermission/DetailContent/index.tsx
index 4dc1fba0e..dc43a5d00 100644
--- a/src/component/Task/ApplyTablePermission/DetailContent/index.tsx
+++ b/src/component/Task/ApplyTablePermission/DetailContent/index.tsx
@@ -1,3 +1,4 @@
+import { formatMessage } from '@/util/intl';
/*
* Copyright 2023 OceanBase
*
@@ -27,7 +28,10 @@ const getConnectionColumns = () => {
return [
{
dataIndex: 'databaseName',
- title: '数据库',
+ title: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.DetailContent.9E007486',
+ defaultMessage: '数据库',
+ }),
ellipsis: true,
width: 240,
render(databaseName: string, { dataSourceType }) {
@@ -44,13 +48,19 @@ const getConnectionColumns = () => {
},
{
dataIndex: 'tableName',
- title: '表',
+ title: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.DetailContent.658E0B9E',
+ defaultMessage: '表',
+ }),
ellipsis: true,
width: 240,
},
{
dataIndex: 'dataSourceName',
- title: '所属数据源',
+ title: formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.DetailContent.04825B86',
+ defaultMessage: '所属数据源',
+ }),
ellipsis: true,
},
];
@@ -82,19 +92,47 @@ const TaskContent: React.FC = (props) => {
return (
<>
- {task?.id}
- 申请表权限
+
+ {task?.id}
+
+
+ {formatMessage({
+ id: 'src.component.Task.ApplyTablePermission.DetailContent.6C1A740A',
+ defaultMessage: '申请表权限',
+ })}
+
+
- {parameters?.project?.name}
+
+ {parameters?.project?.name}
+
= (props) => {
/>
-
+
{parameters?.types?.map((key) => permissionOptionsMap[key].text)?.join(', ')}
-
+
{getExpireTimeLabel(parameters?.expireTime)}
- {parameters?.applyReason}
+
+ {parameters?.applyReason}
+
+
- {task?.creator?.name || '-'}
-
+
+ {task?.creator?.name || '-'}
+
+
{getFormatDateTime(task?.createTime)}
diff --git a/src/component/Task/component/TableSelecter/index.tsx b/src/component/Task/component/TableSelecter/index.tsx
index 4b716e391..b07081a7e 100644
--- a/src/component/Task/component/TableSelecter/index.tsx
+++ b/src/component/Task/component/TableSelecter/index.tsx
@@ -1,3 +1,4 @@
+import { formatMessage } from '@/util/intl';
/*
* Copyright 2023 OceanBase
*
@@ -146,6 +147,7 @@ const getTreeData = (validTableList: IDataBaseWithTable[]) => {
{tableItem.name}
),
+
key: generateKeyByDataBaseIdAndTableName({
databaseId: id,
tableName: tableItem.name,
@@ -167,6 +169,7 @@ const getTreeData = (validTableList: IDataBaseWithTable[]) => {
),
+
key: id,
icon: ,
checkable: true,
@@ -460,7 +463,13 @@ const TableSelecter: React.ForwardRefRenderFunction =
checked={checkAll}
style={{ marginRight: '8px' }}
/>
- 选择表
+
+
+ {formatMessage({
+ id: 'src.component.Task.component.TableSelecter.E836E630',
+ defaultMessage: '选择表',
+ })}
+
({selectedTreeDataCount}/{allTreeDataCount})
@@ -488,7 +497,13 @@ const TableSelecter: React.ForwardRefRenderFunction =