admin: read sync import in settings page

This commit is contained in:
nemunaire 2019-01-20 14:27:51 +01:00
parent 58dbd9499b
commit 19b57f5908
2 changed files with 18 additions and 0 deletions

View File

@ -438,8 +438,22 @@ angular.module("FICApp")
$scope.configro = ROSettings.get();
$scope.duration = 240;
var needRefreshSyncReportWhenReady = false;
var refreshSyncReport = function() {
needRefreshSyncReportWhenReady = false;
$http.get("full_import_report.json").then(function(response) {
console.log(response.data);
$scope.syncReport = response.data;
})
};
refreshSyncReport()
var progressInterval = $interval(function() {
$http.get("/api/sync/deep").then(function(response) {
if (response.data.progress && response.data.progress != 255)
needRefreshSyncReportWhenReady = true;
else if (needRefreshSyncReportWhenReady)
refreshSyncReport();
if (response.data && response.data.progress)
$scope.syncProgress = Math.floor(response.data.progress * 100 / 255) + " %";
else

View File

@ -179,8 +179,12 @@
<div class="float-right" ng-if="configro.sync">
{{ syncProgress }}
</div>
<div ng-if="syncReport">
Dernier import&nbsp;: {{ syncReport._date[1] }}
</div>
<div class="text-left" ng-if="configro.sync">
<button type="button" class="btn btn-secondary" ng-click="deepSync()" ng-disabled="deepSyncInProgress"><span class="glyphicon glyphicon-import" aria-hidden="true"></span> Synchronisation intégrale</button>
<a href="check_import.html" class="btn btn-success" target="_self" ng-if="syncReport">Voir le rapport</a>
</div>
</div>