admin: read sync import in settings page
This commit is contained in:
parent
58dbd9499b
commit
19b57f5908
@ -438,8 +438,22 @@ angular.module("FICApp")
|
|||||||
$scope.configro = ROSettings.get();
|
$scope.configro = ROSettings.get();
|
||||||
$scope.duration = 240;
|
$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() {
|
var progressInterval = $interval(function() {
|
||||||
$http.get("/api/sync/deep").then(function(response) {
|
$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)
|
if (response.data && response.data.progress)
|
||||||
$scope.syncProgress = Math.floor(response.data.progress * 100 / 255) + " %";
|
$scope.syncProgress = Math.floor(response.data.progress * 100 / 255) + " %";
|
||||||
else
|
else
|
||||||
|
@ -179,8 +179,12 @@
|
|||||||
<div class="float-right" ng-if="configro.sync">
|
<div class="float-right" ng-if="configro.sync">
|
||||||
{{ syncProgress }}
|
{{ syncProgress }}
|
||||||
</div>
|
</div>
|
||||||
|
<div ng-if="syncReport">
|
||||||
|
Dernier import : {{ syncReport._date[1] }}
|
||||||
|
</div>
|
||||||
<div class="text-left" ng-if="configro.sync">
|
<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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user