refactor: Replace if-else chain with switch statement in showAlerts severity styling

- Replace if-else chain with switch statement for severity level styling
- Maintain existing logic: High maps to ERROR style, Medium maps to WARNING style
- Improve code readability and maintainability
This commit is contained in:
nutcas3
2026-04-17 16:31:26 +03:00
parent 3ac8a1a08e
commit 36e085e246
+3 -2
View File
@@ -104,9 +104,10 @@ func showAlerts(u *uiContext) error {
}
for _, r := range rows {
style := statusStyle(strings.ToUpper(r[0]))
if r[0] == "High" {
switch r[0] {
case "High":
style = statusStyle("ERROR")
} else if r[0] == "Medium" {
case "Medium":
style = statusStyle("WARNING")
}
t.AddStyledRow(style.Style, r[0], r[1], r[2], r[3])