feat(tui): classify error reasons on DOWN monitors
Categorize raw error strings into DNS/TCP/TLS/HTTP/ICMP/TMO/PRIV so users get instant triage from the monitor list without opening the detail panel. - Status column shows DOWN:DNS, DOWN:TLS, DOWN:HTTP, etc. - Inline NAME column errors prefixed with category tag [DNS], [TLS] - Detail panel shows connection chain checklist for HTTP monitors (✓ DNS → ✓ TCP → ✗ TLS → · HTTP) pinpointing failure layer - All display-side only — no database or model changes
This commit is contained in:
@@ -128,7 +128,7 @@ func fmtRetries(site models.Site) string {
|
||||
return s
|
||||
}
|
||||
|
||||
func fmtStatus(status string, paused bool, inMaint bool) string {
|
||||
func fmtStatus(status string, paused bool, inMaint bool, errCategory ErrorCategory) string {
|
||||
if paused {
|
||||
return warnStyle.Render("PAUSED")
|
||||
}
|
||||
@@ -136,7 +136,13 @@ func fmtStatus(status string, paused bool, inMaint bool) string {
|
||||
return maintStyle.Render("MAINT")
|
||||
}
|
||||
switch status {
|
||||
case "DOWN", "SSL EXP":
|
||||
case "DOWN":
|
||||
label := "DOWN"
|
||||
if errCategory != ErrCatUnknown {
|
||||
label = "DOWN:" + string(errCategory)
|
||||
}
|
||||
return dangerStyle.Render(label)
|
||||
case "SSL EXP":
|
||||
return dangerStyle.Render(status)
|
||||
case "LATE":
|
||||
return warnStyle.Render(status)
|
||||
|
||||
Reference in New Issue
Block a user