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:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user