Clear acknowledged errors server-side as well (fixes #128)

This commit is contained in:
Jakob Borg 2014-04-16 16:30:49 +02:00
parent 622568c327
commit a98d75edaa
3 changed files with 9 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -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})

View File

@ -334,6 +334,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
$scope.clearErrors = function () {
$scope.seenError = $scope.errors[$scope.errors.length - 1].Time;
$http.post('/rest/error/clear');
};
$scope.friendlyNodes = function (str) {