admin: Add a button to permit deleting strange submissions

This commit is contained in:
nemunaire 2024-02-09 17:56:05 +01:00
parent 0b04185933
commit 632eb62f1f
3 changed files with 24 additions and 1 deletions

View file

@ -529,12 +529,23 @@ angular.module("FICApp")
$scope.$on('$destroy', function () { $interval.cancel(myinterval); });
})
.controller("HealthController", function($scope, $interval, Health) {
.controller("HealthController", function($scope, $interval, Health, $http) {
var refresh = function() {
$scope.health = Health.query();
}
refresh();
var myinterval = $interval(refresh, 2500);
$scope.drop_submission = function(path) {
$scope.addToast('info', 'Delete submission', 'Ensure this submission is not interesting. Continue?',
function() {
$http.delete("api/submissions" + path).then(function(response) {
refresh();
}, function(response) {
$scope.addToast('danger', 'An error occurs when deleting submission:', response.data.errmsg);
});
}
);
}
$scope.$on('$destroy', function () { $interval.cancel(myinterval); });
})