admin: View out of sync repositories

This commit is contained in:
nemunaire 2023-10-23 19:22:19 +02:00
commit 08107931ea
4 changed files with 29 additions and 2 deletions

View file

@ -728,6 +728,30 @@ angular.module("FICApp")
$scope.repositories = response.data.repositories;
});
})
.component('repositoryUptodate', {
bindings: {
repository: '<',
},
controller: function($http) {
var ctrl = this;
ctrl.status = {};
ctrl.color = "badge-secondary";
ctrl.$onInit = function() {
$http.post("api/repositories/" + ctrl.repository.path).then(function(response) {
ctrl.status = response.data;
if (ctrl.repository.hash.startsWith(ctrl.status.hash)) {
ctrl.color = "badge-success";
} else {
ctrl.color = "badge-danger";
}
});
};
},
template: `<span class="badge {{ $ctrl.color }}">{{ $ctrl.status.hash }}</span> <small>{{ $ctrl.status.text }}</small>`
})
.controller("SyncController", function($scope, $rootScope, ROSettings, $location, $http, $interval) {
$scope.displayDangerousActions = false;