diff --git a/internal/web/actions/default/log/exportExcel.go b/internal/web/actions/default/log/exportExcel.go index c20dfa3f..e97454f8 100644 --- a/internal/web/actions/default/log/exportExcel.go +++ b/internal/web/actions/default/log/exportExcel.go @@ -4,7 +4,6 @@ import ( "bytes" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/iwind/TeaGo/lists" timeutil "github.com/iwind/TeaGo/utils/time" "github.com/tealeg/xlsx/v3" "strconv" @@ -69,17 +68,13 @@ func (this *ExportExcelAction) RunGet(params struct { return } if regionResp.IpRegion != nil { - pieces := []string{} - if len(regionResp.IpRegion.Country) > 0 { - pieces = append(pieces, regionResp.IpRegion.Country) + regionName = regionResp.IpRegion.Summary + + // remove isp from regionName + var index = strings.LastIndex(regionName, "|") + if index > 0 { + regionName = regionName[:index] } - if len(regionResp.IpRegion.Province) > 0 && !lists.ContainsString(pieces, regionResp.IpRegion.Province) { - pieces = append(pieces, regionResp.IpRegion.Province) - } - if len(regionResp.IpRegion.City) > 0 && !lists.ContainsString(pieces, regionResp.IpRegion.City) && !lists.ContainsString(pieces, strings.TrimSuffix(regionResp.IpRegion.Province, "市")) { - pieces = append(pieces, regionResp.IpRegion.City) - } - regionName = strings.Join(pieces, " ") if len(regionResp.IpRegion.Isp) > 0 { ispName = regionResp.IpRegion.Isp diff --git a/internal/web/actions/default/log/index.go b/internal/web/actions/default/log/index.go index 3d2f2704..6a61dc38 100644 --- a/internal/web/actions/default/log/index.go +++ b/internal/web/actions/default/log/index.go @@ -4,10 +4,8 @@ import ( "github.com/TeaOSLab/EdgeAdmin/internal/configloaders" "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" - "github.com/iwind/TeaGo/lists" "github.com/iwind/TeaGo/maps" timeutil "github.com/iwind/TeaGo/utils/time" - "strings" ) type IndexAction struct { @@ -72,11 +70,7 @@ func (this *IndexAction) RunGet(params struct { return } if regionResp.IpRegion != nil { - pieces := []string{regionResp.IpRegion.Summary} - if len(regionResp.IpRegion.Isp) > 0 && !lists.ContainsString(pieces, regionResp.IpRegion.Isp) { - pieces = append(pieces, "| "+regionResp.IpRegion.Isp) - } - regionName = strings.Join(pieces, " ") + regionName = regionResp.IpRegion.Summary } logMaps = append(logMaps, maps.Map{ diff --git a/internal/web/actions/default/servers/ipbox/index.go b/internal/web/actions/default/servers/ipbox/index.go index 5b3e0858..d8b4d249 100644 --- a/internal/web/actions/default/servers/ipbox/index.go +++ b/internal/web/actions/default/servers/ipbox/index.go @@ -7,6 +7,7 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/iwind/TeaGo/maps" timeutil "github.com/iwind/TeaGo/utils/time" + "strings" "time" ) @@ -30,7 +31,14 @@ func (this *IndexAction) RunGet(params struct { return } if regionResp.IpRegion != nil { - this.Data["regions"] = regionResp.IpRegion.Summary + var regionName = regionResp.IpRegion.Summary + + // remove isp from regionName + var index = strings.LastIndex(regionName, "|") + if index > 0 { + regionName = regionName[:index] + } + this.Data["regions"] = regionName } else { this.Data["regions"] = "" } diff --git a/internal/web/actions/default/servers/iplists/index.go b/internal/web/actions/default/servers/iplists/index.go index 81e2ecf0..ff58323e 100644 --- a/internal/web/actions/default/servers/iplists/index.go +++ b/internal/web/actions/default/servers/iplists/index.go @@ -8,6 +8,7 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs" "github.com/iwind/TeaGo/maps" timeutil "github.com/iwind/TeaGo/utils/time" + "strings" "time" ) @@ -165,6 +166,13 @@ func (this *IndexAction) RunGet(params struct { var ipRegion = regionResp.IpRegion if ipRegion != nil { region = ipRegion.Summary + + // remove isp from regionName + var index = strings.LastIndex(region, "|") + if index > 0 { + region = region[:index] + } + isp = ipRegion.Isp } } diff --git a/internal/web/actions/default/servers/iplists/items.go b/internal/web/actions/default/servers/iplists/items.go index 8a2243a3..840dac7e 100644 --- a/internal/web/actions/default/servers/iplists/items.go +++ b/internal/web/actions/default/servers/iplists/items.go @@ -8,6 +8,7 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs" "github.com/iwind/TeaGo/maps" timeutil "github.com/iwind/TeaGo/utils/time" + "strings" "time" ) @@ -116,6 +117,13 @@ func (this *ItemsAction) RunGet(params struct { var ipRegion = regionResp.IpRegion if ipRegion != nil { region = ipRegion.Summary + + // remove isp from regionName + var index = strings.LastIndex(region, "|") + if index > 0 { + region = region[:index] + } + isp = ipRegion.Isp } } diff --git a/internal/web/actions/default/servers/server/log/viewPopup.go b/internal/web/actions/default/servers/server/log/viewPopup.go index 1b2ec2e7..c8ff891b 100644 --- a/internal/web/actions/default/servers/server/log/viewPopup.go +++ b/internal/web/actions/default/servers/server/log/viewPopup.go @@ -93,8 +93,16 @@ func (this *ViewPopupAction) RunGet(params struct { } region := regionResp.IpRegion if region != nil { + var regionName = region.Summary + + // remove isp from regionName + var index = strings.LastIndex(regionName, "|") + if index > 0 { + regionName = regionName[:index] + } + regionMap = maps.Map{ - "full": region.Summary, + "full": regionName, "isp": region.Isp, } } diff --git a/web/public/js/components.js b/web/public/js/components.js index b6014353..e2f69ddd 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -4325,7 +4325,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio