health: done
This commit is contained in:
parent
a0b19f6184
commit
007efc6118
4 changed files with 58 additions and 15 deletions
|
|
@ -136,6 +136,9 @@ angular.module("FICApp")
|
|||
.factory("Timestamp", function($resource) {
|
||||
return $resource("/api/timestamps.json")
|
||||
})
|
||||
.factory("Health", function($resource) {
|
||||
return $resource("/api/health.json")
|
||||
})
|
||||
.factory("Monitor", function($resource) {
|
||||
return $resource("/api/monitor/:machineId", { machineId: '@id' })
|
||||
})
|
||||
|
|
@ -416,6 +419,15 @@ angular.module("FICApp")
|
|||
$scope.$on('$destroy', function () { $interval.cancel(myinterval); });
|
||||
})
|
||||
|
||||
.controller("HealthController", function($scope, $interval, Health) {
|
||||
var refresh = function() {
|
||||
$scope.health = Health.query();
|
||||
}
|
||||
refresh();
|
||||
var myinterval = $interval(refresh, 2500);
|
||||
$scope.$on('$destroy', function () { $interval.cancel(myinterval); });
|
||||
})
|
||||
|
||||
.controller("MonitorController", function($scope, Monitor) {
|
||||
$scope.monitor = Monitor.get();
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,14 +1,24 @@
|
|||
<div class="jumbotron text-light bg-dark">
|
||||
<h1 class="display-4">Interface d'administration du challenge</h1>
|
||||
<p class="lead">
|
||||
Sélectionnez une action dans le menu ci-dessus.
|
||||
</p>
|
||||
<hr class="my-4">
|
||||
<p ng-controller="VersionController">
|
||||
Version de l'API : {{ v.version }}
|
||||
</p>
|
||||
<p ng-controller="TimestampController">
|
||||
Latence frontend-backend : <ng-pluralize count="t.diffFB / 1000000000" when="{'one': '{} seconde', 'other': '{} secondes'}"></ng-pluralize><br>
|
||||
Dernière synchronisation du frontend : {{ t.frontend | date:"mediumTime" }}
|
||||
</p>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p ng-controller="VersionController">
|
||||
Version de l'API : {{ v.version }}
|
||||
</p>
|
||||
<p ng-controller="TimestampController">
|
||||
Latence frontend-backend : <ng-pluralize count="t.diffFB / 1000000000" when="{'one': '{} seconde', 'other': '{} secondes'}"></ng-pluralize><br>
|
||||
Dernière synchronisation du frontend : {{ t.frontend | date:"mediumTime" }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<ul ng-controller="HealthController">
|
||||
<li ng-repeat="heal in health">
|
||||
<a ng-href="teams/{{ heal.id_team }}" ng-if="heal.id_team">{{ heal.path }}</a>
|
||||
<span ng-if="!heal.id_team">{{ heal.path }}</span>
|
||||
: {{ heal.error }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Reference in a new issue