Added theme to configuration page
This commit is contained in:
parent
c77737a20e
commit
54ba7b160b
6 changed files with 29 additions and 0 deletions
12
main.go
12
main.go
|
|
@ -148,6 +148,7 @@ func main() { // {{{
|
|||
service.Register("/trigger/delete/{id}", false, false, actionTriggerDelete)
|
||||
|
||||
service.Register("/configuration", false, false, pageConfiguration)
|
||||
service.Register("/configuration/theme", false, false, actionConfigurationTheme)
|
||||
service.Register("/entry/{datapoint}", false, false, actionEntryDatapoint)
|
||||
|
||||
go nodataLoop()
|
||||
|
|
@ -955,3 +956,14 @@ func pageConfiguration(w http.ResponseWriter, _ *http.Request, _ *session.T) { /
|
|||
|
||||
page.Render(w)
|
||||
} // }}}
|
||||
func actionConfigurationTheme(w http.ResponseWriter, r *http.Request, _ *session.T) { // {{{
|
||||
theme := r.FormValue("theme")
|
||||
err := smonConfig.SetTheme(theme)
|
||||
if err != nil {
|
||||
httpError(w, werr.Wrap(err).Log())
|
||||
return
|
||||
}
|
||||
|
||||
w.Header().Add("Location", "/configuration")
|
||||
w.WriteHeader(302)
|
||||
} // }}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue