Skip to content

Commit

Permalink
fix: addess lint findings
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstimothy committed Jan 23, 2025
1 parent 552e197 commit 32c7e33
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
3 changes: 0 additions & 3 deletions tool/tctl/common/top/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
23 changes: 0 additions & 23 deletions tool/tctl/common/top/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -39,7 +38,6 @@ type topModel struct {
width int
height int
selected int
sizeKnown bool
help help.Model
refreshInterval time.Duration
clt *roundtrip.Client
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"}
)
7 changes: 4 additions & 3 deletions tool/tctl/common/top/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32c7e33

Please sign in to comment.