mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 14:15:06 +03:00
Extend getSessions
admin call to include uptime/TX/RX
This commit is contained in:
parent
5477566fa9
commit
dc9720e580
6 changed files with 23 additions and 97 deletions
|
@ -216,11 +216,14 @@ func run() int {
|
|||
if err := json.Unmarshal(recv.Response, &resp); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
table.SetHeader([]string{"Public Key", "IP Address"})
|
||||
table.SetHeader([]string{"Public Key", "IP Address", "Uptime", "RX", "TX"})
|
||||
for _, p := range resp.Sessions {
|
||||
table.Append([]string{
|
||||
p.PublicKey,
|
||||
p.IPAddress,
|
||||
(time.Duration(p.Uptime) * time.Second).String(),
|
||||
p.RXBytes.String(),
|
||||
p.TXBytes.String(),
|
||||
})
|
||||
}
|
||||
table.Render()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue