diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js
index 87f144a38a..b7b413eab3 100644
--- a/frontend/src/lang/en.js
+++ b/frontend/src/lang/en.js
@@ -1154,6 +1154,7 @@ export default {
please_input_acquire_increment: 'Please enter the growth number',
please_input_connect_timeout: 'Please enter the connection timeout (seconds)',
no_less_then_0: 'Parameters in advanced settings cannot be less than zero',
+ port_no_less_then_0: 'Port cannot be less than zero',
priority: 'Advanced setting',
extra_params: 'Extra JDBC connection string'
},
diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js
index 5828303b8e..cfa12e7baa 100644
--- a/frontend/src/lang/tw.js
+++ b/frontend/src/lang/tw.js
@@ -1157,6 +1157,7 @@ export default {
please_input_acquire_increment: '請輸入增長數',
please_input_connect_timeout: '請輸入連接超時(秒)',
no_less_then_0: '高級設置中的參數不能小于零',
+ port_no_less_then_0: '端口不能小於零',
priority: '高級設置',
extra_params: '額外的JDBC連接字符串'
},
diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js
index e90e886d72..1a3fb7bd53 100644
--- a/frontend/src/lang/zh.js
+++ b/frontend/src/lang/zh.js
@@ -1158,6 +1158,7 @@ export default {
please_input_acquire_increment: '请输入增长数',
please_input_connect_timeout: '请输入连接超时(秒)',
no_less_then_0: '高级设置中的参数不能小于零',
+ port_no_less_then_0: '端口不能小于零',
priority: '高级设置',
data_mode: '数据模式',
direct: '直连模式',
diff --git a/frontend/src/views/system/datasource/form.vue b/frontend/src/views/system/datasource/form.vue
index 124eda1f32..0c37c67a0b 100644
--- a/frontend/src/views/system/datasource/form.vue
+++ b/frontend/src/views/system/datasource/form.vue
@@ -56,8 +56,8 @@
-
-
+
+
@@ -225,6 +225,10 @@ export default {
this.$message.error(this.$t('datasource.please_choose_schema'))
return
}
+ if (this.form.configuration.dataSourceType === 'jdbc' && this.form.configuration.port <= 0) {
+ this.$message.error(this.$t('datasource.port_no_less_then_0'))
+ return
+ }
if (this.form.configuration.initialPoolSize < 0 || this.form.configuration.minPoolSize < 0 || this.form.configuration.maxPoolSize < 0 || this.form.configuration.maxIdleTime < 0 ||
this.form.configuration.acquireIncrement < 0 || this.form.configuration.idleConnectionTestPeriod < 0 || this.form.configuration.connectTimeout < 0) {
this.$message.error(this.$t('datasource.no_less_then_0'))