Add titles and categories to notifications
Also, add more event data to prompts.
This commit is contained in:
@@ -213,16 +213,6 @@ func setCaptivePortal(portalURL *url.URL) {
|
||||
return
|
||||
}
|
||||
|
||||
// notify
|
||||
cleanUpPortalNotification()
|
||||
defer func() {
|
||||
// TODO: add "open" button
|
||||
captivePortalNotification = notifications.NotifyInfo(
|
||||
"netenv:captive-portal:"+captivePortal.Domain,
|
||||
"Portmaster detected a captive portal at "+captivePortal.Domain,
|
||||
)
|
||||
}()
|
||||
|
||||
// set
|
||||
captivePortal = &CaptivePortal{
|
||||
URL: portalURL.String(),
|
||||
@@ -234,6 +224,22 @@ func setCaptivePortal(portalURL *url.URL) {
|
||||
} else {
|
||||
captivePortal.Domain = portalURL.Hostname()
|
||||
}
|
||||
|
||||
// notify
|
||||
cleanUpPortalNotification()
|
||||
// TODO: add "open" button
|
||||
captivePortalNotification = notifications.Notify(¬ifications.Notification{
|
||||
EventID: fmt.Sprintf(
|
||||
"netenv:captive-portal:%s", captivePortal.Domain,
|
||||
),
|
||||
Type: notifications.Info,
|
||||
Title: "Captive Portal",
|
||||
Category: "Core",
|
||||
Message: fmt.Sprintf(
|
||||
"Portmaster detected a captive portal at %s",
|
||||
captivePortal.Domain,
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
func cleanUpPortalNotification() {
|
||||
|
||||
Reference in New Issue
Block a user