mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 15:17:25 +00:00
Clear acknowledged errors server-side as well (fixes #128)
This commit is contained in:
parent
622568c327
commit
a98d75edaa
File diff suppressed because one or more lines are too long
@ -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})
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user