Mark unshared folders as 'Unshared' and in warning color (fixes #962)

This commit is contained in:
Jakob Borg
2014-11-29 09:18:52 +01:00
parent 254c63763a
commit 2926bbfe15
4 changed files with 26 additions and 13 deletions

View File

@@ -397,28 +397,39 @@ angular.module('syncthing.core')
refreshErrors();
};
$scope.folderStatus = function (folder) {
if (typeof $scope.model[folder] === 'undefined') {
$scope.folderStatus = function (folderCfg) {
if (typeof $scope.model[folderCfg.ID] === 'undefined') {
return 'unknown';
}
if ($scope.model[folder].invalid !== '') {
if (folderCfg.Devices.length <= 1) {
return 'unshared';
}
if ($scope.model[folderCfg.ID].invalid !== '') {
return 'stopped';
}
return '' + $scope.model[folder].state;
return '' + $scope.model[folderCfg.ID].state;
};
$scope.folderClass = function (folder) {
if (typeof $scope.model[folder] === 'undefined') {
$scope.folderClass = function (folderCfg) {
if (typeof $scope.model[folderCfg.ID] === 'undefined') {
// Unknown
return 'info';
}
if ($scope.model[folder].invalid !== '') {
if (folderCfg.Devices.length <= 1) {
// Unshared
return 'warning';
}
if ($scope.model[folderCfg.ID].invalid !== '') {
// Errored
return 'danger';
}
var state = '' + $scope.model[folder].state;
var state = '' + $scope.model[folderCfg.ID].state;
if (state == 'idle') {
return 'success';
}