Clear acknowledged errors server-side as well (fixes #128)
This commit is contained in:
@@ -41,6 +41,7 @@ func startGUI(cfg GUIConfiguration, m *Model) {
|
||||
router.Post("/rest/restart", restPostRestart)
|
||||
router.Post("/rest/reset", restPostReset)
|
||||
router.Post("/rest/error", restPostError)
|
||||
router.Post("/rest/error/clear", restClearErrors)
|
||||
|
||||
go func() {
|
||||
mr := martini.New()
|
||||
@@ -191,6 +192,12 @@ func restPostError(req *http.Request) {
|
||||
showGuiError(string(bs))
|
||||
}
|
||||
|
||||
func restClearErrors() {
|
||||
guiErrorsMut.Lock()
|
||||
guiErrors = nil
|
||||
guiErrorsMut.Unlock()
|
||||
}
|
||||
|
||||
func showGuiError(err string) {
|
||||
guiErrorsMut.Lock()
|
||||
guiErrors = append(guiErrors, guiError{time.Now(), err})
|
||||
|
||||
Reference in New Issue
Block a user