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 设置
+
+
+
+
+
+
+
+
+ {{ nodeInfo.configuration.sshHost }}
+
+
+ {{ nodeInfo.configuration.sshPort }}
+
+
+
+
+ {{
+ nodeInfo.configuration.sshUserName
+ }}
+
+
+
+
+ {{ t('datasource.priority') }}
+
+
+
+
+
+
@@ -1339,35 +1373,6 @@ const getMenuList = (val: boolean) => {
- SSH 设置
-
-
-
-
-
-
-
- {{ nodeInfo.configuration.sshHost }}
-
-
- {{ nodeInfo.configuration.sshPort }}
-
-
-
-
- {{
- nodeInfo.configuration.sshUserName
- }}
-
-
-