Skip to content

Commit

Permalink
Merge pull request #1054 from ripienaar/watch_account_name
Browse files Browse the repository at this point in the history
Render account name in account watch command
  • Loading branch information
ripienaar committed May 2, 2024
2 parents 249cc57 + 0a1f360 commit 935f293
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion cli/auth_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func configureAuthCommand(app commandHost) {
auth := app.Command("auth", "NATS Decentralized Authentication")

// todo:
// - store role name, currently its the pub key not name
// - Improve maintaining pub/sub permissions for a user, perhaps allow interactive edits of yaml?

auth.HelpLong("WARNING: This is experimental and subject to massive change, do not use yet")
Expand Down
10 changes: 8 additions & 2 deletions cli/server_watch_acct_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,15 @@ func (c *SrvWatchAccountCmd) redraw() {
matched = accounts[:c.topCount]
}

clearScreen()
for _, account := range matched {
acct := account.Account
if account.Name != "" {
acct = account.Name
}

table.AddRow(
account.Account,
acct,
seen[account.Account],
f(account.Conns),
f(account.LeafNodes),
Expand All @@ -189,7 +195,6 @@ func (c *SrvWatchAccountCmd) redraw() {
)
}

clearScreen()
fmt.Println(table.Render())
}

Expand All @@ -212,6 +217,7 @@ func (c *SrvWatchAccountCmd) accountTotal(acct string) (int, *server.AccountStat
servers++

total.Account = acct
total.Name = stat.Name
total.TotalConns += stat.TotalConns
total.Conns += stat.Conns
total.LeafNodes += stat.LeafNodes
Expand Down

0 comments on commit 935f293

Please sign in to comment.