feat(tui): mouse click for settings sections, column sort, logs toggle
- 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:
@@ -1,6 +1,8 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
||||
@@ -18,11 +20,13 @@ func (m Model) viewSettingsTab() string {
|
||||
|
||||
var tabs []string
|
||||
for i, name := range sections {
|
||||
var rendered string
|
||||
if i == m.settingsSection {
|
||||
tabs = append(tabs, m.st.activeTab.Render(name))
|
||||
rendered = m.st.activeTab.Render(name)
|
||||
} else {
|
||||
tabs = append(tabs, m.st.inactiveTab.Render(name))
|
||||
rendered = m.st.inactiveTab.Render(name)
|
||||
}
|
||||
tabs = append(tabs, m.zones.Mark(fmt.Sprintf("section-%d", i), rendered))
|
||||
}
|
||||
header := lipgloss.JoinHorizontal(lipgloss.Top, tabs...)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user