mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
New detail in getMulticastInterfaces
admin endpoint
This commit is contained in:
parent
d3b4de46ea
commit
7790a19e4c
4 changed files with 57 additions and 16 deletions
|
@ -281,9 +281,21 @@ func run() int {
|
|||
if err := json.Unmarshal(recv.Response, &resp); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
table.SetHeader([]string{"Interface"})
|
||||
fmtBool := func(b bool) string {
|
||||
if b {
|
||||
return "Yes"
|
||||
}
|
||||
return "-"
|
||||
}
|
||||
table.SetHeader([]string{"Name", "Listen Address", "Beacon", "Listen", "Password"})
|
||||
for _, p := range resp.Interfaces {
|
||||
table.Append([]string{p})
|
||||
table.Append([]string{
|
||||
p.Name,
|
||||
p.Address,
|
||||
fmtBool(p.Beacon),
|
||||
fmtBool(p.Listen),
|
||||
fmtBool(p.Password),
|
||||
})
|
||||
}
|
||||
table.Render()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue