Commit ca96cfd3 by Thomas Bosch

status (online/offline)

parent 9b4b0901
......@@ -10,6 +10,7 @@ angular.module('registry')
for (var i = 0; i < applications.length; i++) {
var app = applications[i];
ApplicationInfo.getInfo(app);
ApplicationInfo.getHealth(app);
}
});
......
......@@ -13,6 +13,19 @@ angular.module('registry.services', ['ngResource'])
this.getInfo = function(app) {
return $http.get(app.url + '/info').success(function(response) {
app.version = response.version;
}).error(function() {
app.version = '---';
});
}
this.getHealth = function(app) {
return $http.get(app.url + '/health').success(function(response) {
if (response.indexOf('ok') != -1 || response.status.indexOf('ok') != -1) {
app.status = 'online';
} else {
app.status = 'offline';
}
}).error(function() {
app.status = 'offline';
});
}
}]);
\ No newline at end of file
......@@ -5,7 +5,7 @@
<tr>
<th>Service</th>
<th>Version</th>
<th></th>
<th>Status</th>
<th></th>
<th></th>
<th></th>
......@@ -15,7 +15,7 @@
<tr ng-repeat="application in applications">
<td>{{ application.id }}</td>
<td>{{ application.version }}</td>
<td></td>
<td>{{ application.status }}</td>
<td></td>
<td><!-- <button type="button" ng-click="editService(service.id)" class="btn btn-success">Edit</button> --></td>
</tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment