feat(tui): column sort with indicator on monitors table
Press < / > to cycle sort column (Status, Name, Latency). Press r to reverse direction. Sorted column shows ▲/▼ arrow in the header. Groups always float to top. Sort applies to ungrouped monitors and group children independently. Default: Status descending (DOWN first).
This commit is contained in:
@@ -532,6 +532,23 @@ func (m *Model) handleDashboardKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
||||
m.recalcLayout()
|
||||
return m, nil
|
||||
}
|
||||
case ">", ".":
|
||||
if m.currentTab == tabMonitors {
|
||||
m.sortColumn = (m.sortColumn + 1) % sortMax
|
||||
m.sortAsc = false
|
||||
m.refreshLive()
|
||||
}
|
||||
case "<", ",":
|
||||
if m.currentTab == tabMonitors {
|
||||
m.sortColumn = (m.sortColumn - 1 + sortMax) % sortMax
|
||||
m.sortAsc = false
|
||||
m.refreshLive()
|
||||
}
|
||||
case "r":
|
||||
if m.currentTab == tabMonitors {
|
||||
m.sortAsc = !m.sortAsc
|
||||
m.refreshLive()
|
||||
}
|
||||
case "tab":
|
||||
m.switchTab(m.currentTab + 1)
|
||||
case "left":
|
||||
|
||||
Reference in New Issue
Block a user