fix: six small fixes — rate limiter leak, DST SLA, probe sort, TUI cleanup
1. Rate limiter cleanup goroutine now stoppable via Stop() channel instead of looping forever. Prevents goroutine leak in tests. 2. Dead WindowSizeMsg branch in handleFormMsg removed — top-level Update handles resize before forms see it. 3. Probe results sorted by node ID — map iteration no longer reorders rows every render. 4. fmtAlertConfig takes models.AlertConfig directly instead of an anonymous struct the caller builds inline. 5. Backspace no longer aliases delete — d is the documented key. Prevents accidental delete-confirm on habitual backspace. 6. SLA daily buckets use time.Date day arithmetic instead of Add(-i*24h) — lands on midnight correctly across DST transitions.
This commit was merged in pull request #117.
This commit is contained in:
@@ -75,10 +75,7 @@ func fmtAlertType(t string) string {
|
||||
}
|
||||
}
|
||||
|
||||
func (m Model) fmtAlertConfig(alert struct {
|
||||
Type string
|
||||
Settings map[string]string
|
||||
}) string {
|
||||
func (m Model) fmtAlertConfig(alert models.AlertConfig) string {
|
||||
switch alert.Type {
|
||||
case "email":
|
||||
host := alert.Settings["host"]
|
||||
@@ -201,10 +198,7 @@ func (m Model) viewAlertsTab() string {
|
||||
m.fmtAlertHealth(h),
|
||||
m.zones.Mark(fmt.Sprintf("alert-%d", i), limitStr(a.Name, nameW-2)),
|
||||
fmtAlertType(a.Type),
|
||||
limitStr(m.fmtAlertConfig(struct {
|
||||
Type string
|
||||
Settings map[string]string
|
||||
}{a.Type, a.Settings}), cfgW-2),
|
||||
limitStr(m.fmtAlertConfig(a), cfgW-2),
|
||||
m.fmtAlertLastSent(h),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user