简化IP名单中创建IP操作/支持IP以CIDR方式显示

This commit is contained in:
GoEdgeLab
2024-04-13 16:48:24 +08:00
parent 3b3763d35b
commit 06ddd03dd8
8 changed files with 321 additions and 35 deletions

View File

@@ -1 +1,15 @@
package models
// ComposeValue 组合原始值
func (this *IPItem) ComposeValue() string {
if len(this.Value) > 0 {
return this.Value
}
// 兼容以往版本
if len(this.IpTo) > 0 {
return this.IpFrom + "-" + this.IpTo
}
return this.IpFrom
}