forked from cerc-io/plugeth
Merge pull request #17279 from karalabe/puppeth-banlist-fix
cmd/puppeth: split banned ethstats addresses over columns
This commit is contained in:
commit
6380c06c65
@ -122,7 +122,7 @@ func (info *ethstatsInfos) Report() map[string]string {
|
|||||||
"Website address": info.host,
|
"Website address": info.host,
|
||||||
"Website listener port": strconv.Itoa(info.port),
|
"Website listener port": strconv.Itoa(info.port),
|
||||||
"Login secret": info.secret,
|
"Login secret": info.secret,
|
||||||
"Banned addresses": fmt.Sprintf("%v", info.banned),
|
"Banned addresses": strings.Join(info.banned, "\n"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ func (stats serverStats) render() {
|
|||||||
|
|
||||||
table.SetHeader([]string{"Server", "Address", "Service", "Config", "Value"})
|
table.SetHeader([]string{"Server", "Address", "Service", "Config", "Value"})
|
||||||
table.SetAlignment(tablewriter.ALIGN_LEFT)
|
table.SetAlignment(tablewriter.ALIGN_LEFT)
|
||||||
table.SetColWidth(100)
|
table.SetColWidth(40)
|
||||||
|
|
||||||
// Find the longest lines for all columns for the hacked separator
|
// Find the longest lines for all columns for the hacked separator
|
||||||
separator := make([]string, 5)
|
separator := make([]string, 5)
|
||||||
@ -222,8 +222,10 @@ func (stats serverStats) render() {
|
|||||||
if len(config) > len(separator[3]) {
|
if len(config) > len(separator[3]) {
|
||||||
separator[3] = strings.Repeat("-", len(config))
|
separator[3] = strings.Repeat("-", len(config))
|
||||||
}
|
}
|
||||||
if len(value) > len(separator[4]) {
|
for _, val := range strings.Split(value, "\n") {
|
||||||
separator[4] = strings.Repeat("-", len(value))
|
if len(val) > len(separator[4]) {
|
||||||
|
separator[4] = strings.Repeat("-", len(val))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,13 +265,17 @@ func (stats serverStats) render() {
|
|||||||
sort.Strings(configs)
|
sort.Strings(configs)
|
||||||
|
|
||||||
for k, config := range configs {
|
for k, config := range configs {
|
||||||
switch {
|
for l, value := range strings.Split(stats[server].services[service][config], "\n") {
|
||||||
case j == 0 && k == 0:
|
switch {
|
||||||
table.Append([]string{server, stats[server].address, service, config, stats[server].services[service][config]})
|
case j == 0 && k == 0 && l == 0:
|
||||||
case k == 0:
|
table.Append([]string{server, stats[server].address, service, config, value})
|
||||||
table.Append([]string{"", "", service, config, stats[server].services[service][config]})
|
case k == 0 && l == 0:
|
||||||
default:
|
table.Append([]string{"", "", service, config, value})
|
||||||
table.Append([]string{"", "", "", config, stats[server].services[service][config]})
|
case l == 0:
|
||||||
|
table.Append([]string{"", "", "", config, value})
|
||||||
|
default:
|
||||||
|
table.Append([]string{"", "", "", "", value})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user