admin: View out of sync repositories

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

View File

@ -105,7 +105,7 @@ const indextpl = `<!DOCTYPE html>
<span class="badge badge-{{ "{{ priorities[myClaimsMaxLevel] }}" }}" ng-show="myClaims">{{ "{{ myClaims }}" }}</span>
<span class="badge badge-{{ "{{ priorities[newClaimsMaxLevel] }}" }}" ng-show="newClaims">{{ "{{ newClaims }}" }}</span>
</a></li>
<li class="nav-item" ng-class="{'active': $location.path().startsWith('/sync')}">
<li class="nav-item" ng-class="{'active': $location.path().startsWith('/sync') || $location.path().startsWith('/repositories')}">
<a class="nav-link" href="sync" ng-show="settings.wip">
Synchronisation
</a>

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;

View File

@ -18,7 +18,7 @@
<td>{{ repository.path }}</td>
<td>{{ repository.branch }}</td>
<td>{{ repository.hash }}</td>
<td></td>
<td><repository-uptodate repository="repository" /></td>
</tr>
</tbody>
</table>

View File

@ -22,6 +22,9 @@
<div class="badge badge-success align-self-center" ng-if="syncReport" title="{{ syncReport._updated[syncReport._updated.length-1] }}">
Dernier import&nbsp;: {{ syncReport._updated[syncReport._updated.length-1] | date:"medium" }}
</div>
<a ng-if="configro['sync-type'] === 'GitImporter'" href="repositories" class="btn btn-secondary">
Voir les dépôts
</a>
</div>
<div class="progress" style="height: 5px; border-radius: 0;">
<div class="progress-bar bg-primary progress-bar-striped" ng-class="{'progress-bar-animated': syncPercent && syncPercent < 100}" role="progressbar" style="width: {{ syncPercent }}%"></div>