File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,12 +106,21 @@ func GetDescFromIP(ip string) string {
106106 return ""
107107 }
108108
109- res := info .Country + ", " + info .Region + ", " + info .City
110- if info .Isp != Null {
111- res += ", " + info .Isp
109+ parts := []string {}
110+ if info .Country != "" {
111+ parts = append (parts , info .Country )
112+ }
113+ if info .Region != "" {
114+ parts = append (parts , info .Region )
115+ }
116+ if info .City != "" {
117+ parts = append (parts , info .City )
118+ }
119+ if info .Isp != Null && info .Isp != "" {
120+ parts = append (parts , info .Isp )
112121 }
113122
114- return res
123+ return strings . Join ( parts , ", " )
115124}
116125
117126func GetIPInfo (clientIP string ) string {
Original file line number Diff line number Diff line change @@ -492,15 +492,22 @@ class ChatListPage extends BaseListPage {
492492 return null ;
493493 }
494494
495+ const ipDesc = record . clientIpDesc
496+ ? record . clientIpDesc . split ( "," ) . map ( s => s . trim ( ) ) . filter ( s => s !== "" ) . join ( ", " )
497+ : "" ;
498+
495499 return (
496500 < a target = "_blank" rel = "noreferrer" href = { `https://db-ip.com/${ text } ` } >
497501 {
498- record . clientIpDesc === "" ? text : (
502+ ipDesc === "" && record . userAgentDesc === "" && record . userAgent === "" ? text : (
499503 < div >
500504 { text }
501- < br />
502- { record . clientIpDesc }
503- < br />
505+ { ipDesc !== "" && (
506+ < >
507+ < br />
508+ { ipDesc }
509+ </ >
510+ ) }
504511 < br />
505512 {
506513 this . renderUserAgent ( record )
You can’t perform that action at this time.
0 commit comments