mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
gui: Count deleted items for remote out of sync items display (fixes #4668)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4669 LGTM: calmh, AudriusButkevicius
This commit is contained in:
parent
916ec63af6
commit
f1c73999be
@ -665,14 +665,17 @@ func (s *apiService) getDBCompletion(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
comp := s.model.Completion(device, folder)
|
||||
sendJSON(w, map[string]interface{}{
|
||||
sendJSON(w, jsonCompletion(s.model.Completion(device, folder)))
|
||||
}
|
||||
|
||||
func jsonCompletion(comp model.FolderCompletion) map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"completion": comp.CompletionPct,
|
||||
"needBytes": comp.NeedBytes,
|
||||
"needItems": comp.NeedItems,
|
||||
"globalBytes": comp.GlobalBytes,
|
||||
"needDeletes": comp.NeedDeletes,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (s *apiService) getDBStatus(w http.ResponseWriter, r *http.Request) {
|
||||
|
@ -205,15 +205,10 @@ func (c *folderSummaryService) sendSummary(folder string) {
|
||||
|
||||
// Get completion percentage of this folder for the
|
||||
// remote device.
|
||||
comp := c.model.Completion(devCfg.DeviceID, folder)
|
||||
events.Default.Log(events.FolderCompletion, map[string]interface{}{
|
||||
"folder": folder,
|
||||
"device": devCfg.DeviceID.String(),
|
||||
"completion": comp.CompletionPct,
|
||||
"needBytes": comp.NeedBytes,
|
||||
"needItems": comp.NeedItems,
|
||||
"globalBytes": comp.GlobalBytes,
|
||||
})
|
||||
comp := jsonCompletion(c.model.Completion(devCfg.DeviceID, folder))
|
||||
comp["folder"] = folder
|
||||
comp["device"] = devCfg.DeviceID.String()
|
||||
events.Default.Log(events.FolderCompletion, comp)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -495,7 +495,7 @@ angular.module('syncthing.core')
|
||||
} else {
|
||||
$scope.completion[device]._total = Math.floor(100 * (1 - needed / total));
|
||||
$scope.completion[device]._needBytes = needed
|
||||
$scope.completion[device]._needItems = items;
|
||||
$scope.completion[device]._needItems = items + deletes;
|
||||
}
|
||||
|
||||
if (needed == 0 && deletes > 0) {
|
||||
@ -2054,7 +2054,8 @@ angular.module('syncthing.core')
|
||||
resetRemoteNeed();
|
||||
$scope.remoteNeedDevice = device;
|
||||
$scope.deviceFolders(device).forEach(function(folder) {
|
||||
if ($scope.completion[device.deviceID][folder] !== undefined && $scope.completion[device.deviceID][folder].needItems === 0) {
|
||||
var comp = $scope.completion[device.deviceID][folder];
|
||||
if (comp !== undefined && comp.needItems + comp.needDeletes === 0) {
|
||||
return;
|
||||
}
|
||||
$scope.remoteNeedFolders.push(folder);
|
||||
|
Loading…
Reference in New Issue
Block a user