feat(tui): mouse click for settings sections, column sort, logs toggle
CI / test (pull_request) Successful in 1m50s
CI / lint (pull_request) Successful in 1m16s
CI / vulncheck (pull_request) Successful in 51s

- Click Alerts/Nodes/Users sub-tabs in settings to switch sections
- Click STATUS/NAME/LATENCY column headers to sort (click again
  to reverse direction)
- Click logs panel to toggle focus (click again to unfocus)
This commit is contained in:
2026-06-28 11:34:34 -04:00
parent ab1194f74d
commit 83d9754c89
3 changed files with 55 additions and 3 deletions
+39 -1
View File
@@ -840,11 +840,49 @@ func (m *Model) handleClick(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
}
}
if m.currentTab == tabSettings {
maxSec := 1
if m.isAdmin {
maxSec = 2
}
for i := 0; i <= maxSec; i++ {
if m.zones.Get(fmt.Sprintf("section-%d", i)).InBounds(msg) {
m.switchSettingsSection(i)
return m, nil
}
}
}
if m.currentTab == tabMonitors {
sortZones := []struct {
zone string
col int
}{
{"sort-status", sortStatus},
{"sort-name", sortName},
{"sort-latency", sortLatency},
}
for _, sz := range sortZones {
if m.zones.Get(sz.zone).InBounds(msg) {
if m.sortColumn == sz.col {
m.sortAsc = !m.sortAsc
} else {
m.sortColumn = sz.col
m.sortAsc = false
}
m.refreshLive()
return m, nil
}
}
if m.zones.Get("panel-monitors").InBounds(msg) {
m.focusedPanel = panelMonitors
} else if m.zones.Get("panel-logs").InBounds(msg) {
m.focusedPanel = panelLogs
if m.focusedPanel == panelLogs {
m.focusedPanel = panelMonitors
} else {
m.focusedPanel = panelLogs
}
return m, nil
} else if m.detailOpen && m.zones.Get("panel-detail").InBounds(msg) {
m.focusedPanel = panelDetail