改进显示

This commit is contained in:
GoEdgeLab
2020-11-10 22:16:54 +08:00
parent d4b9030657
commit 5f0ed4a2f2

View File

@@ -38,7 +38,6 @@ func (this *IndexAction) RunGet(params struct{}) {
logMaps := []maps.Map{} logMaps := []maps.Map{}
for _, log := range logsResp.Logs { for _, log := range logsResp.Logs {
regionName := "" regionName := ""
log.Ip = "123.123.88.220" // TODO
regionResp, err := this.RPC().IPLibraryRPC().LookupIPRegion(this.AdminContext(), &pb.LookupIPRegionRequest{Ip: log.Ip}) regionResp, err := this.RPC().IPLibraryRPC().LookupIPRegion(this.AdminContext(), &pb.LookupIPRegionRequest{Ip: log.Ip})
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)
@@ -56,7 +55,7 @@ func (this *IndexAction) RunGet(params struct{}) {
pieces = append(pieces, regionResp.Region.City) pieces = append(pieces, regionResp.Region.City)
} }
if len(regionResp.Region.Isp) > 0 && !lists.ContainsString(pieces, regionResp.Region.Isp) { if len(regionResp.Region.Isp) > 0 && !lists.ContainsString(pieces, regionResp.Region.Isp) {
pieces = append(pieces, regionResp.Region.Isp) pieces = append(pieces, "| "+regionResp.Region.Isp)
} }
regionName = strings.Join(pieces, " ") regionName = strings.Join(pieces, " ")
} }