mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
gui: Remaining sync bytes in folder header (fixes #3908)
The progress indicator in the folder header in the GUI now shows the remaining bytes to sync as well as the percentage. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3928
This commit is contained in:
parent
9833d13762
commit
e03be9158b
@ -285,7 +285,7 @@
|
||||
<span ng-switch-when="idle"><span class="hidden-xs" translate>Up to Date</span><span class="visible-xs">◼</span></span>
|
||||
<span ng-switch-when="syncing">
|
||||
<span class="hidden-xs" translate>Syncing</span>
|
||||
({{syncPercentage(folder.id)}}%)
|
||||
<span ng-show="syncRemaining(folder.id)">({{syncPercentage(folder.id)}}%, {{syncRemaining(folder.id) | binary}}B)</span>
|
||||
</span>
|
||||
<span ng-switch-when="outofsync"><span class="hidden-xs" translate>Out of Sync</span><span class="visible-xs">◼</span></span>
|
||||
</div>
|
||||
|
@ -722,6 +722,22 @@ angular.module('syncthing.core')
|
||||
return Math.floor(pct);
|
||||
};
|
||||
|
||||
$scope.syncRemaining = function (folder) {
|
||||
// Remaining sync bytes
|
||||
if (typeof $scope.model[folder] === 'undefined') {
|
||||
return 0;
|
||||
}
|
||||
if ($scope.model[folder].globalBytes === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var bytes = $scope.model[folder].globalBytes - $scope.model[folder].inSyncBytes;
|
||||
if (isNaN(bytes) || bytes < 0) {
|
||||
return 0;
|
||||
}
|
||||
return bytes;
|
||||
};
|
||||
|
||||
$scope.scanPercentage = function (folder) {
|
||||
if (!$scope.scanProgress[folder]) {
|
||||
return undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user