Documentation
¶
Overview ¶
templ: version: v0.3.1020
templ: version: v0.3.1020
Index ¶
- Variables
- func CellColor(likelihood, consequence int, t RiskThresholds) string
- func CellLevel(likelihood, consequence int, t RiskThresholds) string
- func Layout(title string, subtitle string, activePage string, user middleware.SessionUser, ...) templ.Component
- func NS5814CellColor(likelihood, consequence int) string
- func NS5814Level(likelihood, consequence int) string
- func RiskMatrix(cells []RiskMatrixCell) templ.Component
- func UserInitials(name string) string
- type NavGroup
- type NavItem
- type RiskMatrixCell
- type RiskThresholds
Constants ¶
This section is empty.
Variables ¶
var AssetVer string
AssetVer is set at startup from a content hash of the embedded static files. Appended to asset URLs so browsers cache-bust on deploy.
Functions ¶
func CellColor ¶
func CellColor(likelihood, consequence int, t RiskThresholds) string
CellColor returns a Tailwind bg class using the given thresholds.
func CellLevel ¶
func CellLevel(likelihood, consequence int, t RiskThresholds) string
CellLevel returns red/yellow/green for a score with given thresholds.
func Layout ¶
func Layout(title string, subtitle string, activePage string, user middleware.SessionUser, content templ.Component) templ.Component
func NS5814CellColor ¶
NS5814CellColor is a backwards-compat wrapper using default thresholds.
func NS5814Level ¶
NS5814Level is a backwards-compat wrapper using default thresholds.
func RiskMatrix ¶
func RiskMatrix(cells []RiskMatrixCell) templ.Component
RiskMatrix renders a 5×5 NS 5814 risk heat map. cells must have exactly 25 elements ordered row-major (consequence desc, likelihood asc).
func UserInitials ¶
Types ¶
type RiskMatrixCell ¶
type RiskMatrixCell struct {
ColorClass string // Tailwind background color class
Count int // Number of risks in this cell (0 = empty)
}
RiskMatrixCell represents a single cell in the NS 5814 5×5 risk heat map.
func BuildRiskMatrixCells ¶
func BuildRiskMatrixCells(counts map[[2]int]int) []RiskMatrixCell
BuildRiskMatrixCells builds 25 cells with default thresholds.
func BuildRiskMatrixCellsT ¶
func BuildRiskMatrixCellsT(counts map[[2]int]int, t RiskThresholds) []RiskMatrixCell
BuildRiskMatrixCellsT builds 25 cells with configurable thresholds.
type RiskThresholds ¶
RiskThresholds holds configurable level boundaries. Scores ≤ LowMax are green, scores ≥ HighMin are red, between is yellow.
func DefaultThresholds ¶
func DefaultThresholds() RiskThresholds
DefaultThresholds returns NS 5814 defaults.