admin: View out of sync repositories
This commit is contained in:
parent
9a34e393f3
commit
08107931ea
4 changed files with 29 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Reference in a new issue