Skip to content

Commit

Permalink
chore: oic extract
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Jul 30, 2024
1 parent eef4648 commit 46d76cc
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 24 deletions.
5 changes: 4 additions & 1 deletion src/component/ExecuteSqlDetailModal/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export const executeViewOptionsInPlan = [
},
];

export const planTabLabel = '计划统计';
export const planTabLabel = formatMessage({
id: 'src.component.ExecuteSqlDetailModal.1882C007',
defaultMessage: '计划统计',
});

export const planTabOption = [{ value: PLAN_PAGE_TYPE.PLAN_DETAIL, label: planTabLabel }];
9 changes: 7 additions & 2 deletions src/component/SQLConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ const SQLConfig: React.FC<IProps> = function (props) {
width: '100%',
}}
>
Delimiter 设置
{formatMessage({
id: 'src.component.SQLConfig.1D15916D',
defaultMessage: 'Delimiter 设置',
})}
</Row>
<Row style={{ width: '100%' }}>
<DelimiterSelect />
Expand All @@ -97,7 +100,9 @@ const SQLConfig: React.FC<IProps> = function (props) {
/>
</Row>
</div>
<h4>查询结果</h4>
<h4>
{formatMessage({ id: 'src.component.SQLConfig.27EDBEAB', defaultMessage: '查询结果' })}
</h4>
<div className={styles.sqlconfigGroup}>
<Row
style={{
Expand Down
22 changes: 21 additions & 1 deletion src/locales/must/strings/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -5071,5 +5071,25 @@
"src.page.Workspace.components.SQLResultSet.9BDFC99E": "当前 Trace ID:",
"src.component.ProfileFlow.customComponents.3057F753": "放大",
"src.page.Project.User.ManageModal.81C0C3D0": "表权限",
"src.page.Project.User.ManageModal.Table.Status.F4074114": "已过期"
"src.page.Project.User.ManageModal.Table.Status.F4074114": "已过期",
"src.page.Workspace.components.SQLResultSet.6F910473": "待执行",
"src.page.Workspace.components.SQLResultSet.7F598F77": "共有 {count} 个 SQL 执行,当前正在执行第 { count } 个",
"src.page.Workspace.components.DDLResultSet.6477DD60": "集合 SQL 的执行详情、物理执行计划、全链路诊断的多维度视图,帮助快速定位执行慢查询的根因",
"src.page.Workspace.components.DDLResultSet.90E40FCF": "我知道了",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.ACB992B0": "搜索数据库、表、字段、视图等",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.939E5208": "如果检索不到已存在的数据库对象,请先同步元数据",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.5DDBC7F0": "全部搜索结果",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.DB7526F7": "申请库权限",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.E74A1569": "继续搜索",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.64F32480": "申请库权限",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.6656C471": "暂无数据",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.657DE57E": "如果检索不到已存在的数据库对象,请先同步元数据",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.6C33321C": "库内搜索",
"src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.FA5E6855": "定位到数据库 \"{databaseName}\"",
"src.page.Project.User.ManageModal.Table.UserAuthList.AB937C7D": "所属数据库",
"src.page.Project.User.ManageModal.Table.TaskApplyList.47C16695": "所属数据库",
"src.page.Project.User.ManageModal.Database.BC592E63": "访问",
"src.component.SQLConfig.1D15916D": "Delimiter 设置",
"src.component.SQLConfig.27EDBEAB": "查询结果",
"src.component.ExecuteSqlDetailModal.1882C007": "计划统计"
}
5 changes: 4 additions & 1 deletion src/page/Project/User/ManageModal/Database/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export const databasePermissionTypeMap = {
value: DatabasePermissionType.CHANGE,
},
[DatabasePermissionType.ACCESS]: {
text: '访问',
text: formatMessage({
id: 'src.page.Project.User.ManageModal.Database.BC592E63',
defaultMessage: '访问',
}),
value: DatabasePermissionType.ACCESS,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ const getColumns = (params: {
},
{
dataIndex: 'databaseName',
title: '所属数据库',
title: formatMessage({
id: 'src.page.Project.User.ManageModal.Table.TaskApplyList.47C16695',
defaultMessage: '所属数据库',
}),
ellipsis: true,
width: 208,
filterDropdown: (props) => {
Expand Down Expand Up @@ -295,6 +298,7 @@ const TaskApplyList: React.FC<IProps> = (props) => {
onOk: onReclaim,
},
],

getCheckboxProps: (record: ITablePermission) => {
return {
disabled: record?.status === TablePermissionStatus.EXPIRED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ const getColumns = (params: {
},
{
dataIndex: 'databaseName',
title: '所属数据库',
title: formatMessage({
id: 'src.page.Project.User.ManageModal.Table.UserAuthList.AB937C7D',
defaultMessage: '所属数据库',
}),
width: 208,
ellipsis: true,
filterDropdown: (props) => {
Expand Down Expand Up @@ -242,6 +245,7 @@ const UserAuthList: React.FC<IProps> = (props) => {
onOk: onReclaim,
},
],

getCheckboxProps: (record: ITablePermission) => {
return {
disabled: record?.status === TablePermissionStatus.EXPIRED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,27 @@ const DatabaseList = ({
</Button>
);
}
return <span style={{ color: 'var(--text-color-hint)' }}>库内搜索</span>;
return (
<span style={{ color: 'var(--text-color-hint)' }}>
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.6C33321C',
defaultMessage: '库内搜索',
})}
</span>
);
};

if (database && !searchKey) {
return (
<div className={styles.content}>
<div className={styles.databaseItem} onClick={(e) => openSql(e, database)}>
{`定位到数据库 "${database?.name}"`}
{formatMessage(
{
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.FA5E6855',
defaultMessage: '定位到数据库 "${database?.name}"',
},
{ databaseName: database?.name },
)}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const ObjectList = ({
</Tooltip>
</>
);

case DbObjectType.database: {
const { dataSource } = item;
const { name: dataSourceName, dialectType } = dataSource;
Expand Down Expand Up @@ -145,7 +146,12 @@ const ObjectList = ({
<Spin spinning={loading}>
{!objectlist?.dbColumns?.length && !objectlist?.dbObjects?.length ? (
<div className={styles.objectlistBoxEmpty}>
<Empty description={`如果检索不到已存在的数据库对象,请先同步元数据`} />
<Empty
description={formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.939E5208',
defaultMessage: '如果检索不到已存在的数据库对象,请先同步元数据',
})}
/>
</div>
) : (
<div className={styles.objectlistBox}>
Expand All @@ -170,7 +176,10 @@ const ObjectList = ({
type="link"
onClick={() => setActiveKey(i.key)}
>
全部搜索结果
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.5DDBC7F0',
defaultMessage: '全部搜索结果',
})}
</Button>
) : null}
</div>
Expand Down Expand Up @@ -206,6 +215,7 @@ const ObjectList = ({
}}
/>
)}

<span style={{ paddingRight: 4 }}>{object?.name}</span>
<span
style={{
Expand Down Expand Up @@ -287,7 +297,10 @@ const ObjectList = ({
style={{ padding: 0, height: 18 }}
onClick={(e) => applyDbPermission(e, object)}
>
申请库权限
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.DB7526F7',
defaultMessage: '申请库权限',
})}
</Button>
);
};
Expand Down Expand Up @@ -315,7 +328,10 @@ const ObjectList = ({
setSearchKey('');
}}
>
继续搜索
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.E74A1569',
defaultMessage: '继续搜索',
})}
</Button>
);
}
Expand All @@ -325,7 +341,10 @@ const ObjectList = ({
style={{ padding: 0, height: 18 }}
onClick={(e) => applyDbPermission(e, object)}
>
申请库权限
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.64F32480',
defaultMessage: '申请库权限',
})}
</Button>
);
};
Expand Down Expand Up @@ -359,7 +378,16 @@ const ObjectList = ({
<Empty
description={
<>
<div>暂无数据</div>如果检索不到已存在的数据库对象,请先同步元数据
<div>
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.6656C471',
defaultMessage: '暂无数据',
})}
</div>
{formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.657DE57E',
defaultMessage: '如果检索不到已存在的数据库对象,请先同步元数据',
})}
</>
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ const Search = ({
<Input
size="small"
ref={inputRef}
placeholder={`搜索数据库、表、字段、视图等`}
placeholder={formatMessage({
id: 'src.page.Workspace.SideBar.ResourceTree.DatabaseSearchModal.components.ACB992B0',
defaultMessage: '搜索数据库、表、字段、视图等',
})}
onChange={handleChangeDatabaseSearch}
value={searchKey}
/>
Expand Down
23 changes: 17 additions & 6 deletions src/page/Workspace/components/DDLResultSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -692,13 +692,23 @@ const DDLResultSet: React.FC<IProps> = function (props) {
})}
</div>
<div>
集合 SQL 的执行详情、物理执行计划、全链路诊断的多维度视图,帮助快速定位执行慢查询的根因
{formatMessage({
id: 'src.page.Workspace.components.DDLResultSet.6477DD60',
defaultMessage:
'集合 SQL 的执行详情、物理执行计划、全链路诊断的多维度视图,帮助快速定位执行慢查询的根因',
})}
</div>
<img
style={{ width: 280, display: 'block', paddingBottom: 8 }}
src={window.publicPath + `img/profile.jpeg`}
/>
<Link onClick={updateExecutePlanGuideCache}>我知道了</Link>

<Link onClick={updateExecutePlanGuideCache}>
{formatMessage({
id: 'src.page.Workspace.components.DDLResultSet.90E40FCF',
defaultMessage: '我知道了',
})}
</Link>
</div>
);
};
Expand Down Expand Up @@ -759,6 +769,7 @@ const DDLResultSet: React.FC<IProps> = function (props) {
/>
</Tooltip>
))}

{showTrace &&
(isString(obVersion) && OBCompare(obVersion, ODC_TRACE_SUPPORT_VERSION, '>=') ? (
<ToolbarButton
Expand Down Expand Up @@ -1094,10 +1105,10 @@ const DDLResultSet: React.FC<IProps> = function (props) {
) : null}

{/* <ToolbarButton
text={formatMessage({ id: "workspace.window.session.button.refresh" })}
icon={<Icon type="sync" />}
onClick={onRefresh.bind(this, this.state.limit || 1000)}
/> */}
text={formatMessage({ id: "workspace.window.session.button.refresh" })}
icon={<Icon type="sync" />}
onClick={onRefresh.bind(this, this.state.limit || 1000)}
/> */}
</div>
<div className={styles.toolsRight}>
<span className={styles.limit}>
Expand Down
10 changes: 9 additions & 1 deletion src/page/Workspace/components/SQLResultSet/SQLResultLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,15 @@ const runningLogPage = (
<div className={styles.runningSql}>
<Spin style={{ marginBottom: 16 }} />
<Space direction="vertical" size="small" align="center">
<div>{`共有 ${count} 个 SQL 执行,当前正在执行第 ${currentSQLIndex + 1} 个`}</div>
<div>
{formatMessage(
{
id: 'src.page.Workspace.components.SQLResultSet.7F598F77',
defaultMessage: '共有 ${count} 个 SQL 执行,当前正在执行第 ${currentSQLIndex + 1} 个',
},
{ count: count, BinaryExpression1: currentSQLIndex + 1 },
)}
</div>
<div>
{currentExecuteInfo?.traceId && (
<Space size="small">
Expand Down
7 changes: 6 additions & 1 deletion src/page/Workspace/components/SQLResultSet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ const SQLResultSet: React.FC<IProps> = function (props) {
</span>
</span>
),

key: sqlLintTabKey,
children: (
<LintResultTable
Expand Down Expand Up @@ -396,7 +397,10 @@ const SQLResultSet: React.FC<IProps> = function (props) {
if (isLogTab) {
let count = {
[ISqlExecuteResultStatus.WAITING]: {
lable: '待执行',
lable: formatMessage({
id: 'src.page.Workspace.components.SQLResultSet.6F910473',
defaultMessage: '待执行',
}),
count: set?.total,
},
[ISqlExecuteResultStatus.SUCCESS]: {
Expand Down Expand Up @@ -476,6 +480,7 @@ const SQLResultSet: React.FC<IProps> = function (props) {
</span>
</Tooltip>
),

key: set.uniqKey,
children: (
<SQLResultLog
Expand Down

0 comments on commit 46d76cc

Please sign in to comment.