mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
Mark unshared folders as 'Unshared' and in warning color (fixes #962)
This commit is contained in:
parent
254c63763a
commit
2926bbfe15
@ -130,6 +130,7 @@
|
||||
"The rescan interval must be a non-negative number of seconds.": "The rescan interval must be a non-negative number of seconds.",
|
||||
"The rescan interval must be at least 5 seconds.": "The rescan interval must be at least 5 seconds.",
|
||||
"Unknown": "Unknown",
|
||||
"Unshared": "Unshared",
|
||||
"Up to Date": "Up to Date",
|
||||
"Upgrade To {%version%}": "Upgrade To {{version}}",
|
||||
"Upgrading": "Upgrading",
|
||||
|
@ -89,12 +89,13 @@
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="panel-group" id="folders">
|
||||
<div class="panel panel-{{folderClass(folder.ID)}}" ng-repeat="folder in folderList()">
|
||||
<div class="panel panel-{{folderClass(folder)}}" ng-repeat="folder in folderList()">
|
||||
<div class="panel-heading" data-toggle="collapse" data-parent="#folders" href="#folder-{{$index}}" style="cursor: pointer">
|
||||
<h3 class="panel-title">
|
||||
<span class="glyphicon glyphicon-hdd"></span> {{folder.ID}}
|
||||
<span class="pull-right hidden-xs" ng-switch="folderStatus(folder.ID)">
|
||||
<span class="pull-right hidden-xs" ng-switch="folderStatus(folder)">
|
||||
<span translate ng-switch-when="unknown">Unknown</span>
|
||||
<span translate ng-switch-when="unshared">Unshared</span>
|
||||
<span translate ng-switch-when="stopped">Stopped</span>
|
||||
<span translate ng-switch-when="scanning">Scanning</span>
|
||||
<span ng-switch-when="syncing">
|
||||
|
@ -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';
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user