This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 0e1047918 [INLONG-7032][Dashboard] Group creation page split basic
information and MQ information (#7033)
0e1047918 is described below
commit 0e104791855dfafd2289288f339e56fc40346b66
Author: Daniel <[email protected]>
AuthorDate: Fri Dec 23 15:51:38 2022 +0800
[INLONG-7032][Dashboard] Group creation page split basic information and MQ
information (#7033)
Co-authored-by: Charles Zhang <[email protected]>
---
inlong-dashboard/src/locales/cn.json | 2 ++
inlong-dashboard/src/locales/en.json | 6 +++-
.../src/pages/GroupDetail/Info/config.tsx | 32 ++++++++++++++++++++--
.../src/pages/GroupDetail/Info/index.tsx | 2 +-
4 files changed, 38 insertions(+), 4 deletions(-)
diff --git a/inlong-dashboard/src/locales/cn.json
b/inlong-dashboard/src/locales/cn.json
index b454a8a1f..54382ab28 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -456,6 +456,8 @@
"pages.GroupDashboard.ConfirmDelete": "确认删除吗",
"pages.GroupDashboard.Create": "新建数据流组",
"pages.GroupDashboard.SuccessfullyDeleted": "删除成功",
+ "pages.GroupDetail.Info.Basic": "基础信息",
+ "pages.GroupDetail.Info.Mq": "MQ 信息",
"pages.GroupDetail.Info.Back": "返回",
"pages.GroupDetail.Info.NextStep": "下一步",
"pages.GroupDetail.Info.DataStreams": "数据流",
diff --git a/inlong-dashboard/src/locales/en.json
b/inlong-dashboard/src/locales/en.json
index 4a19aa09a..64ae4a6f5 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -417,6 +417,9 @@
"meta.Nodes.Iceberg.Url": "URL",
"meta.Nodes.Iceberg.Warehouse": "Warehouse",
"meta.Nodes.Iceberg.CatalogType": "Catalog Type",
+ "meta.Nodes.ClickHouse.Username": "Username",
+ "meta.Nodes.ClickHouse.Password": "Password",
+ "meta.Nodes.ClickHouse.Url": "URL",
"meta.Nodes.StarRocks.Username": "Username",
"meta.Nodes.StarRocks.Password": "Password",
"meta.Nodes.StarRocks.Url": "URL",
@@ -453,6 +456,8 @@
"pages.GroupDashboard.ConfirmDelete": "Confirm delete?",
"pages.GroupDashboard.Create": "Create",
"pages.GroupDashboard.SuccessfullyDeleted": "Successfully deleted",
+ "pages.GroupDetail.Info.Basic": "Basic",
+ "pages.GroupDetail.Info.Mq": "MQ",
"pages.GroupDetail.Info.Back": "Back",
"pages.GroupDetail.Info.NextStep": "Next",
"pages.GroupDetail.Info.DataStreams": "Data streams",
@@ -573,7 +578,6 @@
"pages.ConsumeDashboard.status.Passed": "Passed",
"pages.ConsumeDashboard.status.Cancelled": "Cancelled",
"pages.ConsumeDashboard.NewSubscribe": "Create",
- "pages.ConsumeDetail.Info.config.ConsumerGroupID": "Consumer group ID",
"pages.ConsumeDetail.SubscribeDetails": "Subscription Detail",
"pages.Clusters.Type": "Type",
"pages.Clusters.TypeAll": "All",
diff --git a/inlong-dashboard/src/pages/GroupDetail/Info/config.tsx
b/inlong-dashboard/src/pages/GroupDetail/Info/config.tsx
index 59634c38f..e895cefdf 100644
--- a/inlong-dashboard/src/pages/GroupDetail/Info/config.tsx
+++ b/inlong-dashboard/src/pages/GroupDetail/Info/config.tsx
@@ -17,7 +17,9 @@
* under the License.
*/
-import { useMemo } from 'react';
+import React, { useCallback, useMemo } from 'react';
+import { Divider } from 'antd';
+import i18n from '@/i18n';
import { useLoadMeta, GroupMetaType } from '@/metas';
import { excludeObjectArray } from '@/utils';
@@ -31,7 +33,7 @@ export const useFormContent = ({ mqType, editing, isCreate,
isUpdate }) => {
const excludeKeys = ['ensemble'].concat(isCreate ? 'mqResource' : '');
const fields = excludeObjectArray(excludeKeys, entityFields || []);
- return isCreate
+ const formContent = isCreate
? fields.map(item => {
if (item.name === 'inlongGroupId' && isUpdate) {
return {
@@ -60,6 +62,32 @@ export const useFormContent = ({ mqType, editing, isCreate,
isUpdate }) => {
rules: t === 'text' ? undefined : item.rules,
};
});
+
+ const { Entity: DefaultEntity } = useLoadMeta<GroupMetaType>('group', '');
+
+ const isMqKey = useCallback(
+ formName => {
+ const defaultGroupKeysI18nMap = DefaultEntity?.I18nMap || {};
+ return !defaultGroupKeysI18nMap[formName] || formName === 'mqType';
+ },
+ [DefaultEntity?.I18nMap],
+ );
+
+ const basicFormContent = formContent.filter(item => !isMqKey(item.name));
+ const mqFormContent = formContent.filter(item => isMqKey(item.name));
+
+ return [
+ {
+ type: <Divider
orientation="left">{i18n.t('pages.GroupDetail.Info.Basic')}</Divider>,
+ col: 24,
+ },
+ ...basicFormContent,
+ {
+ type: <Divider
orientation="left">{i18n.t('pages.GroupDetail.Info.Mq')}</Divider>,
+ col: 24,
+ },
+ ...mqFormContent,
+ ];
};
function transType(editing: boolean, conf) {
diff --git a/inlong-dashboard/src/pages/GroupDetail/Info/index.tsx
b/inlong-dashboard/src/pages/GroupDetail/Info/index.tsx
index f80b12e41..297ebfde0 100644
--- a/inlong-dashboard/src/pages/GroupDetail/Info/index.tsx
+++ b/inlong-dashboard/src/pages/GroupDetail/Info/index.tsx
@@ -127,7 +127,7 @@ const Comp = ({ inlongGroupId, readonly, isCreate }: Props,
ref) => {
/>
{!isCreate && !readonly && (
- <div style={{ position: 'absolute', top: 0, right: 0 }}>
+ <div>
{editing ? (
<Space>
<Button type="primary" onClick={onSave}>