Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
f00d0daf
Unverified
Commit
f00d0daf
authored
Jul 30, 2018
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/puppeth: split banned ethstats addresses over columns
parent
2cffd4ff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
module_ethstats.go
cmd/puppeth/module_ethstats.go
+1
-1
wizard_netstats.go
cmd/puppeth/wizard_netstats.go
+16
-10
No files found.
cmd/puppeth/module_ethstats.go
View file @
f00d0daf
...
@@ -122,7 +122,7 @@ func (info *ethstatsInfos) Report() map[string]string {
...
@@ -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
"
),
}
}
}
}
...
...
cmd/puppeth/wizard_netstats.go
View file @
f00d0daf
...
@@ -203,7 +203,7 @@ func (stats serverStats) render() {
...
@@ -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
(
10
0
)
table
.
SetColWidth
(
4
0
)
// 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() {
...
@@ -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() {
...
@@ -263,13 +265,17 @@ func (stats serverStats) render() {
sort
.
Strings
(
configs
)
sort
.
Strings
(
configs
)
for
k
,
config
:=
range
configs
{
for
k
,
config
:=
range
configs
{
for
l
,
value
:=
range
strings
.
Split
(
stats
[
server
]
.
services
[
service
][
config
],
"
\n
"
)
{
switch
{
switch
{
case
j
==
0
&&
k
==
0
:
case
j
==
0
&&
k
==
0
&&
l
==
0
:
table
.
Append
([]
string
{
server
,
stats
[
server
]
.
address
,
service
,
config
,
stats
[
server
]
.
services
[
service
][
config
]})
table
.
Append
([]
string
{
server
,
stats
[
server
]
.
address
,
service
,
config
,
value
})
case
k
==
0
:
case
k
==
0
&&
l
==
0
:
table
.
Append
([]
string
{
""
,
""
,
service
,
config
,
stats
[
server
]
.
services
[
service
][
config
]})
table
.
Append
([]
string
{
""
,
""
,
service
,
config
,
value
})
case
l
==
0
:
table
.
Append
([]
string
{
""
,
""
,
""
,
config
,
value
})
default
:
default
:
table
.
Append
([]
string
{
""
,
""
,
""
,
config
,
stats
[
server
]
.
services
[
service
][
config
]})
table
.
Append
([]
string
{
""
,
""
,
""
,
""
,
value
})
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment