Initial add of notifications
This commit is contained in:
parent
24cf7fd4cc
commit
ca9a6c3e1d
9 changed files with 98 additions and 6 deletions
20
main.go
20
main.go
|
|
@ -150,6 +150,8 @@ func main() { // {{{
|
|||
service.Register("/trigger/run/{id}", false, false, actionTriggerRun)
|
||||
service.Register("/trigger/delete/{id}", false, false, actionTriggerDelete)
|
||||
|
||||
service.Register("/notifications", false, false, pageNotifications)
|
||||
|
||||
service.Register("/configuration", false, false, pageConfiguration)
|
||||
service.Register("/configuration/theme", false, false, actionConfigurationTheme)
|
||||
service.Register("/configuration/timezone", false, false, actionConfigurationTimezone)
|
||||
|
|
@ -1194,3 +1196,21 @@ func actionConfigurationNotificationDelete(w http.ResponseWriter, r *http.Reques
|
|||
w.Header().Add("Location", "/configuration")
|
||||
w.WriteHeader(302)
|
||||
} // }}}
|
||||
|
||||
func pageNotifications(w http.ResponseWriter, r *http.Request, _ *session.T) { // {{{
|
||||
nss, err := notificationsSent()
|
||||
if err != nil {
|
||||
pageError(w, "/", werr.Wrap(err).Log())
|
||||
}
|
||||
|
||||
page := Page{
|
||||
LAYOUT: "main",
|
||||
PAGE: "notifications",
|
||||
CONFIG: smonConfig.Settings,
|
||||
Data: map[string]any{
|
||||
"Notifications": nss,
|
||||
},
|
||||
}
|
||||
|
||||
page.Render(w, r)
|
||||
} // }}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue