gui: Move discovery failures to modal (fixes #2344)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4048
LGTM: calmh, AudriusButkevicius
This commit is contained in:
Sacheendra Talluri 2017-03-20 13:55:08 +00:00 committed by Audrius Butkevicius
parent 3e49b73f70
commit ee92ee0190
4 changed files with 30 additions and 2 deletions

View File

@ -52,6 +52,7 @@
"Disconnected": "Disconnected", "Disconnected": "Disconnected",
"Discovered": "Discovered", "Discovered": "Discovered",
"Discovery": "Discovery", "Discovery": "Discovery",
"Discovery Failures": "Discovery Failures",
"Documentation": "Documentation", "Documentation": "Documentation",
"Download Rate": "Download Rate", "Download Rate": "Download Rate",
"Downloaded": "Downloaded", "Downloaded": "Downloaded",
@ -67,6 +68,7 @@
"Error": "Error", "Error": "Error",
"External File Versioning": "External File Versioning", "External File Versioning": "External File Versioning",
"Failed Items": "Failed Items", "Failed Items": "Failed Items",
"Failure to connect to IPv6 servers is expected if there is no IPv6 connectivity.": "Failure to connect to IPv6 servers is expected if there is no IPv6 connectivity.",
"File Pull Order": "File Pull Order", "File Pull Order": "File Pull Order",
"File Versioning": "File Versioning", "File Versioning": "File Versioning",
"File permission bits are ignored when looking for changes. Use on FAT file systems.": "File permission bits are ignored when looking for changes. Use on FAT file systems.", "File permission bits are ignored when looking for changes. Use on FAT file systems.": "File permission bits are ignored when looking for changes. Use on FAT file systems.",

View File

@ -511,8 +511,8 @@
<span>{{discoveryTotal}}/{{discoveryTotal}}</span> <span>{{discoveryTotal}}/{{discoveryTotal}}</span>
</span> </span>
<span ng-if="discoveryFailed.length != 0" class="data" ng-class="{'text-danger': discoveryFailed.length == discoveryTotal}"> <span ng-if="discoveryFailed.length != 0" class="data" ng-class="{'text-danger': discoveryFailed.length == discoveryTotal}">
<span popover data-trigger="hover" data-placement="bottom" data-html="true" data-content="{{discoveryFailed.join('<br>\n')}}"> <span popover data-trigger="hover" data-placement="bottom" data-content="Click to see discovery failures.">
{{discoveryTotal-discoveryFailed.length}}/{{discoveryTotal}} <a href="" style="color:inherit" ng-click="showDiscoveryFailures()">{{discoveryTotal-discoveryFailed.length}}/{{discoveryTotal}}</a>
</span> </span>
</span> </span>
</td> </td>
@ -680,6 +680,7 @@
<ng-include src="'syncthing/transfer/failedFilesModalView.html'"></ng-include> <ng-include src="'syncthing/transfer/failedFilesModalView.html'"></ng-include>
<ng-include src="'syncthing/core/majorUpgradeModalView.html'"></ng-include> <ng-include src="'syncthing/core/majorUpgradeModalView.html'"></ng-include>
<ng-include src="'syncthing/core/aboutModalView.html'"></ng-include> <ng-include src="'syncthing/core/aboutModalView.html'"></ng-include>
<ng-include src="'syncthing/core/discoveryFailuresModalView.html'"></ng-include>
<!-- vendor scripts --> <!-- vendor scripts -->
<script src="vendor/jquery/jquery-2.2.2.js"></script> <script src="vendor/jquery/jquery-2.2.2.js"></script>

View File

@ -0,0 +1,21 @@
<modal id="discovery-failures" status="danger" icon="exclamation-circle" heading="{{'Discovery Failures' | translate}}" large="yes" closeable="yes">
<div class="modal-body">
<ul>
<li ng-repeat="failure in discoveryFailed">{{failure}}</li>
</ul>
</div>
<div class="row">
<div class="col-md-offset-2 col-md-8">
<div class="panel panel-default">
<div translate class="panel-body">
Failure to connect to IPv6 servers is expected if there is no IPv6 connectivity.
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
<span class="fa fa-times"></span>&nbsp;<span translate>Close</span>
</button>
</div>
</modal>

View File

@ -999,6 +999,10 @@ angular.module('syncthing.core')
} }
}; };
$scope.showDiscoveryFailures = function () {
$('#discovery-failures').modal();
};
$scope.editSettings = function () { $scope.editSettings = function () {
// Make a working copy // Make a working copy
$scope.tmpOptions = angular.copy($scope.config.options); $scope.tmpOptions = angular.copy($scope.config.options);