all: Fix FS watcher restarting and web UI indication (fixes #4923) (#4962)

This commit is contained in:
Simon Frei
2018-06-11 15:47:54 +02:00
committed by Jakob Borg
parent 1e2732aa21
commit 9e0e04f4de
6 changed files with 87 additions and 15 deletions

View File

@@ -1466,6 +1466,16 @@ angular.module('syncthing.core')
$http.post(urlbase + '/system/error/clear');
};
$scope.fsWatcherErrorMap = function () {
var errs = {}
$.each($scope.folders, function (id, cfg) {
if (cfg.fsWatcherEnabled && $scope.model[cfg.id] && $scope.model[id].watchError && !cfg.paused && $scope.folderStatus(cfg) !== 'stopped') {
errs[id] = $scope.model[id].watchError;
}
});
return errs;
}
$scope.friendlyDevices = function (str) {
for (var i = 0; i < $scope.devices.length; i++) {
var cfg = $scope.devices[i];
@@ -2248,6 +2258,9 @@ angular.module('syncthing.core')
};
$scope.sizeOf = function (dict) {
if (dict === undefined) {
return 0;
}
return Object.keys(dict).length;
};