Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nats-io/nats-top into ksidirop/nats…
Browse files Browse the repository at this point in the history
…-top-extended

* 'main' of github.com:nats-io/nats-top:
  Add Raw bytes toggle (nats-io#55)
  nats-io#53 add -b flag to display traffic in raw bytes (nats-io#54)
  • Loading branch information
ksidirop-laerdal committed Feb 8, 2022
2 parents f5a81ef + c99cb78 commit cdf3c32
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions nats-top.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2015-2021 The NATS Authors
// Copyright (c) 2015-2022 The NATS Authors
package main

import (
Expand All @@ -15,7 +15,7 @@ import (
ui "gopkg.in/gizak/termui.v1"
)

const version = "0.4.0"
const version = "0.5.0"

var (
host = flag.String("s", "127.0.0.1", "The nats server host.")
Expand Down Expand Up @@ -543,6 +543,15 @@ func StartUI(engine *top.Engine) {
}
}

if e.Type == ui.EventKey && (e.Ch == 'b') && !(waitingSortOption || waitingLimitOption) {
switch *displayRawBytes {
case true:
*displayRawBytes = false
case false:
*displayRawBytes = true
}
}

if e.Type == ui.EventResize {
ui.Body.Width = ui.TermWidth()
ui.Body.Align()
Expand Down Expand Up @@ -577,6 +586,8 @@ s Toggle displaying connection subscriptions.
d Toggle activating DNS address lookup for clients.
b Toggle displaying raw bytes.
q Quit nats-top.
Press any key to continue...
Expand Down

0 comments on commit cdf3c32

Please sign in to comment.