- New tui/sat_progress.go: polls {DefaultSATBaseDir}/{prefix}-*/verbose.log every 300ms and parses completed/in-progress steps
- Busy screen now shows each step as PASS lscpu (234ms) / FAIL stress-ng (60.0s) / ... sensors-after instead of just "Working..."
2. Test results shown on screen (instead of just "Archive written to /path")
- RunCPUAcceptancePackResult, RunMemoryAcceptancePackResult, RunStorageAcceptancePackResult, RunAMDAcceptancePackResult now read summary.txt from the run directory and return a formatted per-step result:
Run: 2025-03-25T10:00:00Z
PASS lscpu
PASS sensors-before
FAIL stress-ng
PASS sensors-after
Overall: FAILED (ok=3 failed=1)
3. AMD GPU SAT with auto-detection
- platform.System.DetectGPUVendor(): checks /dev/nvidia0 → "nvidia", /dev/kfd → "amd"
- platform.System.RunAMDAcceptancePack(): runs rocm-smi, rocm-smi --showallinfo, dmidecode
- GPU SAT (G key / GPU row enter) automatically routes to AMD or NVIDIA based on detected vendor
- "Run All" also auto-detects vendor
4. Panel detail view
- GPU detail now shows the most recent (NVIDIA or AMD) SAT result, whichever is newer
- All SAT detail views use the same human-readable formatSATDetail format
157 lines
4.1 KiB
Go
157 lines
4.1 KiB
Go
package tui
|
|
|
|
import (
|
|
"time"
|
|
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
func (m model) updateStaticForm(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
|
switch msg.String() {
|
|
case "esc":
|
|
m.screen = screenNetwork
|
|
m.formFields = nil
|
|
m.formIndex = 0
|
|
return m, nil
|
|
case "up", "shift+tab":
|
|
if m.formIndex > 0 {
|
|
m.formIndex--
|
|
}
|
|
case "down", "tab":
|
|
if m.formIndex < len(m.formFields)-1 {
|
|
m.formIndex++
|
|
}
|
|
case "enter":
|
|
if m.formIndex < len(m.formFields)-1 {
|
|
m.formIndex++
|
|
return m, nil
|
|
}
|
|
cfg := m.app.ParseStaticIPv4Config(m.selectedIface, []string{
|
|
m.formFields[0].Value,
|
|
m.formFields[1].Value,
|
|
m.formFields[2].Value,
|
|
m.formFields[3].Value,
|
|
})
|
|
m.busy = true
|
|
m.busyTitle = "Static IPv4: " + m.selectedIface
|
|
return m, func() tea.Msg {
|
|
result, err := m.app.SetStaticIPv4Result(cfg)
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenNetwork}
|
|
}
|
|
case "backspace":
|
|
field := &m.formFields[m.formIndex]
|
|
if len(field.Value) > 0 {
|
|
field.Value = field.Value[:len(field.Value)-1]
|
|
}
|
|
default:
|
|
if msg.Type == tea.KeyRunes && len(msg.Runes) > 0 {
|
|
m.formFields[m.formIndex].Value += string(msg.Runes)
|
|
}
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (m model) updateConfirm(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
|
|
switch msg.String() {
|
|
case "left", "up", "tab":
|
|
if m.cursor > 0 {
|
|
m.cursor--
|
|
}
|
|
case "right", "down":
|
|
if m.cursor < 1 {
|
|
m.cursor++
|
|
}
|
|
case "esc":
|
|
m.screen = m.confirmCancelTarget()
|
|
m.cursor = 0
|
|
m.pendingAction = actionNone
|
|
return m, nil
|
|
case "enter":
|
|
if m.cursor == 1 { // Cancel
|
|
m.screen = m.confirmCancelTarget()
|
|
m.cursor = 0
|
|
m.pendingAction = actionNone
|
|
return m, nil
|
|
}
|
|
m.busy = true
|
|
switch m.pendingAction {
|
|
case actionExportBundle:
|
|
m.busyTitle = "Export support bundle"
|
|
target := *m.selectedTarget
|
|
return m, func() tea.Msg {
|
|
result, err := m.app.ExportSupportBundleResult(target)
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenMain}
|
|
}
|
|
case actionRunAll:
|
|
return m.executeRunAll()
|
|
case actionRunMemorySAT:
|
|
m.busyTitle = "Memory test"
|
|
m.progressPrefix = "memory"
|
|
m.progressSince = time.Now()
|
|
m.progressLines = nil
|
|
since := m.progressSince
|
|
return m, tea.Batch(
|
|
func() tea.Msg {
|
|
result, err := m.app.RunMemoryAcceptancePackResult("")
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenHealthCheck}
|
|
},
|
|
pollSATProgress("memory", since),
|
|
)
|
|
case actionRunStorageSAT:
|
|
m.busyTitle = "Storage test"
|
|
m.progressPrefix = "storage"
|
|
m.progressSince = time.Now()
|
|
m.progressLines = nil
|
|
since := m.progressSince
|
|
return m, tea.Batch(
|
|
func() tea.Msg {
|
|
result, err := m.app.RunStorageAcceptancePackResult("")
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenHealthCheck}
|
|
},
|
|
pollSATProgress("storage", since),
|
|
)
|
|
case actionRunCPUSAT:
|
|
m.busyTitle = "CPU test"
|
|
m.progressPrefix = "cpu"
|
|
m.progressSince = time.Now()
|
|
m.progressLines = nil
|
|
since := m.progressSince
|
|
durationSec := hcCPUDurations[m.hcMode]
|
|
return m, tea.Batch(
|
|
func() tea.Msg {
|
|
result, err := m.app.RunCPUAcceptancePackResult("", durationSec)
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenHealthCheck}
|
|
},
|
|
pollSATProgress("cpu", since),
|
|
)
|
|
case actionRunAMDGPUSAT:
|
|
m.busyTitle = "AMD GPU test"
|
|
m.progressPrefix = "gpu-amd"
|
|
m.progressSince = time.Now()
|
|
m.progressLines = nil
|
|
since := m.progressSince
|
|
return m, tea.Batch(
|
|
func() tea.Msg {
|
|
result, err := m.app.RunAMDAcceptancePackResult("")
|
|
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenHealthCheck}
|
|
},
|
|
pollSATProgress("gpu-amd", since),
|
|
)
|
|
}
|
|
case "ctrl+c":
|
|
return m, tea.Quit
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (m model) confirmCancelTarget() screen {
|
|
switch m.pendingAction {
|
|
case actionExportBundle:
|
|
return screenExportTargets
|
|
case actionRunAll, actionRunMemorySAT, actionRunStorageSAT, actionRunCPUSAT, actionRunAMDGPUSAT:
|
|
return screenHealthCheck
|
|
default:
|
|
return screenMain
|
|
}
|
|
}
|