This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 29f5c6585 [INLONG-5406][Dashboard] No restrictions are added to the 
input of port numbers, such as dataproxy node (#5444)
29f5c6585 is described below

commit 29f5c6585b885fd2780e6eec3c91538f7ca44b95
Author: Lizhen <[email protected]>
AuthorDate: Wed Aug 10 14:09:52 2022 +0800

    [INLONG-5406][Dashboard] No restrictions are added to the input of port 
numbers, such as dataproxy node (#5444)
---
 inlong-dashboard/src/locales/cn.json                  |  2 ++
 inlong-dashboard/src/locales/en.json                  |  2 ++
 inlong-dashboard/src/pages/Clusters/NodeEditModal.tsx | 19 ++++++++++++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/inlong-dashboard/src/locales/cn.json 
b/inlong-dashboard/src/locales/cn.json
index 60e0e6f49..f10f1afa7 100644
--- a/inlong-dashboard/src/locales/cn.json
+++ b/inlong-dashboard/src/locales/cn.json
@@ -449,6 +449,8 @@
   "pages.Clusters.Node.Port": "端口",
   "pages.Clusters.Node.LastModifier": "最后操作",
   "pages.Clusters.Node.Create": "新建节点",
+  "pages.Clusters.Node.IpRule": "请输入正确的IP地址",
+  "pages.Clusters.Node.PortRule": "请输入正确的端口",
   "pages.Clusters.Pulsar.Tenant": "默认租户",
   "pages.Clusters.Pulsar.ServiceUrlHelper": "用于生产和消费数据",
   "pages.Clusters.Pulsar.AdminUrlHelper": "用于管理(如:创建、修改)租户、命名空间、Topic 和订阅组",
diff --git a/inlong-dashboard/src/locales/en.json 
b/inlong-dashboard/src/locales/en.json
index e1ad7f273..226306f06 100644
--- a/inlong-dashboard/src/locales/en.json
+++ b/inlong-dashboard/src/locales/en.json
@@ -449,6 +449,8 @@
   "pages.Clusters.Node.Port": "Port",
   "pages.Clusters.Node.LastModifier": "LastModifier",
   "pages.Clusters.Node.Create": "Create",
+  "pages.Clusters.Node.IpRule": "Please enter the IP address correctly",
+  "pages.Clusters.Node.PortRule": "Please enter the port address correctly",
   "pages.Clusters.Pulsar.Tenant": "Default Tenant",
   "pages.Clusters.Pulsar.ServiceUrlHelper": "For producing and consuming data",
   "pages.Clusters.Pulsar.AdminUrlHelper": "Used to manage (e.g. create, 
modify) tenants, namespaces, topics and subscription groups",
diff --git a/inlong-dashboard/src/pages/Clusters/NodeEditModal.tsx 
b/inlong-dashboard/src/pages/Clusters/NodeEditModal.tsx
index aca490bd2..167330348 100644
--- a/inlong-dashboard/src/pages/Clusters/NodeEditModal.tsx
+++ b/inlong-dashboard/src/pages/Clusters/NodeEditModal.tsx
@@ -24,6 +24,7 @@ import { ModalProps } from 'antd/es/modal';
 import FormGenerator, { useForm } from '@/components/FormGenerator';
 import { useRequest, useUpdateEffect } from '@/hooks';
 import request from '@/utils/request';
+import rulesPattern from '@/utils/pattern';
 
 export interface NodeEditModalProps extends ModalProps {
   id?: number;
@@ -83,11 +84,27 @@ const NodeEditModal: React.FC<NodeEditModalProps> = ({ id, 
type, clusterId, ...m
         type: 'input',
         label: 'IP',
         name: 'ip',
+        rules: [
+          {
+            pattern: rulesPattern.ip,
+            message: i18n.t('pages.Clusters.Node.IpRule'),
+          },
+        ],
       },
       {
-        type: 'input',
+        type: 'inputnumber',
         label: i18n.t('pages.Clusters.Node.Port'),
         name: 'port',
+        rules: [
+          {
+            pattern: rulesPattern.port,
+            message: i18n.t('pages.Clusters.Node.PortRule'),
+          },
+        ],
+        props: {
+          min: 0,
+          max: 65535,
+        },
       },
       {
         type: 'textarea',

Reply via email to