New detail in getMulticastInterfaces admin endpoint

This commit is contained in:
Neil Alexander 2024-11-23 14:49:48 +00:00
parent d3b4de46ea
commit 7790a19e4c
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 57 additions and 16 deletions

View file

@ -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()