diff --git a/tool/tctl/common/top/command.go b/tool/tctl/common/top/command.go index 62c6271e2524b..b917ff5fb9fcb 100644 --- a/tool/tctl/common/top/command.go +++ b/tool/tctl/common/top/command.go @@ -65,9 +65,6 @@ func (c *Command) TryRun(ctx context.Context, cmd string, _ commonclient.InitFun tea.WithContext(ctx), ) - ctx, cancel := context.WithCancel(ctx) - defer cancel() - _, err = p.Run() return true, trace.Wrap(err) } diff --git a/tool/tctl/common/top/model.go b/tool/tctl/common/top/model.go index 1d3842de47f57..ede658350315d 100644 --- a/tool/tctl/common/top/model.go +++ b/tool/tctl/common/top/model.go @@ -25,7 +25,6 @@ import ( "github.com/charmbracelet/bubbles/help" "github.com/charmbracelet/bubbles/key" - "github.com/charmbracelet/bubbles/table" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/dustin/go-humanize" @@ -39,7 +38,6 @@ type topModel struct { width int height int selected int - sizeKnown bool help help.Model refreshInterval time.Duration clt *roundtrip.Client @@ -194,21 +192,6 @@ func (m *topModel) contentView() string { } } -func tableDataStyle(width int) table.Styles { - tableDataStyle := table.DefaultStyles() - tableDataStyle.Selected = lipgloss.NewStyle() - tableDataStyle.Header = lipgloss.NewStyle(). - Height(0). - MaxHeight(0). - MaxWidth(width). - Padding(0, 0) - tableDataStyle.Cell = tableDataStyle.Cell. - Padding(0, 0). - MaxWidth(width) - - return tableDataStyle -} - func renderCommon(report *Report, width int) string { columnWidth := width / 2 @@ -499,11 +482,5 @@ var ( selectedColor = lipgloss.Color("4") - rangeColor = lipgloss.Color("24") - - tableStyle = lipgloss.NewStyle(). - BorderStyle(lipgloss.NormalBorder()). - BorderForeground(lipgloss.Color("240")) - tabs = []string{"Common", "Backend", "Cache", "Watcher"} ) diff --git a/tool/tctl/common/top/report.go b/tool/tctl/common/top/report.go index 5773a8d395c9d..f6d8c5f228a37 100644 --- a/tool/tctl/common/top/report.go +++ b/tool/tctl/common/top/report.go @@ -29,13 +29,14 @@ import ( "time" "github.com/gravitational/roundtrip" - "github.com/gravitational/teleport" - "github.com/gravitational/teleport/api/types" - "github.com/gravitational/teleport/lib/utils" "github.com/gravitational/trace" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" "github.com/prometheus/common/expfmt" + + "github.com/gravitational/teleport" + "github.com/gravitational/teleport/api/types" + "github.com/gravitational/teleport/lib/utils" ) // Report is a report rendered over the data