mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-05 14:20:25 +08:00
在各个地方支持IPv6
This commit is contained in:
@@ -396,7 +396,7 @@ window.teaweb = {
|
||||
}
|
||||
|
||||
let tooltipFunc = options.tooltip
|
||||
if (typeof(tooltipFunc) != "function") {
|
||||
if (typeof (tooltipFunc) != "function") {
|
||||
throw new Error("'options.tooltip' should be a function")
|
||||
}
|
||||
|
||||
@@ -524,3 +524,17 @@ window.teaweb = {
|
||||
chart.resize()
|
||||
}
|
||||
}
|
||||
|
||||
String.prototype.quoteIP = function () {
|
||||
let ip = this.toString()
|
||||
if (ip.length == 0) {
|
||||
return ""
|
||||
}
|
||||
if (ip.indexOf(":") < 0) {
|
||||
return ip
|
||||
}
|
||||
if (ip.substring(0, 1) == "[") {
|
||||
return ip
|
||||
}
|
||||
return "[" + ip + "]"
|
||||
}
|
||||
Reference in New Issue
Block a user