feat(tui): enhanced dashboard with lipgloss tables, huh forms, mouse support, and animations
Split monolithic tui.go into per-tab view files. Added sparkline history tracking, color-coded latency/uptime, rounded bordered tables, Dracula-themed huh forms with conditional groups, BubbleZone mouse click support for tabs and rows, and Harmonica spring-physics pulse indicator. Includes --demo flag for seeding test data.
This commit is contained in:
@@ -157,6 +157,29 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch m.state {
|
switch m.state {
|
||||||
|
case stateFormSite, stateFormAlert, stateFormUser:
|
||||||
|
if msg.String() == "esc" {
|
||||||
|
m.huhForm = nil
|
||||||
|
m.state = stateDashboard
|
||||||
|
if m.currentTab == 3 {
|
||||||
|
m.state = stateUsers
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.huhForm != nil {
|
||||||
|
form, formCmd := m.huhForm.Update(msg)
|
||||||
|
if f, ok := form.(*huh.Form); ok {
|
||||||
|
m.huhForm = f
|
||||||
|
}
|
||||||
|
if m.huhForm.State == huh.StateCompleted {
|
||||||
|
m.submitForm()
|
||||||
|
m.refreshData()
|
||||||
|
m.huhForm = nil
|
||||||
|
}
|
||||||
|
return m, formCmd
|
||||||
|
}
|
||||||
|
|
||||||
case stateDashboard, stateLogs, stateUsers:
|
case stateDashboard, stateLogs, stateUsers:
|
||||||
switch msg.String() {
|
switch msg.String() {
|
||||||
case "q":
|
case "q":
|
||||||
|
|||||||
Reference in New Issue
Block a user