Skip to content

Commit

Permalink
chore: oic extract
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Sep 23, 2024
1 parent 3ef2c68 commit 9ed4294
Show file tree
Hide file tree
Showing 56 changed files with 1,741 additions and 304 deletions.
5 changes: 3 additions & 2 deletions src/component/CommonIDE/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,11 @@ class CommonIDE extends React.PureComponent<ICommonIDEProps, ICommonIDEState> {
key: `resultset-${set.uniqKey}`,
label: this.getResultSetTitle(
set.executeSql,
`${formatMessage({
formatMessage({
id: 'workspace.window.sql.result',
defaultMessage: '结果',
})}${i + 1}`,
}) +
(i + 1),
),
children:
!!set.columns?.length &&
Expand Down
31 changes: 28 additions & 3 deletions src/component/ConnectionPopover/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const ConnectionPopover: React.FC<{
content={database?.environment?.name}
color={database?.environment?.style?.toLowerCase()}
/>

<DataBaseStatusIcon item={database} />
<div className={styles.ellipsis} title={database?.name}>{`${database?.name}`}</div>
</div>
Expand All @@ -83,9 +84,33 @@ const ConnectionPopover: React.FC<{
}}
className={styles.ellipsis}
title={database?.alias}
>{`逻辑库别名: ${database?.alias}`}</div>
<div>{`项目: ${database?.project?.name}`}</div>
<div>{`类型: ${ConnectTypeText[database?.connectType]}`}</div>
>
{formatMessage(
{
id: 'src.component.ConnectionPopover.F992A18D',
defaultMessage: '逻辑库别名: {databaseAlias}',
},
{ databaseAlias: database?.alias },
)}
</div>
<div>
{formatMessage(
{
id: 'src.component.ConnectionPopover.7A5FFB14',
defaultMessage: '项目: {databaseProjectName}',
},
{ databaseProjectName: database?.project?.name },
)}
</div>
<div>
{formatMessage(
{
id: 'src.component.ConnectionPopover.8E155F86',
defaultMessage: '类型: {ConnectTypeTextDatabaseConnectType}',
},
{ ConnectTypeTextDatabaseConnectType: ConnectTypeText[database?.connectType] },
)}
</div>
</Space>
</div>
);
Expand Down
38 changes: 33 additions & 5 deletions src/component/Empty/DataSourceEmpty/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { formatMessage } from '@/util/intl';
import { Acess, createPermission } from '@/component/Acess';
import { actionTypes, IManagerResourceType } from '@/d.ts';
import TitleButton from '@/page/Datasource/Datasource/Content/TitleButton';
Expand All @@ -14,23 +15,50 @@ export function DataSourceEmpty({ extra }) {
<Acess
fallback={
<div className={styles.subTitle}>
<div>{'请联系管理员添加数据源;'}</div>
<div>{'也可尝试切换至个人空间,自由管理个人数据源'}</div>
<div>
{formatMessage({
id: 'src.component.Empty.DataSourceEmpty.54644C36',
defaultMessage: '请联系管理员添加数据源;',
})}
</div>
<div>
{formatMessage({
id: 'src.component.Empty.DataSourceEmpty.809DB9AA',
defaultMessage: '也可尝试切换至个人空间,自由管理个人数据源',
})}
</div>
</div>
}
{...createPermission(IManagerResourceType.project, actionTypes.create)}
>
<div className={styles.subTitle}>
<div>{'支持管理 OceanBase 、 MySQL 等数据源;'}</div>
<div>{'可将数据源下的数据库添加到对应的项目内,供团队协同开发使用'}</div>
<div>
{formatMessage({
id: 'src.component.Empty.DataSourceEmpty.46EEDFA4',
defaultMessage: '支持管理 OceanBase 、 MySQL 等数据源;',
})}
</div>
<div>
{formatMessage({
id: 'src.component.Empty.DataSourceEmpty.811D4040',
defaultMessage: '可将数据源下的数据库添加到对应的项目内,供团队协同开发使用',
})}
</div>
</div>
</Acess>
);
};
return (
<Result
status={'success'}
title={<div className={styles.title}>暂无数据源</div>}
title={
<div className={styles.title}>
{formatMessage({
id: 'src.component.Empty.DataSourceEmpty.4FF7D961',
defaultMessage: '暂无数据源',
})}
</div>
}
subTitle={renderSubTitle()}
icon={
<img
Expand Down
43 changes: 38 additions & 5 deletions src/component/Empty/ProjectEmpty/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import { formatMessage } from '@/util/intl';
import { Result } from 'antd';
import styles from './index.less';

export default function ProjectEmpty({ type, renderActionButton }) {
const renderTitle = (type) => {
switch (type) {
case 'all':
return <div className={styles.title}>暂无项目</div>;
return (
<div className={styles.title}>
{formatMessage({
id: 'src.component.Empty.ProjectEmpty.9FECA85F',
defaultMessage: '暂无项目',
})}
</div>
);
case 'deleted':
return <div className={styles.title}>暂无归档项目</div>;
return (
<div className={styles.title}>
{formatMessage({
id: 'src.component.Empty.ProjectEmpty.328FFA9A',
defaultMessage: '暂无归档项目',
})}
</div>
);
default:
return '';
}
Expand All @@ -18,16 +33,33 @@ export default function ProjectEmpty({ type, renderActionButton }) {
case 'all':
return (
<div className={styles.subTitle}>
<div>{'作为业务协同的最小协作单元,提供统一管控规则'}</div>
<div>{'保障团队的高效协同和数据源安全变更'}</div>
<div>
{formatMessage({
id: 'src.component.Empty.ProjectEmpty.027DBCF9',
defaultMessage: '作为业务协同的最小协作单元,提供统一管控规则',
})}
</div>
<div>
{formatMessage({
id: 'src.component.Empty.ProjectEmpty.C753B59D',
defaultMessage: '保障团队的高效协同和数据源安全变更',
})}
</div>
</div>
);

case 'deleted':
return (
<div className={styles.subTitle}>
<div>{'项目归档后,将不再支持任何协同开发活动'}</div>
<div>
{formatMessage({
id: 'src.component.Empty.ProjectEmpty.C35E7838',
defaultMessage: '项目归档后,将不再支持任何协同开发活动',
})}
</div>
</div>
);

default:
return;
}
Expand All @@ -46,6 +78,7 @@ export default function ProjectEmpty({ type, renderActionButton }) {
/>
}
/>

{type === 'all' && renderActionButton()}
</>
);
Expand Down
61 changes: 53 additions & 8 deletions src/component/Empty/SQLConsoleEmpty/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { formatMessage } from '@/util/intl';
import { SQLConsoleResourceType } from '@/common/datasource/interface';
import NewDatasourceButton from '@/page/Datasource/Datasource/NewDatasourceDrawer/NewButton';
import ResourceTreeContext from '@/page/Workspace/context/ResourceTreeContext';
Expand All @@ -19,32 +20,76 @@ export function SQLConsoleEmpty(props: IProps) {
case SQLConsoleResourceType.DataSource:
return login.isPrivateSpace() ? (
<div>
<div className={styles.description}>暂无数据源</div>
<div className={styles.description}>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.7F1533E2',
defaultMessage: '暂无数据源',
})}
</div>
<NewDatasourceButton onSuccess={() => context?.reloadDatasourceList()} />
</div>
) : null;
case SQLConsoleResourceType.Script:
return (
<div>
<div className={styles.description}>暂无数据</div>
<div className={styles.description}>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.25373981',
defaultMessage: '暂无数据',
})}
</div>
<div className={styles.tips}>
<div>可上传多个本地脚本文件 (.sql 文件) ,</div>
<div>或将 SQL 窗口保存为脚本</div>
<div>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.84DB6D00',
defaultMessage: '可上传多个本地脚本文件 (.sql 文件) ,',
})}
</div>
<div>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.AE01D1B2',
defaultMessage: '或将 SQL 窗口保存为脚本',
})}
</div>
</div>
</div>
);

case SQLConsoleResourceType.Snippet:
return (
<div>
<div className={styles.description}>暂无数据</div>
<div className={styles.description}>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.3A490E08',
defaultMessage: '暂无数据',
})}
</div>
<div className={styles.tips}>
<div>支持新建不同类型 (DDL/DML等) 等代码片段</div>
<div>可在 SQL 窗口内快速引用</div>
<div>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.52783297',
defaultMessage: '支持新建不同类型 (DDL/DML等) 等代码片段',
})}
</div>
<div>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.8786FBDD',
defaultMessage: '可在 SQL 窗口内快速引用',
})}
</div>
</div>
</div>
);

default:
return <div className={styles.description}>暂无数据</div>;
return (
<div className={styles.description}>
{formatMessage({
id: 'src.component.Empty.SQLConsoleEmpty.320656B1',
defaultMessage: '暂无数据',
})}
</div>
);
}
};
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={renderDescription()} />;
Expand Down
13 changes: 11 additions & 2 deletions src/component/Empty/ScanRuleEmpty/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ export default function ScanRuleEmpty({ showActionButton }) {
<Empty
description={
<div>
<div>风险识别规则是通过表达式配置的规则,会决定工单的审批流程。</div>
<div>
如:「环境 等于 生产」将会匹配在「生产」环境中执行的工单,并执行对应的审批流程
{formatMessage({
id: 'src.component.Empty.ScanRuleEmpty.1A1158CB',
defaultMessage: '风险识别规则是通过表达式配置的规则,会决定工单的审批流程。',
})}
</div>
<div>
{formatMessage({
id: 'src.component.Empty.ScanRuleEmpty.E341691D',
defaultMessage:
'如:「环境 等于 生产」将会匹配在「生产」环境中执行的工单,并执行对应的审批流程',
})}
</div>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,12 +431,17 @@ const CreateModal: React.FC<IProps> = (props) => {
</Form.Item>
{showSelectLogicDBTip && (
<Alert
message="已选数据库中包含逻辑库,审批通过后将默认获得关联物理库的权限;逻辑库仅支持 DDL 变更。"
message={formatMessage({
id: 'src.component.Task.ApplyDatabasePermission.CreateModal.F5428F5B',
defaultMessage:
'已选数据库中包含逻辑库,审批通过后将默认获得关联物理库的权限;逻辑库仅支持 DDL 变更。',
})}
type="info"
showIcon
style={{ margin: '4px 0px' }}
/>
)}

<Form.Item
name="types"
label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,11 @@ const CharItem: React.FC<ICharItemProps> = forwardRef<FormInstance, ICharItemPro
min={0}
formatter={
(value) =>
`${value}${formatMessage({
value +
formatMessage({
id: 'odc.ruleItems.CharItem.Days',
defaultMessage: '天',
})}` // 天
}) // 天
}
parser={(value) =>
value.replace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ const DateItem: React.FC<IDateItemProps> = forwardRef<FormInstance, IDateItemPro
min={0}
formatter={
(value) =>
`${value}${formatMessage({
value +
formatMessage({
id: 'odc.ruleItems.DateItem.Days',
defaultMessage: '天',
})}` // 天
}) // 天
}
parser={(value) =>
value.replace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ function getTiltleByFileType(fileType) {
});
}
case IMPORT_TYPE.DIR: {
return '点击或将目录文件拖拽到这里上传';
return formatMessage({
id: 'src.component.Task.ImportTask.CreateModal.ImportForm.FileSelecterPanel.051A8387',
defaultMessage: '点击或将目录文件拖拽到这里上传',
});
}
}
}
Expand Down Expand Up @@ -92,7 +95,10 @@ function getTipByFileType(fileType) {
.join(',');
}
case IMPORT_TYPE.DIR: {
return '仅支持上传 ODC 导出的目录文件';
return formatMessage({
id: 'src.component.Task.ImportTask.CreateModal.ImportForm.FileSelecterPanel.272612BC',
defaultMessage: '仅支持上传 ODC 导出的目录文件',
});
}
}
}
Expand Down Expand Up @@ -229,9 +235,13 @@ const FileSelecterPanel: React.FC<IProps> = function ({ isSingleImport, form })
}
</Option>
)}

{isClient() && (
<Option key={IMPORT_TYPE.DIR} value={IMPORT_TYPE.DIR}>
目录文件
{formatMessage({
id: 'src.component.Task.ImportTask.CreateModal.ImportForm.FileSelecterPanel.D738185C',
defaultMessage: '目录文件',
})}
</Option>
)}
</Select>
Expand Down
Loading

0 comments on commit 9ed4294

Please sign in to comment.