lib/model, lib/stats: Keep track of folder's last scan time (ref #3143)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3250 LGTM: calmh, AudriusButkevicius
This commit is contained in:
committed by
Audrius Butkevicius
parent
16063933d1
commit
48245effdf
@@ -171,6 +171,12 @@ angular.module('syncthing.core')
|
||||
if (data.to === 'scanning') {
|
||||
delete $scope.scanProgress[data.folder];
|
||||
}
|
||||
|
||||
// If a folder finished scanning, then refresh folder stats
|
||||
// to update last scan time.
|
||||
if(data.from === 'scanning' && data.to === 'idle') {
|
||||
refreshFolderStats();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -585,6 +591,9 @@ angular.module('syncthing.core')
|
||||
if ($scope.folderStats[folder].lastFile) {
|
||||
$scope.folderStats[folder].lastFile.at = new Date($scope.folderStats[folder].lastFile.at);
|
||||
}
|
||||
|
||||
$scope.folderStats[folder].lastScan = new Date($scope.folderStats[folder].lastScan);
|
||||
$scope.folderStats[folder].lastScanDays = (new Date() - $scope.folderStats[folder].lastScan) / 1000 / 86400;
|
||||
}
|
||||
console.log("refreshfolderStats", data);
|
||||
}).error($scope.emitHTTPError);
|
||||
|
||||
Reference in New Issue
Block a user