feat(viewer): compact status and severity table icons

This commit is contained in:
2026-04-22 21:19:12 +03:00
parent 2fb01d30a6
commit 34ebaa524d
9 changed files with 322 additions and 241 deletions

View File

@@ -12,8 +12,9 @@ import (
var content embed.FS
var pageTemplate = template.Must(template.New("view.html").Funcs(template.FuncMap{
"statusClass": statusClass,
"joinLines": joinLines,
"statusClass": statusClass,
"severityClass": severityClass,
"joinLines": joinLines,
}).ParseFS(content, "templates/view.html"))
var uploadTemplate = template.Must(template.New("upload.html").ParseFS(content, "templates/upload.html"))
@@ -59,6 +60,23 @@ func statusClass(value string) string {
}
}
func severityClass(value string) string {
switch strings.ToUpper(strings.TrimSpace(value)) {
case "INFO", "INFORMATIONAL":
return "severity-info"
case "WARNING", "WARN":
return "severity-warning"
case "ERROR":
return "severity-error"
case "CRITICAL", "FATAL":
return "severity-critical"
case "DEBUG", "TRACE":
return "severity-debug"
default:
return "severity-unknown"
}
}
func joinLines(value string) []string {
if strings.TrimSpace(value) == "" {
return nil