mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-13 03:40:27 +08:00
创建节点时自动从节点名称中提取节点IP
This commit is contained in:
@@ -174,12 +174,15 @@ Tea.context(function () {
|
||||
|
||||
this.defaultIP = ""
|
||||
this.changeName = function () {
|
||||
if (this.validateIP(this.name)) {
|
||||
this.defaultIP = this.name
|
||||
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 = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.validateIP = function (v) {
|
||||
// 目前只支持ipv4
|
||||
|
||||
Reference in New Issue
Block a user