Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Raw bytes toggle #55

Merged
merged 2 commits into from
Feb 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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