feat(tui): alert failure badge on Settings tab

Settings tab warn count now includes failed alert channels — alerts
where the last send failed (LastSendOK=false, LastSendAt not zero).
Shows as a red badge number alongside offline node count. Surfaces
broken alert channels without navigating to Settings.
This commit is contained in:
2026-06-21 19:10:18 -04:00
parent d982359f25
commit 28fb6c8889
+6
View File
@@ -233,6 +233,12 @@ type tabEntry struct {
func (m Model) renderTabBar(stats dashboardStats) string { func (m Model) renderTabBar(stats dashboardStats) string {
settingsCount := len(m.alerts) + len(m.nodes) settingsCount := len(m.alerts) + len(m.nodes)
settingsWarn := stats.offlineNodes settingsWarn := stats.offlineNodes
for _, a := range m.alerts {
h := m.engine.GetAlertHealth(a.ID)
if !h.LastSendOK && !h.LastSendAt.IsZero() {
settingsWarn++
}
}
if m.isAdmin { if m.isAdmin {
settingsCount += len(m.users) settingsCount += len(m.users)
} }