admin: Add a route and a button to sync the filesystem

This commit is contained in:
nemunaire 2021-11-13 11:06:24 +01:00
parent a06602a7e8
commit 038abe450d
4 changed files with 27 additions and 6 deletions

View file

@ -610,10 +610,10 @@ angular.module("FICApp")
$scope.deepSyncInProgress = true;
$http.post(url).then(function() {
$scope.deepSyncInProgress = false;
$scope.addToast('success', 'Synchronisation intégrale terminée.', '<a href="check_import.html">Voir le rapport</a>.', 15000);
$scope.addToast('success', 'Synchronisation intégrale terminée.', '<a href="check_import.html" target="_self">Voir le rapport</a>.', 15000);
}, function(response) {
$scope.deepSyncInProgress = false;
$scope.addToast('warning', 'Synchronisation intégrale terminée.', '<a href="check_import.html">Voir le rapport</a>.', 15000);
$scope.addToast('warning', 'Synchronisation intégrale terminée.', '<a href="check_import.html" target="_self">Voir le rapport</a>.', 15000);
});
});
};
@ -623,10 +623,23 @@ angular.module("FICApp")
$scope.deepSyncInProgress = true;
$http.post("api/sync/speed").then(function() {
$scope.deepSyncInProgress = false;
$scope.addToast('success', 'Synchronisation profonde rapide terminée.', '<a href="check_import.html">Voir le rapport</a>.', 15000);
$scope.addToast('success', 'Synchronisation profonde rapide terminée.', '<a href="check_import.html" target="_self">Voir le rapport</a>.', 15000);
}, function(response) {
$scope.deepSyncInProgress = false;
$scope.addToast('warning', 'Synchronisation profinde rapide terminée.', '<a href="check_import.html">Voir le rapport</a>.', 15000);
$scope.addToast('warning', 'Synchronisation profinde rapide terminée.', '<a href="check_import.html" target="_self">Voir le rapport</a>.', 15000);
});
});
};
$scope.baseSync = function() {
$scope.addToast('warning', 'Tirer les mises à jour du dépôt ?', '',
function() {
$scope.deepSyncInProgress = true;
$http.post("api/sync/base").then(function() {
$scope.deepSyncInProgress = false;
$scope.addToast('success', 'Mise à jour terminée.');
}, function(response) {
$scope.deepSyncInProgress = false;
$scope.addToast('danger', 'Mise à jour terminée.', response.data.errmsg);
});
});
};