diff --git a/lib/vuln.go b/lib/vuln.go index 17e8516..02a13c7 100644 --- a/lib/vuln.go +++ b/lib/vuln.go @@ -34,6 +34,25 @@ func ValidSeverity(s string) bool { return false } +func (v Vuln) StatusColor() string { + switch v.Status { + case "Waiting for review": + return "blue" + case "Ongoing review": + return "blue" + case "Working on a patch": + return "blue" + case "Won't patch": + return "red" + case "Patched": + return "green" + case "Not affected": + return "red" + } + + return "" +} + func GetID() string { now := time.Now() mic := strconv.FormatInt(now.UnixMicro(), 10) @@ -109,7 +128,7 @@ func UpdateVuln(v Vuln) error { } _, err = smt.Exec(v.Status, v.Message, - v.Author, v.Severity, v.ID, GetFTime()) + v.Author, v.Severity, GetFTime(), v.ID) if err != nil { return err } diff --git a/templates/details.html b/templates/details.html index 1c86749..1e2bc95 100644 --- a/templates/details.html +++ b/templates/details.html @@ -20,7 +20,7 @@