gui: New folder state "Local Additions" for receive-only (fixes #5968) (#6117)

This commit is contained in:
Simon Frei
2019-11-01 20:44:23 +01:00
committed by Jakob Borg
parent 3b5dff3f34
commit cf420e135e
4 changed files with 15 additions and 6 deletions

View File

@@ -770,16 +770,18 @@ angular.module('syncthing.core')
return 'paused';
}
var folderInfo = $scope.model[folderCfg.id];
// after restart syncthing process state may be empty
if (!$scope.model[folderCfg.id].state) {
if (!folderInfo.state) {
return 'unknown';
}
var state = '' + $scope.model[folderCfg.id].state;
var state = '' + folderInfo.state;
if (state === 'error') {
return 'stopped'; // legacy, the state is called "stopped" in the GUI
}
if (state === 'idle' && $scope.model[folderCfg.id].needTotalItems > 0) {
if (state === 'idle' && folderInfo.needTotalItems > 0) {
return 'outofsync';
}
if ($scope.hasFailedFiles(folderCfg.id)) {
@@ -789,6 +791,10 @@ angular.module('syncthing.core')
return state;
}
if (folderInfo.receiveOnlyTotalItems) {
return 'localadditions';
}
if (folderCfg.devices.length <= 1) {
return 'unshared';
}
@@ -799,7 +805,7 @@ angular.module('syncthing.core')
$scope.folderClass = function (folderCfg) {
var status = $scope.folderStatus(folderCfg);
if (status === 'idle') {
if (status === 'idle' || status === 'localadditions') {
return 'success';
}
if (status == 'paused') {