Add titles and categories to notifications

Also, add more event data to prompts.
This commit is contained in:
Daniel
2020-10-29 22:54:46 +01:00
parent 17a0c8f721
commit ed00e1fe83
5 changed files with 86 additions and 40 deletions

View File

@@ -45,15 +45,17 @@ type ThreatPayload struct {
// // Once you're done, delete the threat
// threat.Delete().Publish()
//
func NewThreat(id, msg string) *Threat {
func NewThreat(id, title, msg string) *Threat {
t := &Threat{
Notification: &notifications.Notification{
EventID: id,
Message: msg,
Type: notifications.Warning,
State: notifications.Active,
EventID: id,
Type: notifications.Warning,
Title: title,
Category: "Threat",
Message: msg,
},
}
t.threatData().Started = time.Now().Unix()
return t