From 7dff0eb27e3c8b84cf428bc157a88f18a4754d11 Mon Sep 17 00:00:00 2001 From: 28170 Date: Thu, 7 Nov 2024 10:04:49 +0800 Subject: [PATCH 1/2] Switching multiple data sources, displaying field errors --- .../src/views/datasource/list/use-form.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts index 7a804d3de9d4..a543365263b9 100644 --- a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts +++ b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts @@ -269,6 +269,15 @@ export function useForm(id?: number) { } else { state.showPrincipal = false } + + state.showRestEndpoint = false + state.showNamespace = false + state.showKubeConfig = false + state.showAccessKeyId = false + state.showAccessKeySecret = false + state.showRegionId = false + state.showEndpoint = false + if ( type === 'SSH' || type === 'ZEPPELIN' || From bbdf2194712ad762fe6097c1bb82d8466539d0d5 Mon Sep 17 00:00:00 2001 From: 28170 Date: Fri, 8 Nov 2024 15:45:28 +0800 Subject: [PATCH 2/2] fix --- .../src/views/datasource/list/use-form.ts | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts index a543365263b9..4b229868a642 100644 --- a/dolphinscheduler-ui/src/views/datasource/list/use-form.ts +++ b/dolphinscheduler-ui/src/views/datasource/list/use-form.ts @@ -270,14 +270,6 @@ export function useForm(id?: number) { state.showPrincipal = false } - state.showRestEndpoint = false - state.showNamespace = false - state.showKubeConfig = false - state.showAccessKeyId = false - state.showAccessKeySecret = false - state.showRegionId = false - state.showEndpoint = false - if ( type === 'SSH' || type === 'ZEPPELIN' || @@ -296,6 +288,8 @@ export function useForm(id?: number) { state.showHost = false state.showPort = false state.showRestEndpoint = true + } else { + state.showRestEndpoint = false } if ( type === 'SAGEMAKER' || @@ -308,18 +302,33 @@ export function useForm(id?: number) { if (type === 'K8S') { state.showNamespace = true state.showKubeConfig = true + } else { + state.showNamespace = false + state.showKubeConfig = false } if (type === 'ALIYUN_SERVERLESS_SPARK') { state.showAccessKeyId = true state.showAccessKeySecret = true state.showRegionId = true state.showEndpoint = true + } else { + state.showAccessKeyId = false + state.showAccessKeySecret = false + state.showRegionId = false + state.showEndpoint = false } } else { state.showDataBaseName = true state.requiredDataBase = true state.showJDBCConnectParameters = true state.showPublicKey = false + state.showRestEndpoint = false + state.showNamespace = false + state.showKubeConfig = false + state.showAccessKeyId = false + state.showAccessKeySecret = false + state.showRegionId = false + state.showEndpoint = false } }