gui: Use favicon as indication for status (fixes #1018)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3217
BIN
assets/statusicons/default.svg
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
assets/statusicons/notify.svg
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/statusicons/pause.svg
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
assets/statusicons/sync.svg
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
gui/default/assets/img/favicon-default.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
gui/default/assets/img/favicon-notify.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
gui/default/assets/img/favicon-pause.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
gui/default/assets/img/favicon-sync.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 6.4 KiB |
@ -14,7 +14,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link rel="shortcut icon" href="assets/img/favicon.png">
|
||||
<link rel="shortcut icon" href="assets/img/favicon-{{syncthingStatus()}}.png">
|
||||
<link rel="mask-icon" href="assets/img/safari-pinned-tab.svg" color="#0882c8">
|
||||
|
||||
<title ng-bind="thisDeviceName() + ' | Syncthing'"></title>
|
||||
|
@ -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) {
|
||||
|