- Replace 12-item flat menu with 4-item main menu: Health Check, Export support bundle, Settings, Exit - Add Health Check screen (Lenovo-style): per-component checkboxes (GPU/MEM/DISK/CPU), Quick/Standard/Express modes, Run All, letter hotkeys G/M/S/C/R/A/1/2/3 - Add two-column main screen: left = menu, right = hardware panel with colored PASS/FAIL/CANCEL/N/A status per component; Tab/→ switches focus, Enter opens component detail - Add app.LoadHardwarePanel() + ComponentDetailResult() reading audit JSON and SAT summary.txt files - Move Network/Services/audit actions into Settings submenu - Export: support bundle only (remove separate audit JSON export) - Delete screen_acceptance.go; add screen_health_check.go, screen_settings.go, app/panel.go - Add BMC + CPU stress-ng tests to backlog - Update bible submodule - Rewrite tui_test.go for new screen/action structure Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
65 lines
1.8 KiB
Go
65 lines
1.8 KiB
Go
package tui
|
|
|
|
import tea "github.com/charmbracelet/bubbletea"
|
|
|
|
func (m model) handleSettingsMenu() (tea.Model, tea.Cmd) {
|
|
switch m.cursor {
|
|
case 0: // Network
|
|
m.screen = screenNetwork
|
|
m.cursor = 0
|
|
return m, nil
|
|
case 1: // Services
|
|
m.busy = true
|
|
m.busyTitle = "Services"
|
|
return m, func() tea.Msg {
|
|
services, err := m.app.ListBeeServices()
|
|
return servicesMsg{services: services, err: err}
|
|
}
|
|
case 2: // Re-run audit
|
|
m.busy = true
|
|
m.busyTitle = "Re-run audit"
|
|
runtimeMode := m.runtimeMode
|
|
return m, func() tea.Msg {
|
|
result, err := m.app.RunAuditNow(runtimeMode)
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenSettings}
|
|
}
|
|
case 3: // Run self-check
|
|
m.busy = true
|
|
m.busyTitle = "Self-check"
|
|
return m, func() tea.Msg {
|
|
result, err := m.app.RunRuntimePreflightResult()
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenSettings}
|
|
}
|
|
case 4: // Runtime issues
|
|
m.busy = true
|
|
m.busyTitle = "Runtime issues"
|
|
return m, func() tea.Msg {
|
|
result := m.app.RuntimeHealthResult()
|
|
return resultMsg{title: result.Title, body: result.Body, back: screenSettings}
|
|
}
|
|
case 5: // Audit logs
|
|
m.busy = true
|
|
m.busyTitle = "Audit logs"
|
|
return m, func() tea.Msg {
|
|
result := m.app.AuditLogTailResult()
|
|
return resultMsg{title: result.Title, body: result.Body, back: screenSettings}
|
|
}
|
|
case 6: // Check tools
|
|
m.busy = true
|
|
m.busyTitle = "Check tools"
|
|
return m, func() tea.Msg {
|
|
result := m.app.ToolCheckResult([]string{
|
|
"dmidecode", "smartctl", "nvme", "ipmitool", "lspci",
|
|
"ethtool", "bee", "nvidia-smi", "bee-gpu-stress",
|
|
"memtester", "dhclient", "lsblk", "mount",
|
|
})
|
|
return resultMsg{title: result.Title, body: result.Body, back: screenSettings}
|
|
}
|
|
case 7: // Back
|
|
m.screen = screenMain
|
|
m.cursor = 0
|
|
return m, nil
|
|
}
|
|
return m, nil
|
|
}
|