From 352bf9cda2421af73ce374e29e70ddd402a501dd Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sat, 18 Mar 2023 11:36:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=8A=82=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=BB=8E=E8=8A=82=E7=82=B9=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=B8=AD=E6=8F=90=E5=8F=96=E8=8A=82=E7=82=B9IP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/views/@default/clusters/cluster/createNode.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/views/@default/clusters/cluster/createNode.js b/web/views/@default/clusters/cluster/createNode.js index af704677..4183d80b 100644 --- a/web/views/@default/clusters/cluster/createNode.js +++ b/web/views/@default/clusters/cluster/createNode.js @@ -174,10 +174,13 @@ Tea.context(function () { this.defaultIP = "" this.changeName = function () { - if (this.validateIP(this.name)) { - this.defaultIP = this.name - } else { - this.defaultIP = "" + let matchIP = this.name.match(/(\d{1,3}\.){3}\d{1,3}/) + if (matchIP != null) { + if (this.validateIP(matchIP[0])) { + this.defaultIP = matchIP[0] + } else { + this.defaultIP = "" + } } }