From 707ff507beef261dee1ccbf64900de9ba8f33251 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 24 Jul 2024 15:19:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20SSH=20=E8=AE=BE=E7=BD=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datasource/form/EditorDetail.vue | 9 +- .../visualized/data/datasource/index.vue | 85 ++++++++++--------- 2 files changed, 50 insertions(+), 44 deletions(-) diff --git a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue index 269614a408..152b7bf44a 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/form/EditorDetail.vue @@ -159,21 +159,22 @@ const authMethodList = [ ] const validateSshHost = (_: any, value: any, callback: any) => { - if ((value === null || value === '') && form.value.configuration.useSSH) { + console.log(value) + if ((value === undefined || value === null || value === '') && form.value.configuration.useSSH) { callback(new Error('SSH主机不能为空')) } return callback() } const validateSshPort = (_: any, value: any, callback: any) => { - if ((value === null || value === '') && form.value.configuration.useSSH) { + if ((value === undefined || value === null || value === '') && form.value.configuration.useSSH) { callback(new Error('SSH端口不能为空')) } return callback() } const validateSshUserName = (_: any, value: any, callback: any) => { - if ((value === null || value === '') && form.value.configuration.useSSH) { + if ((value === undefined || value === null || value === '') && form.value.configuration.useSSH) { callback(new Error('SSH用户名不能为空')) } return callback() @@ -181,7 +182,7 @@ const validateSshUserName = (_: any, value: any, callback: any) => { const validateSshPassword = (_: any, value: any, callback: any) => { if ( - (value === null || value === '') && + (value === undefined || value === null || value === '') && form.value.configuration.useSSH && form.value.configuration.sshType === 'password' ) { diff --git a/core/core-frontend/src/views/visualized/data/datasource/index.vue b/core/core-frontend/src/views/visualized/data/datasource/index.vue index 17704912b4..972690aa8a 100644 --- a/core/core-frontend/src/views/visualized/data/datasource/index.vue +++ b/core/core-frontend/src/views/visualized/data/datasource/index.vue @@ -1299,17 +1299,51 @@ const getMenuList = (val: boolean) => { }} - {{ t('datasource.priority') }} - - - - + + SSH 设置 + + + + + + + + {{ t('datasource.priority') }} + + + + + + - SSH 设置 - - - - -