diff --git a/assets/statusicons/default.svg b/assets/statusicons/default.svg new file mode 100644 index 000000000..b281649b8 Binary files /dev/null and b/assets/statusicons/default.svg differ diff --git a/assets/statusicons/notify.svg b/assets/statusicons/notify.svg new file mode 100644 index 000000000..84998a045 Binary files /dev/null and b/assets/statusicons/notify.svg differ diff --git a/assets/statusicons/pause.svg b/assets/statusicons/pause.svg new file mode 100644 index 000000000..f2589e2f8 Binary files /dev/null and b/assets/statusicons/pause.svg differ diff --git a/assets/statusicons/sync.svg b/assets/statusicons/sync.svg new file mode 100644 index 000000000..9ec5af183 Binary files /dev/null and b/assets/statusicons/sync.svg differ diff --git a/gui/default/assets/img/favicon-default.png b/gui/default/assets/img/favicon-default.png new file mode 100644 index 000000000..129dc5051 Binary files /dev/null and b/gui/default/assets/img/favicon-default.png differ diff --git a/gui/default/assets/img/favicon-notify.png b/gui/default/assets/img/favicon-notify.png new file mode 100644 index 000000000..3613e723e Binary files /dev/null and b/gui/default/assets/img/favicon-notify.png differ diff --git a/gui/default/assets/img/favicon-pause.png b/gui/default/assets/img/favicon-pause.png new file mode 100644 index 000000000..e5791fb3f Binary files /dev/null and b/gui/default/assets/img/favicon-pause.png differ diff --git a/gui/default/assets/img/favicon-sync.png b/gui/default/assets/img/favicon-sync.png new file mode 100644 index 000000000..42999be65 Binary files /dev/null and b/gui/default/assets/img/favicon-sync.png differ diff --git a/gui/default/assets/img/favicon.png b/gui/default/assets/img/favicon.png deleted file mode 100644 index 437c0c65a..000000000 Binary files a/gui/default/assets/img/favicon.png and /dev/null differ diff --git a/gui/default/index.html b/gui/default/index.html index 51008eb1c..7cbc90e7c 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -14,7 +14,7 @@ - + diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 5722f5f4a..0d058c5da 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -780,6 +780,70 @@ angular.module('syncthing.core') return 'info'; }; + $scope.syncthingStatus = function () { + var syncCount = 0; + var notifyCount = 0; + var pauseCount = 0; + + // loop through all folders + var folderListCache = $scope.folderList(); + for (var i = 0; i < folderListCache.length; i++) { + var status = $scope.folderStatus(folderListCache[i]); + switch (status) { + case 'syncing': + syncCount++; + break; + case 'stopped': + case 'unknown': + case 'outofsync': + case 'error': + notifyCount++; + break; + } + } + + // loop through all devices + var deviceCount = $scope.devices.length; + for (var i = 0; i < $scope.devices.length; i++) { + var status = $scope.deviceStatus({ + deviceID:$scope.devices[i].deviceID + }); + switch (status) { + case 'unknown': + notifyCount++; + break; + case 'paused': + pauseCount++; + break; + case 'unused': + deviceCount--; + break; + } + } + + // enumerate notifications + if ($scope.openNoAuth || !$scope.configInSync || Object.keys($scope.deviceRejections).length > 0 || Object.keys($scope.folderRejections).length > 0 || $scope.errorList().length > 0 || !online) { + notifyCount++; + } + + // at least one folder is syncing + if (syncCount > 0) { + return 'sync'; + } + + // a device is unknown or a folder is stopped/unknown/outofsync/error or some other notification is open or gui offline + if (notifyCount > 0) { + return 'notify'; + } + + // all used devices are paused except (this) one + if (pauseCount === deviceCount-1) { + return 'pause'; + } + + return 'default'; + }; + $scope.deviceAddr = function (deviceCfg) { var conn = $scope.connections[deviceCfg.deviceID]; if (conn && conn.connected) {