This commit is contained in:
ayurishchev committed 2026-08-23 21:58:19 +03:00
1 parent ee2a29cb36
commit 4f597505cc
30 files changed
+830 -305

No files matched your search

+13 -13
View File
@@ -8,9 +8,9 @@ import (
"time"
)
// Badge is the {class, label} pair rendered via Bootstrap's .badge
// component (see static/dashboard.css for the one addition Bootstrap
// doesn't ship — .bg-cancelled).
// Badge is the {class, label} pair rendered via the dashboard's own .pill
// component (see static/dashboard.css) — Class is a modifier to combine
// with "pill" in the template (e.g. `class="pill {{.Class}}"`).
type Badge struct{ Class, Label string }
func ipBadge(state, result string) Badge {
@@ -18,31 +18,31 @@ func ipBadge(state, result string) Badge {
case "done", "failed":
switch result {
case "pass":
return Badge{"badge bg-success", "pass"}
return Badge{"pill-success", "pass"}
case "partial":
return Badge{"badge bg-warning text-dark", "partial"}
return Badge{"pill-warning", "partial"}
case "cancelled":
return Badge{"badge bg-cancelled", "cancelled"}
return Badge{"pill-cancel", "cancelled"}
default:
return Badge{"badge bg-danger", "fail"}
return Badge{"pill-danger", "fail"}
}
case "queued":
return Badge{"badge bg-secondary", "queued"}
return Badge{"pill-neutral", "queued"}
default:
return Badge{"badge bg-info text-dark", state}
return Badge{"pill-info", state}
}
}
func validatorBadge(state string) Badge {
switch state {
case "idle":
return Badge{"badge bg-success", "idle"}
return Badge{"pill-success", "idle"}
case "unreachable":
return Badge{"badge bg-danger", "unreachable"}
return Badge{"pill-danger", "unreachable"}
case "unregistered":
return Badge{"badge bg-secondary", "unregistered"}
return Badge{"pill-neutral", "unregistered"}
default:
return Badge{"badge bg-info text-dark", state} // assigned / checking
return Badge{"pill-info", state} // assigned / checking
}
}