Merge pull request #1196 from skrashevich/feat-network-dot-enhancements

refactor(webui): enhance network visualization in network.html
This commit is contained in:
Alex X
2024-06-16 22:24:11 +03:00
committed by GitHub
2 changed files with 50 additions and 13 deletions
+8 -7
View File
@@ -156,19 +156,20 @@ func (c *conn) host() (s string) {
return
}
func (c *conn) label() (s string) {
s = "format_name=" + c.FormatName
func (c *conn) label() string {
var sb strings.Builder
sb.WriteString("format_name=" + c.FormatName)
if c.Protocol != "" {
s += "\nprotocol=" + c.Protocol
sb.WriteString("\nprotocol=" + c.Protocol)
}
if c.Source != "" {
s += "\nsource=" + c.Source
sb.WriteString("\nsource=" + c.Source)
}
if c.URL != "" {
s += "\nurl=" + c.URL
sb.WriteString("\nurl=" + c.URL)
}
if c.UserAgent != "" {
s += "\nuser_agent=" + c.UserAgent
sb.WriteString("\nuser_agent=" + c.UserAgent)
}
return
return sb.String()
}