From 234d1e8dcaecd263236648eb2bba34c786bf8031 Mon Sep 17 00:00:00 2001 From: xiaokang Date: Thu, 4 Jul 2024 17:45:43 +0800 Subject: [PATCH] chore: oic extract --- .../ExecuteSqlDetailModal/constant.tsx | 64 +++++- src/component/ExecuteSqlDetailModal/index.tsx | 84 ++++++-- src/component/ODCSetting/index.tsx | 7 +- src/component/ProfileFlow/constant.ts | 16 +- .../ProfileFlow/customComponents/Control.tsx | 29 ++- .../customComponents/DetailBox.tsx | 59 +++++- .../ProfileFlow/customComponents/Edge.tsx | 12 +- src/component/SQLConfig/index.tsx | 8 +- .../Task/AlterDdlTask/DetailContent/index.tsx | 27 ++- .../CreateModal/index.tsx | 185 +++++++++++++---- .../DetailContent/index.tsx | 92 +++++++-- .../Task/component/TableSelecter/index.tsx | 31 ++- .../Task/component/TaskTable/index.tsx | 5 +- src/component/Task/helper.tsx | 2 +- src/component/helpDoc/doc.tsx | 30 ++- src/constant/record.ts | 50 ++++- src/locales/must/strings/zh-CN.json | 190 +++++++++++++++++- .../User/ManageModal/Database/index.tsx | 8 +- .../ManageModal/Table/CreateAuth/index.tsx | 77 +++++-- .../User/ManageModal/Table/Status/index.tsx | 16 +- .../ManageModal/Table/TaskApplyList/index.tsx | 98 +++++++-- .../ManageModal/Table/UserAuthList/index.tsx | 82 ++++++-- .../Project/User/ManageModal/Table/index.tsx | 55 ++++- src/page/Project/User/ManageModal/index.tsx | 16 +- src/page/Project/User/index.tsx | 10 +- .../components/DDLResultSet/StatusBar.tsx | 10 +- .../components/DDLResultSet/index.tsx | 37 +++- .../components/SQLExplain/column.tsx | 15 +- .../SQLResultSet/DBPermissionTable.tsx | 33 ++- .../components/SQLResultSet/SQLResultLog.tsx | 35 +++- 30 files changed, 1191 insertions(+), 192 deletions(-) diff --git a/src/component/ExecuteSqlDetailModal/constant.tsx b/src/component/ExecuteSqlDetailModal/constant.tsx index f53d1d033..72897d82c 100644 --- a/src/component/ExecuteSqlDetailModal/constant.tsx +++ b/src/component/ExecuteSqlDetailModal/constant.tsx @@ -1,3 +1,4 @@ +import { formatMessage } from '@/util/intl'; import { ReactComponent as List } from '@/svgr/List.svg'; import { ReactComponent as Tree } from '@/svgr/Tree.svg'; import { ReactComponent as Text } from '@/svgr/Text.svg'; @@ -45,17 +46,66 @@ export const initTabViewConfig = { }; export const traceViewOptions = [ - { value: TypeMap.TRACE, icon: , message: 'Trace 视图' }, - { value: TypeMap.TRACE_LIST, icon: , message: '列表视图' }, + { + value: TypeMap.TRACE, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.3AAA9DF9', + defaultMessage: 'Trace 视图', + }), + }, + { + value: TypeMap.TRACE_LIST, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.D1E28701', + defaultMessage: '列表视图', + }), + }, ]; export const executeViewOptions = [ - { value: TypeMap.LIST, icon: , message: '列表视图' }, - { value: TypeMap.TEXT, icon: , message: '文本视图' }, + { + value: TypeMap.LIST, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.FB8B6D0B', + defaultMessage: '列表视图', + }), + }, + { + value: TypeMap.TEXT, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.052B3894', + defaultMessage: '文本视图', + }), + }, ]; export const executeViewOptionsInPlan = [ - { value: TypeMap.TREE, icon: , message: '树视图' }, - { value: TypeMap.LIST, icon: , message: '列表视图' }, - { value: TypeMap.TEXT, icon: , message: '文本视图' }, + { + value: TypeMap.TREE, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.0DAD5E44', + defaultMessage: '树视图', + }), + }, + { + value: TypeMap.LIST, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.2129C7A3', + defaultMessage: '列表视图', + }), + }, + { + value: TypeMap.TEXT, + icon: , + message: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.97782AAE', + defaultMessage: '文本视图', + }), + }, ]; diff --git a/src/component/ExecuteSqlDetailModal/index.tsx b/src/component/ExecuteSqlDetailModal/index.tsx index d7db2c3cf..c83295f08 100644 --- a/src/component/ExecuteSqlDetailModal/index.tsx +++ b/src/component/ExecuteSqlDetailModal/index.tsx @@ -46,21 +46,47 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { const finished = data?.graph?.status === IProfileStatus.FINISHED; const getExecuteRadioOption = () => { return [ - { value: EXECUTE_PAGE_TYPE.EXECUTE_DETAIL, label: '执行详情' }, - { value: EXECUTE_PAGE_TYPE.EXECUTE_PLAN, label: '执行计划' }, + { + value: EXECUTE_PAGE_TYPE.EXECUTE_DETAIL, + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.38BDF819', + defaultMessage: '执行详情', + }), + }, + { + value: EXECUTE_PAGE_TYPE.EXECUTE_PLAN, + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.8A207B02', + defaultMessage: '执行计划', + }), + }, { value: EXECUTE_PAGE_TYPE.FULL_TRACE, - label: '全链路诊断', + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.0B221F0A', + defaultMessage: '全链路诊断', + }), disabled: !finished, }, ]; }; - const planRadioOption = [{ value: PLAN_PAGE_TYPE.PLAN_DETAIL, label: '计划统计' }]; + const planRadioOption = [ + { + value: PLAN_PAGE_TYPE.PLAN_DETAIL, + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.14585364', + defaultMessage: '计划统计', + }), + }, + ]; const getDisabledTooltip = (val) => { if (!finished) { - return '当前 SQL 正在执行中,执行完成后可查看'; + return formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.D6886430', + defaultMessage: '当前 SQL 正在执行中,执行完成后可查看', + }); } return val; }; @@ -85,6 +111,7 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { disablePagination={true} /> ), + [TypeMap.TEXT]: (
 = ({ modalStore }: IProps) => {
             }}
           >
             
- +
@@ -121,6 +153,7 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { {data?.originalText}
), + [TypeMap.TRACE]: ( = ({ modalStore }: IProps) => { searchValue={searchValue} /> ), + [TypeMap.TRACE_LIST]: ( = ({ modalStore }: IProps) => { formatMessage({ id: 'odc.src.page.Workspace.components.Trace.ExportJson', }) /* - 导出 Json - */ + 导出 Json + */ } @@ -190,19 +224,28 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { } const EXECUTE_PAGE_CONFIG = { [EXECUTE_PAGE_TYPE.EXECUTE_DETAIL]: { - label: '执行详情', + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.69A79B8E', + defaultMessage: '执行详情', + }), key: EXECUTE_PAGE_TYPE.EXECUTE_DETAIL, children: viewContentConfig(viewType), toolBar: <>, }, [EXECUTE_PAGE_TYPE.EXECUTE_PLAN]: { - label: '执行计划', + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.BF467954', + defaultMessage: '执行计划', + }), key: EXECUTE_PAGE_TYPE.EXECUTE_PLAN, children: viewContentConfig(viewType), toolBar: getExecuteProfile(), }, [EXECUTE_PAGE_TYPE.FULL_TRACE]: { - label: '全链路诊断', + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.D47F3410', + defaultMessage: '全链路诊断', + }), key: EXECUTE_PAGE_TYPE.FULL_TRACE, children: viewContentConfig(viewType), toolBar: ( @@ -218,6 +261,7 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { } onSearch={(e) => setSearchValue(e)} /> + {getDownloadBtn()} = ({ modalStore }: IProps) => { const PLAN_PAGE_CONFIG = { [PLAN_PAGE_TYPE.PLAN_DETAIL]: { - label: '计划统计', + label: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.D11F8620', + defaultMessage: '计划统计', + }), key: PLAN_PAGE_TYPE.PLAN_DETAIL, children: viewContentConfig(viewType), toolBar: getExecuteProfile(true), @@ -249,7 +296,13 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { const executeInfo = { [ProfileType.Execute]: { - title: `Trace ID 为 "${modalStore?.executeSqlDetailData?.traceId}" 的执行画像`, + title: formatMessage( + { + id: 'src.component.ExecuteSqlDetailModal.5B8FA08A', + defaultMessage: 'Trace ID 为 "${modalStore?.executeSqlDetailData?.traceId}" 的执行画像', + }, + { modalStoreExecuteSqlDetailDataTraceId: modalStore?.executeSqlDetailData?.traceId }, + ), sql: modalStore?.executeSqlDetailData?.sql, session: modalStore?.executeSqlDetailData?.session, traceId: modalStore?.executeSqlDetailData?.traceId, @@ -258,7 +311,10 @@ const ExecuteSQLDetailModal: React.FC = ({ modalStore }: IProps) => { radioOption: getExecuteRadioOption(), }, [ProfileType.Plan]: { - title: '执行计划详情', + title: formatMessage({ + id: 'src.component.ExecuteSqlDetailModal.A944EAD1', + defaultMessage: '执行计划详情', + }), sql: modalStore?.executeSqlDetailData?.sql, session: modalStore?.executeSqlDetailData?.session, traceId: modalStore?.executeSqlDetailData?.traceId, diff --git a/src/component/ODCSetting/index.tsx b/src/component/ODCSetting/index.tsx index 59968f6bd..76560a0f7 100644 --- a/src/component/ODCSetting/index.tsx +++ b/src/component/ODCSetting/index.tsx @@ -184,7 +184,12 @@ const ODCSetting: React.FC = ({ modalStore }) => { serverData['odc.editor.shortcut.executeStatement'] === serverData['odc.editor.shortcut.executeCurrentStatement'] ) { - message.warning('快捷键冲突, 请重新输入。'); + message.warning( + formatMessage({ + id: 'src.component.ODCSetting.CFC0C3E8', + defaultMessage: '快捷键冲突, 请重新输入。', + }), + ); return; } /** diff --git a/src/component/ProfileFlow/constant.ts b/src/component/ProfileFlow/constant.ts index b1586b147..7c7668a2c 100644 --- a/src/component/ProfileFlow/constant.ts +++ b/src/component/ProfileFlow/constant.ts @@ -1,3 +1,4 @@ +import { formatMessage } from '@/util/intl'; // reactFlow id export const REACT_FLOW_ID = 'PROFILE_FLOW_BOX'; // 节点宽度 @@ -24,14 +25,23 @@ export const SUM = 'SUM'; export const subNodesSortMap = { [subNodeSortType.BY_DURATION]: { - label: '按 DB 耗时排序', + label: formatMessage({ + id: 'src.component.ProfileFlow.C966E64A', + defaultMessage: '按 DB 耗时排序', + }), }, [subNodeSortType.BY_MAX_MEMORY]: { - label: '按内存排序', + label: formatMessage({ + id: 'src.component.ProfileFlow.C4791007', + defaultMessage: '按内存排序', + }), objectKey: 'Max memory', }, [subNodeSortType.BY_OUTPUT]: { - label: '按吐行排序', + label: formatMessage({ + id: 'src.component.ProfileFlow.6B28FD92', + defaultMessage: '按吐行排序', + }), objectKey: 'Output rows', }, }; diff --git a/src/component/ProfileFlow/customComponents/Control.tsx b/src/component/ProfileFlow/customComponents/Control.tsx index 03317bf18..d6b103bc5 100644 --- a/src/component/ProfileFlow/customComponents/Control.tsx +++ b/src/component/ProfileFlow/customComponents/Control.tsx @@ -1,3 +1,4 @@ +import { formatMessage } from '@/util/intl'; import { Controls, ControlButton, useReactFlow } from 'reactflow'; import { ZoomInOutlined, @@ -15,12 +16,22 @@ export default function Flow() {
zoomOut()}> - + zoomIn()}> - + @@ -29,12 +40,22 @@ export default function Flow() { initCenter(setCenter); }} > - + fitView()}> - + {' '} diff --git a/src/component/ProfileFlow/customComponents/DetailBox.tsx b/src/component/ProfileFlow/customComponents/DetailBox.tsx index b6cb3e796..62acb8d1e 100644 --- a/src/component/ProfileFlow/customComponents/DetailBox.tsx +++ b/src/component/ProfileFlow/customComponents/DetailBox.tsx @@ -1,3 +1,4 @@ +import { formatMessage } from '@/util/intl'; import { Divider, Progress, Tooltip, Select, Radio } from 'antd'; import styles from './index.less'; import classnames from 'classnames'; @@ -92,7 +93,12 @@ export default ({ dataSource, topNodes, initialNodes, globalInfo }: Iprops) => { {top5Render()} {topNodesList.length ? : null}
-

Node 执行概览

+

+ {formatMessage({ + id: 'src.component.ProfileFlow.customComponents.2AB1AD68', + defaultMessage: 'Node 执行概览', + })} +

{dataSource?.data?.subNodes ? ( @@ -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 =
setTargetSearchValue(v)} extra={ = onChange([]); }} placement="left" - title="确定要清空已选对象吗?" + title={formatMessage({ + id: 'src.component.Task.component.TableSelecter.A56A8B2D', + defaultMessage: '确定要清空已选对象吗?', + })} > - 清空 + + {formatMessage({ + id: 'src.component.Task.component.TableSelecter.C6AF0504', + defaultMessage: '清空', + })} + } disabled diff --git a/src/component/Task/component/TaskTable/index.tsx b/src/component/Task/component/TaskTable/index.tsx index 628710a75..5aedb8e67 100644 --- a/src/component/Task/component/TaskTable/index.tsx +++ b/src/component/Task/component/TaskTable/index.tsx @@ -124,7 +124,10 @@ export const TaskTypeMap = { [TaskType.APPLY_DATABASE_PERMISSION]: formatMessage({ id: 'src.component.Task.component.TaskTable.E1E161BA', }), //'申请库权限' - [TaskType.APPLY_TABLE_PERMISSION]: '申请表权限', + [TaskType.APPLY_TABLE_PERMISSION]: formatMessage({ + id: 'src.component.Task.component.TaskTable.3236150E', + defaultMessage: '申请表权限', + }), [TaskType.STRUCTURE_COMPARISON]: formatMessage({ id: 'src.component.Task.component.TaskTable.80E1D16A', }), //'结构比对' diff --git a/src/component/Task/helper.tsx b/src/component/Task/helper.tsx index 77fed5961..a2161b6e6 100644 --- a/src/component/Task/helper.tsx +++ b/src/component/Task/helper.tsx @@ -245,7 +245,7 @@ export const getTaskGroupLabels: () => ITaskGroupLabel[] = () => { }, { value: TaskPageType.APPLY_TABLE_PERMISSION, - label: '申请表权限', + label: formatMessage({ id: 'src.component.Task.D7396534', defaultMessage: '申请表权限' }), enabled: !isClient() && !isPersonal, }, ], diff --git a/src/component/helpDoc/doc.tsx b/src/component/helpDoc/doc.tsx index a4e946ff1..e101821d1 100644 --- a/src/component/helpDoc/doc.tsx +++ b/src/component/helpDoc/doc.tsx @@ -642,7 +642,11 @@ export default { ApplyDatabasePermissionChangeTip: (

- {`新建数据库变更类工单(包括导入、模拟数据、数据库变更、影子表同步、SQL 计划、分区计划、数据归档和数据清理)的权限和 SQL窗口执行变更语句的权限(SQL窗口可否执行变更受安全规范配置约束)`} + {formatMessage({ + id: 'src.component.helpDoc.2207D608', + defaultMessage: + '新建数据库变更类工单(包括导入、模拟数据、数据库变更、影子表同步、SQL 计划、分区计划、数据归档和数据清理)的权限和 SQL窗口执行变更语句的权限(SQL窗口可否执行变更受安全规范配置约束)', + })}

), @@ -666,13 +670,31 @@ export default {

), - ApplyTablePermissionQueryTip:

SQL窗口内执行查询语句的权限

, + ApplyTablePermissionQueryTip: ( +

+ {formatMessage({ + id: 'src.component.helpDoc.5D9071C2', + defaultMessage: 'SQL窗口内执行查询语句的权限', + })} +

+ ), - ApplyTablePermissionExportTip:

新建导出和导出结果集工单的权限

, + ApplyTablePermissionExportTip: ( +

+ {formatMessage({ + id: 'src.component.helpDoc.A0958282', + defaultMessage: '新建导出和导出结果集工单的权限', + })} +

+ ), ApplyTablePermissionChangeTip: (

- 新建数据库变更类工单(包括导入、模拟数据、数据库变更、影子表同步、SQL计划、分区计划、数据归档和数据清理)的权限和SQL窗口执行变更语句的权限(SQL窗口可否执行变更受安全规范配置约束) + {formatMessage({ + id: 'src.component.helpDoc.618FF120', + defaultMessage: + '新建数据库变更类工单(包括导入、模拟数据、数据库变更、影子表同步、SQL计划、分区计划、数据归档和数据清理)的权限和SQL窗口执行变更语句的权限(SQL窗口可否执行变更受安全规范配置约束)', + })}

), diff --git a/src/constant/record.ts b/src/constant/record.ts index 05686b9bc..c0840dab0 100644 --- a/src/constant/record.ts +++ b/src/constant/record.ts @@ -140,8 +140,14 @@ export const AuditEventMetaMap = { [AuditEventActionType.DATABASE_PERMISSION_MANAGEMENT]: formatMessage({ id: 'src.page.Secure.Record.RecordPage.5B4CDCAF', }), //'库权限管理' - [AuditEventActionType.APPLY_TABLE_PERMISSION]: '申请表权限', - [AuditEventActionType.TABLE_PERMISSION_MANAGEMENT]: '表权限管理', + [AuditEventActionType.APPLY_TABLE_PERMISSION]: formatMessage({ + id: 'src.constant.A016D539', + defaultMessage: '申请表权限', + }), + [AuditEventActionType.TABLE_PERMISSION_MANAGEMENT]: formatMessage({ + id: 'src.constant.16E15B2D', + defaultMessage: '表权限管理', + }), [AuditEventType.AUTOMATION_RULE_MANAGEMENT]: formatMessage({ id: 'src.page.Secure.Record.RecordPage.B7B36187', }), //'自动授权规则管理' @@ -638,14 +644,38 @@ export const AuditEventActionMap = { [AuditEventActionType.REVOKE_DATABASE_PERMISSION]: formatMessage({ id: 'src.page.Secure.Record.RecordPage.BBF6BE0C', }), //'回收库权限管理' - [AuditEventActionType.APPLY_TABLE_PERMISSION]: '申请表权限', - [AuditEventActionType.CREATE_APPLY_TABLE_PERMISSION_TASK]: '创建申请表权限', - [AuditEventActionType.APPROVE_APPLY_TABLE_PERMISSION_TASK]: '同意申请表权限', - [AuditEventActionType.REJECT_APPLY_TABLE_PERMISSION_TASK]: '拒绝申请表权限', - [AuditEventActionType.STOP_APPLY_TABLE_PERMISSION_TASK]: '停止申请表权限', - [AuditEventActionType.TABLE_PERMISSION_MANAGEMENT]: '表权限管理', - [AuditEventActionType.GRANT_TABLE_PERMISSION]: '新增表权限管理', - [AuditEventActionType.REVOKE_TABLE_PERMISSION]: '回收表权限管理', + [AuditEventActionType.APPLY_TABLE_PERMISSION]: formatMessage({ + id: 'src.constant.6F5D437C', + defaultMessage: '申请表权限', + }), + [AuditEventActionType.CREATE_APPLY_TABLE_PERMISSION_TASK]: formatMessage({ + id: 'src.constant.7CFF0BF7', + defaultMessage: '创建申请表权限', + }), + [AuditEventActionType.APPROVE_APPLY_TABLE_PERMISSION_TASK]: formatMessage({ + id: 'src.constant.EB58961E', + defaultMessage: '同意申请表权限', + }), + [AuditEventActionType.REJECT_APPLY_TABLE_PERMISSION_TASK]: formatMessage({ + id: 'src.constant.77379A9D', + defaultMessage: '拒绝申请表权限', + }), + [AuditEventActionType.STOP_APPLY_TABLE_PERMISSION_TASK]: formatMessage({ + id: 'src.constant.6AF8D624', + defaultMessage: '停止申请表权限', + }), + [AuditEventActionType.TABLE_PERMISSION_MANAGEMENT]: formatMessage({ + id: 'src.constant.B59F26E3', + defaultMessage: '表权限管理', + }), + [AuditEventActionType.GRANT_TABLE_PERMISSION]: formatMessage({ + id: 'src.constant.E15D0656', + defaultMessage: '新增表权限管理', + }), + [AuditEventActionType.REVOKE_TABLE_PERMISSION]: formatMessage({ + id: 'src.constant.7DC84DC5', + defaultMessage: '回收表权限管理', + }), // 自动授权规则 [AuditEventActionType.CREATE_AUTOMATION_RULE]: formatMessage({ id: 'src.page.Secure.Record.RecordPage.61D99657', diff --git a/src/locales/must/strings/zh-CN.json b/src/locales/must/strings/zh-CN.json index c7fd06054..069d84d02 100644 --- a/src/locales/must/strings/zh-CN.json +++ b/src/locales/must/strings/zh-CN.json @@ -4904,5 +4904,193 @@ "src.component.Task.component.CommonDetailModal.BC466037": "行/每秒", "src.component.Task.MutipleAsyncTask.components.Template.8C08DC21": "所属项目", "src.component.Task.MutipleAsyncTask.components.Template.F76B71CA": "模版保存失败", - "src.component.Task.MutipleAsyncTask.components.Template.7F26EEEC": "编辑模版" + "src.component.Task.MutipleAsyncTask.components.Template.7F26EEEC": "编辑模版", + "src.page.Workspace.components.SQLResultSet.A9F2E27A": "共有", + "src.page.Workspace.components.SQLResultSet.097EAD0C": "个 SQL 执行,当前正在执行第", + "src.page.Workspace.components.SQLResultSet.0B5B598B": "个", + "src.page.Workspace.components.SQLResultSet.9BDFC99E": "当前 Trace ID:", + "src.page.Workspace.components.SQLResultSet.4035B347": "查看执行画像", + "src.page.Workspace.components.SQLResultSet.D3F95049": "终 止", + "src.page.Workspace.components.SQLResultSet.73CA790E": "表", + "src.page.Workspace.components.SQLResultSet.455E73CE": "无法申请表权限:没有加入数据库所属项目", + "src.page.Workspace.components.SQLResultSet.3BA312DB": "无法申请表权限:表所属数据库没有归属项目", + "src.page.Workspace.components.SQLResultSet.6CF6ACD1": "申请库权限", + "src.page.Workspace.components.SQLResultSet.44FA6D77": "申请表权限", + "src.page.Workspace.components.SQLResultSet.DDB9284D": "缺少以下数据库表对应权限,请先申请权限", + "src.page.Workspace.components.SQLExplain.F472322D": "预估代价", + "src.page.Workspace.components.SQLExplain.E0965DAC": "实际行", + "src.page.Workspace.components.SQLExplain.E0AB0E4C": "实际代价", + "src.page.Workspace.components.DDLResultSet.E32AB474": "SQL 执行画像", + "src.page.Workspace.components.DDLResultSet.DBFC3F33": "支持 SQL 执行实时剖析,物理执行计划、全链路诊断也一段描述一段描述一段描述", + "src.page.Workspace.components.DDLResultSet.D7F6AF75": "我知道了", + "src.page.Workspace.components.DDLResultSet.22F863D6": "执行画像", + "src.page.Workspace.components.DDLResultSet.0B7666A0": "总耗时:{DBCostTime}", + "src.page.Project.User.3AE67EC2": "管理权限", + "src.page.Project.User.D1A92D2A": "编辑角色", + "src.page.Project.User.ManageModal.946C38DA": "库权限", + "src.page.Project.User.ManageModal.81C0C3D0": "表权限", + "src.page.Project.User.ManageModal.A4F73E8C": "管理权限", + "src.page.Project.User.ManageModal.Table.A3D05C57": "查询", + "src.page.Project.User.ManageModal.Table.D53578CD": "导出", + "src.page.Project.User.ManageModal.Table.070B09D0": "变更", + "src.page.Project.User.ManageModal.Table.7E23C899": "回收后不可撤回", + "src.page.Project.User.ManageModal.Table.C5AD844C": "取消", + "src.page.Project.User.ManageModal.Table.E297BA02": "确定", + "src.page.Project.User.ManageModal.Table.2E8F3BF1": "操作成功", + "src.page.Project.User.ManageModal.Table.CED524BB": "工单授权", + "src.page.Project.User.ManageModal.Table.92D4CD12": "用户授权", + "src.page.Project.User.ManageModal.Table.UserAuthList.9186B355": "数据库", + "src.page.Project.User.ManageModal.Table.UserAuthList.26E39901": "请输入", + "src.page.Project.User.ManageModal.Table.UserAuthList.012DC13E": "表", + "src.page.Project.User.ManageModal.Table.UserAuthList.E7BFBCC8": "请输入", + "src.page.Project.User.ManageModal.Table.UserAuthList.41C6A809": "所属数据源", + "src.page.Project.User.ManageModal.Table.UserAuthList.A644DA9A": "请输入", + "src.page.Project.User.ManageModal.Table.UserAuthList.12F7A572": "权限类型", + "src.page.Project.User.ManageModal.Table.UserAuthList.A02EBD96": "过期时间", + "src.page.Project.User.ManageModal.Table.UserAuthList.40DFC3A2": "状态", + "src.page.Project.User.ManageModal.Table.UserAuthList.D245E1FF": "操作", + "src.page.Project.User.ManageModal.Table.UserAuthList.673AB3C0": "过期超三个月后此权限将被清除", + "src.page.Project.User.ManageModal.Table.UserAuthList.804D4C5D": "回收", + "src.page.Project.User.ManageModal.Table.UserAuthList.DE0222B0": "批量回收", + "src.page.Project.User.ManageModal.Table.TaskApplyList.F9701758": "数据库", + "src.page.Project.User.ManageModal.Table.TaskApplyList.88257A65": "请输入", + "src.page.Project.User.ManageModal.Table.TaskApplyList.8F13E12E": "表", + "src.page.Project.User.ManageModal.Table.TaskApplyList.F38F822F": "请输入", + "src.page.Project.User.ManageModal.Table.TaskApplyList.E80C6744": "所属数据源", + "src.page.Project.User.ManageModal.Table.TaskApplyList.C0ABE640": "请输入", + "src.page.Project.User.ManageModal.Table.TaskApplyList.C0E75C97": "工单编号", + "src.page.Project.User.ManageModal.Table.TaskApplyList.3B1CD3B1": "请输入", + "src.page.Project.User.ManageModal.Table.TaskApplyList.9C75241F": "权限类型", + "src.page.Project.User.ManageModal.Table.TaskApplyList.EC52BFBC": "过期时间", + "src.page.Project.User.ManageModal.Table.TaskApplyList.D8B38717": "状态", + "src.page.Project.User.ManageModal.Table.TaskApplyList.BC1F3BBD": "操作", + "src.page.Project.User.ManageModal.Table.TaskApplyList.8BA76A12": "过期超三个月后此权限将被清除", + "src.page.Project.User.ManageModal.Table.TaskApplyList.9CDE663F": "回收", + "src.page.Project.User.ManageModal.Table.TaskApplyList.AEDC316B": "批量回收", + "src.page.Project.User.ManageModal.Table.Status.F4074114": "已过期", + "src.page.Project.User.ManageModal.Table.Status.3F56D2D7": "即将过期", + "src.page.Project.User.ManageModal.Table.Status.FBAD95E6": "生效中", + "src.page.Project.User.ManageModal.Table.CreateAuth.994F4BA8": "确认取消新增授权吗?", + "src.page.Project.User.ManageModal.Table.CreateAuth.B6C313E1": "新增授权成功!", + "src.page.Project.User.ManageModal.Table.CreateAuth.69B76107": "新增表授权", + "src.page.Project.User.ManageModal.Table.CreateAuth.680C9CFF": "新增授权", + "src.page.Project.User.ManageModal.Table.CreateAuth.9F6C8075": "取消", + "src.page.Project.User.ManageModal.Table.CreateAuth.35C819CB": "新建", + "src.page.Project.User.ManageModal.Table.CreateAuth.0635BFD4": "数据库", + "src.page.Project.User.ManageModal.Table.CreateAuth.5FD0D70D": "权限类型", + "src.page.Project.User.ManageModal.Table.CreateAuth.F34065CE": "请选择", + "src.page.Project.User.ManageModal.Table.CreateAuth.9C0612BE": "权限有效期", + "src.page.Project.User.ManageModal.Table.CreateAuth.705DD31B": "请选择", + "src.page.Project.User.ManageModal.Table.CreateAuth.1D45C292": "请选择", + "src.page.Project.User.ManageModal.Table.CreateAuth.6D949D9E": "结束日期", + "src.page.Project.User.ManageModal.Table.CreateAuth.E589EDA6": "请选择", + "src.page.Project.User.ManageModal.Database.1007E283": "工单授权", + "src.constant.A016D539": "申请表权限", + "src.constant.16E15B2D": "表权限管理", + "src.constant.6F5D437C": "申请表权限", + "src.constant.7CFF0BF7": "创建申请表权限", + "src.constant.EB58961E": "同意申请表权限", + "src.constant.77379A9D": "拒绝申请表权限", + "src.constant.6AF8D624": "停止申请表权限", + "src.constant.B59F26E3": "表权限管理", + "src.constant.E15D0656": "新增表权限管理", + "src.constant.7DC84DC5": "回收表权限管理", + "src.component.helpDoc.2207D608": "新建数据库变更类工单(包括导入、模拟数据、数据库变更、影子表同步、SQL 计划、分区计划、数据归档和数据清理)的权限和 SQL窗口执行变更语句的权限(SQL窗口可否执行变更受安全规范配置约束)", + "src.component.helpDoc.5D9071C2": "SQL窗口内执行查询语句的权限", + "src.component.helpDoc.A0958282": "新建导出和导出结果集工单的权限", + "src.component.helpDoc.618FF120": "新建数据库变更类工单(包括导入、模拟数据、数据库变更、影子表同步、SQL计划、分区计划、数据归档和数据清理)的权限和SQL窗口执行变更语句的权限(SQL窗口可否执行变更受安全规范配置约束)", + "src.component.Task.D7396534": "申请表权限", + "src.component.Task.component.TaskTable.3236150E": "申请表权限", + "src.component.Task.component.TableSelecter.E836E630": "选择表", + "src.component.Task.component.TableSelecter.9995622C": "已选 {selectedTreeDataCount} 项", + "src.component.Task.component.TableSelecter.A56A8B2D": "确定要清空已选对象吗?", + "src.component.Task.component.TableSelecter.C6AF0504": "清空", + "src.component.Task.ApplyTablePermission.DetailContent.9E007486": "数据库", + "src.component.Task.ApplyTablePermission.DetailContent.658E0B9E": "表", + "src.component.Task.ApplyTablePermission.DetailContent.04825B86": "所属数据源", + "src.component.Task.ApplyTablePermission.DetailContent.8CEA0610": "任务编号", + "src.component.Task.ApplyTablePermission.DetailContent.4B4A4E81": "任务类型", + "src.component.Task.ApplyTablePermission.DetailContent.6C1A740A": "申请表权限", + "src.component.Task.ApplyTablePermission.DetailContent.32776504": "项目", + "src.component.Task.ApplyTablePermission.DetailContent.3FE43B61": "表", + "src.component.Task.ApplyTablePermission.DetailContent.64239A78": "权限类型", + "src.component.Task.ApplyTablePermission.DetailContent.FB4B30E0": "权限有效期", + "src.component.Task.ApplyTablePermission.DetailContent.55EE2A17": "申请原因", + "src.component.Task.ApplyTablePermission.DetailContent.2740E99B": "创建人", + "src.component.Task.ApplyTablePermission.DetailContent.7EEDDF7A": "创建时间", + "src.component.Task.ApplyTablePermission.CreateModal.BC4488C7": "永不过期", + "src.component.Task.ApplyTablePermission.CreateModal.82C8FE0E": "查询", + "src.component.Task.ApplyTablePermission.CreateModal.E26609A0": "导出", + "src.component.Task.ApplyTablePermission.CreateModal.D802CFB3": "变更", + "src.component.Task.ApplyTablePermission.CreateModal.F357A49C": "7 天", + "src.component.Task.ApplyTablePermission.CreateModal.DFADB0AB": "30 天", + "src.component.Task.ApplyTablePermission.CreateModal.E06F8910": "90 天", + "src.component.Task.ApplyTablePermission.CreateModal.76C327CA": "半 年", + "src.component.Task.ApplyTablePermission.CreateModal.D6E6AE6E": "1 年", + "src.component.Task.ApplyTablePermission.CreateModal.A004AEF5": "3年", + "src.component.Task.ApplyTablePermission.CreateModal.705AE4C3": "永不过期", + "src.component.Task.ApplyTablePermission.CreateModal.F4D36D95": "自定义", + "src.component.Task.ApplyTablePermission.CreateModal.11B637AA": "确认取消申请表权限吗?", + "src.component.Task.ApplyTablePermission.CreateModal.0D449988": "工单创建成功", + "src.component.Task.ApplyTablePermission.CreateModal.8955ACFE": "暂无项目,请先", + "src.component.Task.ApplyTablePermission.CreateModal.DEF52B23": "加入项目", + "src.component.Task.ApplyTablePermission.CreateModal.7DDD3557": "申请表权限", + "src.component.Task.ApplyTablePermission.CreateModal.95EB40E7": "取消", + "src.component.Task.ApplyTablePermission.CreateModal.AB5C56FA": "新建", + "src.component.Task.ApplyTablePermission.CreateModal.524AEC5C": "项目", + "src.component.Task.ApplyTablePermission.CreateModal.77D8F632": "请选择项目", + "src.component.Task.ApplyTablePermission.CreateModal.DC9A3E27": "请选择", + "src.component.Task.ApplyTablePermission.CreateModal.8A62AFC4": "表", + "src.component.Task.ApplyTablePermission.CreateModal.78B63403": "请选择", + "src.component.Task.ApplyTablePermission.CreateModal.3BCFDC84": "权限类型", + "src.component.Task.ApplyTablePermission.CreateModal.72AFD173": "请选择", + "src.component.Task.ApplyTablePermission.CreateModal.472B1735": "权限有效期", + "src.component.Task.ApplyTablePermission.CreateModal.BC9BE9CE": "请选择", + "src.component.Task.ApplyTablePermission.CreateModal.A206D2B4": "请选择", + "src.component.Task.ApplyTablePermission.CreateModal.06672C99": "结束日期", + "src.component.Task.ApplyTablePermission.CreateModal.55D2BC4D": "请选择", + "src.component.Task.ApplyTablePermission.CreateModal.B2D5729B": "申请原因", + "src.component.Task.ApplyTablePermission.CreateModal.A92A0F62": "请输入原因描述", + "src.component.Task.ApplyTablePermission.CreateModal.319F7B70": "申请原因不超过 200 个字符", + "src.component.Task.ApplyTablePermission.CreateModal.8B90F708": "请输出原因描述", + "src.component.Task.AlterDdlTask.DetailContent.FE4166B2": "行限流", + "src.component.Task.AlterDdlTask.DetailContent.45E8ACBB": "数据大小限流", + "src.component.SQLConfig.1A5CCA98": "SQL 执行", + "src.component.SQLConfig.A614A99E": "SQL 执行", + "src.component.ProfileFlow.C966E64A": "按 DB 耗时排序", + "src.component.ProfileFlow.C4791007": "按内存排序", + "src.component.ProfileFlow.6B28FD92": "按吐行排序", + "src.component.ProfileFlow.customComponents.F4F9EB2A": "数据量:", + "src.component.ProfileFlow.customComponents.2AB1AD68": "Node 执行概览", + "src.component.ProfileFlow.customComponents.0E9A817E": "I/O 统计", + "src.component.ProfileFlow.customComponents.422173C9": "节点属性", + "src.component.ProfileFlow.customComponents.7812E9AE": "{nodeName}的汇总", + "src.component.ProfileFlow.customComponents.C22AD2CB": "{dataName}的汇总", + "src.component.ProfileFlow.customComponents.66C75D66": "耗时 Top5", + "src.component.ProfileFlow.customComponents.5FAB7852": "SQL 执行概览", + "src.component.ProfileFlow.customComponents.E406DF5A": "I/O 统计", + "src.component.ProfileFlow.customComponents.12BFFE42": "缩小", + "src.component.ProfileFlow.customComponents.3057F753": "放大", + "src.component.ProfileFlow.customComponents.89BEEE9E": "实际尺寸", + "src.component.ProfileFlow.customComponents.B32C7D03": "适应宽度", + "src.component.ODCSetting.CFC0C3E8": "快捷键冲突, 请重新输入。", + "src.component.ExecuteSqlDetailModal.38BDF819": "执行详情", + "src.component.ExecuteSqlDetailModal.8A207B02": "执行计划", + "src.component.ExecuteSqlDetailModal.0B221F0A": "全链路诊断", + "src.component.ExecuteSqlDetailModal.14585364": "计划统计", + "src.component.ExecuteSqlDetailModal.D6886430": "当前 SQL 正在执行中,执行完成后可查看", + "src.component.ExecuteSqlDetailModal.68BF8995": "复制", + "src.component.ExecuteSqlDetailModal.69A79B8E": "执行详情", + "src.component.ExecuteSqlDetailModal.BF467954": "执行计划", + "src.component.ExecuteSqlDetailModal.D47F3410": "全链路诊断", + "src.component.ExecuteSqlDetailModal.D11F8620": "计划统计", + "src.component.ExecuteSqlDetailModal.5B8FA08A": "Trace ID 为 \"{modalStoreExecuteSqlDetailDataTraceId}\" 的执行画像", + "src.component.ExecuteSqlDetailModal.A944EAD1": "执行计划详情", + "src.component.ExecuteSqlDetailModal.3AAA9DF9": "Trace 视图", + "src.component.ExecuteSqlDetailModal.D1E28701": "列表视图", + "src.component.ExecuteSqlDetailModal.FB8B6D0B": "列表视图", + "src.component.ExecuteSqlDetailModal.052B3894": "文本视图", + "src.component.ExecuteSqlDetailModal.0DAD5E44": "树视图", + "src.component.ExecuteSqlDetailModal.2129C7A3": "列表视图", + "src.component.ExecuteSqlDetailModal.97782AAE": "文本视图" } diff --git a/src/page/Project/User/ManageModal/Database/index.tsx b/src/page/Project/User/ManageModal/Database/index.tsx index d31c21889..651cb6d6c 100644 --- a/src/page/Project/User/ManageModal/Database/index.tsx +++ b/src/page/Project/User/ManageModal/Database/index.tsx @@ -119,6 +119,7 @@ const ManageModal: React.FC = (props) => { } ), + cancelText: formatMessage({ id: 'src.page.Project.User.ManageModal.2FE8276F' }), //'取消' okText: formatMessage({ id: 'src.page.Project.User.ManageModal.1C087F21' }), //'确定' centered: true, @@ -154,7 +155,12 @@ const ManageModal: React.FC = (props) => {
- 工单授权 + + {formatMessage({ + id: 'src.page.Project.User.ManageModal.Database.1007E283', + defaultMessage: '工单授权', + })} + { formatMessage({ diff --git a/src/page/Project/User/ManageModal/Table/CreateAuth/index.tsx b/src/page/Project/User/ManageModal/Table/CreateAuth/index.tsx index 904f914d2..222193996 100644 --- a/src/page/Project/User/ManageModal/Table/CreateAuth/index.tsx +++ b/src/page/Project/User/ManageModal/Table/CreateAuth/index.tsx @@ -1,3 +1,4 @@ +import { formatMessage } from '@/util/intl'; /* * Copyright 2023 OceanBase * @@ -58,7 +59,10 @@ const CreateModal: React.FC = (props) => { const handleCancel = (hasEdit: boolean) => { if (hasEdit) { Modal.confirm({ - title: '确认取消新增授权吗?', + title: formatMessage({ + id: 'src.page.Project.User.ManageModal.Table.CreateAuth.994F4BA8', + defaultMessage: '确认取消新增授权吗?', + }), centered: true, onOk: () => { handleModalVisizble(false); @@ -89,7 +93,12 @@ const CreateModal: React.FC = (props) => { handleCancel(false); setConfirmLoading(false); if (res) { - message.success('新增授权成功!'); + message.success( + formatMessage({ + id: 'src.page.Project.User.ManageModal.Table.CreateAuth.B6C313E1', + defaultMessage: '新增授权成功!', + }), + ); onSwitchUserTab(); } }) @@ -106,13 +115,19 @@ const CreateModal: React.FC = (props) => { }} type="primary" > - 新增表授权 + {formatMessage({ + id: 'src.page.Project.User.ManageModal.Table.CreateAuth.69B76107', + defaultMessage: '新增表授权', + })} } @@ -140,16 +161,29 @@ const CreateModal: React.FC = (props) => { form={form} onFieldsChange={handleFieldsChange} > - + @@ -157,19 +191,28 @@ const CreateModal: React.FC = (props) => {