This is an automated email from the ASF dual-hosted git repository. dockerzhang pushed a commit to branch release-1.3.0 in repository https://gitbox.apache.org/repos/asf/inlong.git
commit fb3dc882cd38b317638b86b659038b25b02ea10f Author: Daniel <[email protected]> AuthorDate: Wed Aug 31 14:24:39 2022 +0800 [INLONG-5749][Dashboard] Fix bad node public params (#5751) --- inlong-dashboard/src/metas/nodes/index.tsx | 10 ---------- inlong-dashboard/src/pages/Clusters/CreateModal.tsx | 5 +++-- .../src/pages/GroupDetail/DataSources/DetailModal.tsx | 6 ++++-- .../src/pages/GroupDetail/DataStorage/DetailModal.tsx | 6 ++++-- inlong-dashboard/src/pages/Nodes/DetailModal.tsx | 4 +++- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/inlong-dashboard/src/metas/nodes/index.tsx b/inlong-dashboard/src/metas/nodes/index.tsx index 774d4d750..c2d47b5fa 100644 --- a/inlong-dashboard/src/metas/nodes/index.tsx +++ b/inlong-dashboard/src/metas/nodes/index.tsx @@ -64,16 +64,6 @@ const defaultCommonFields: FieldItemType[] = [ rules: [{ required: true }], _renderTable: true, }, - { - type: 'input', - label: 'URL', - name: 'url', - }, - { - type: 'input', - label: 'Token', - name: 'token', - }, { type: 'textarea', label: i18n.t('meta.Nodes.Description'), diff --git a/inlong-dashboard/src/pages/Clusters/CreateModal.tsx b/inlong-dashboard/src/pages/Clusters/CreateModal.tsx index d266db4fc..1bafc2ca2 100644 --- a/inlong-dashboard/src/pages/Clusters/CreateModal.tsx +++ b/inlong-dashboard/src/pages/Clusters/CreateModal.tsx @@ -77,11 +77,12 @@ const Comp: React.FC<Props> = ({ id, ...modalProps }) => { useUpdateEffect(() => { if (modalProps.visible) { - // open - form.resetFields(); if (id) { getData(id); } + } else { + form.resetFields(); + setType(Clusters[0].value); } }, [modalProps.visible]); diff --git a/inlong-dashboard/src/pages/GroupDetail/DataSources/DetailModal.tsx b/inlong-dashboard/src/pages/GroupDetail/DataSources/DetailModal.tsx index d44dc3386..3b090d3c4 100644 --- a/inlong-dashboard/src/pages/GroupDetail/DataSources/DetailModal.tsx +++ b/inlong-dashboard/src/pages/GroupDetail/DataSources/DetailModal.tsx @@ -106,9 +106,11 @@ const Comp: React.FC<Props> = ({ id, inlongGroupId, ...modalProps }) => { useUpdateEffect(() => { if (modalProps.visible) { // open - form.resetFields(); // Note that it will cause the form to remount to initiate a select request if (id) { getData(id); + } else { + form.resetFields(); // Note that it will cause the form to remount to initiate a select request + setType(sources[0].value); } } else { setCurrentValues({}); @@ -163,7 +165,7 @@ const Comp: React.FC<Props> = ({ id, inlongGroupId, ...modalProps }) => { type: 'radio', label: t('meta.Sources.Type'), rules: [{ required: true }], - initialValue: type, + initialValue: sources[0].value, props: { disabled: !!id, options: sources, diff --git a/inlong-dashboard/src/pages/GroupDetail/DataStorage/DetailModal.tsx b/inlong-dashboard/src/pages/GroupDetail/DataStorage/DetailModal.tsx index 73ca25892..376eb3881 100644 --- a/inlong-dashboard/src/pages/GroupDetail/DataStorage/DetailModal.tsx +++ b/inlong-dashboard/src/pages/GroupDetail/DataStorage/DetailModal.tsx @@ -88,9 +88,11 @@ const Comp: React.FC<DetailModalProps> = ({ inlongGroupId, id, ...modalProps }) useUpdateEffect(() => { if (modalProps.visible) { // open - form.resetFields(); // Note that it will cause the form to remount to initiate a select request if (id) { getData(id); + } else { + form.resetFields(); // Note that it will cause the form to remount to initiate a select request + setSinkType(Sinks[0].value); } } else { setCurrentValues({}); @@ -153,7 +155,7 @@ const Comp: React.FC<DetailModalProps> = ({ inlongGroupId, id, ...modalProps }) type: 'select', label: t('meta.Sinks.SinkType'), rules: [{ required: true }], - initialValue: sinkType, + initialValue: Sinks[0].value, props: { disabled: !!id, options: Sinks, diff --git a/inlong-dashboard/src/pages/Nodes/DetailModal.tsx b/inlong-dashboard/src/pages/Nodes/DetailModal.tsx index b6c672ada..c4426a3e0 100644 --- a/inlong-dashboard/src/pages/Nodes/DetailModal.tsx +++ b/inlong-dashboard/src/pages/Nodes/DetailModal.tsx @@ -78,10 +78,12 @@ const Comp: React.FC<Props> = ({ id, ...modalProps }) => { useUpdateEffect(() => { if (modalProps.visible) { // open - form.resetFields(); if (id) { getData(id); } + } else { + form.resetFields(); + setType(nodes[0].value); } }, [modalProps.visible]);
