Commit aa9b715e by Thomas Bosch

env

parent 92d6a31c
......@@ -40,6 +40,11 @@ angular.module('springBootAdmin', [
url: '/metrics',
templateUrl: 'views/apps/details/metrics.html',
controller: 'metricsCtrl'
})
.state('apps.details.env', {
url: '/env',
templateUrl: 'views/apps/details/env.html',
controller: 'envCtrl'
});
})
.run(function ($rootScope, $state, $stateParams, $log) {
......
......@@ -32,4 +32,9 @@ angular.module('springBootAdmin')
$scope.application = Application.query({id: $stateParams.id}, function(application) {
ApplicationDetails.getMetrics(application);
});
})
.controller('envCtrl', function ($scope, $stateParams, Application, ApplicationDetails) {
$scope.application = Application.query({id: $stateParams.id}, function(application) {
ApplicationDetails.getEnv(application);
});
});
......@@ -38,7 +38,7 @@ angular.module('springBootAdmin.services', ['ngResource'])
.service('ApplicationDetails', ['$http', function($http) {
this.getInfo = function(app) {
return $http.get(app.url + '/info').success(function(response) {
app.info = response;
app.info = angular.toJson(response, true);
});
}
this.getMetrics = function(app) {
......@@ -46,4 +46,12 @@ angular.module('springBootAdmin.services', ['ngResource'])
app.metrics = response;
});
}
this.getEnv = function(app) {
return $http.get(app.url + '/env').success(function(response) {
app.env = response;
app.env.systemProp = angular.toJson(app.env['systemProperties'], true);
app.env.systemEnv = angular.toJson(app.env['systemEnvironment'], true);
//app.env.config = response['applicationConfig: [classpath:/application.properties]'];
});
}
}]);
......@@ -10,6 +10,7 @@
<ul class="nav nav-tabs">
<li ui-sref-active="active"><a ui-sref="apps.details.infos({id: application.id})">Infos</a></li>
<li ui-sref-active="active"><a ui-sref="apps.details.metrics({id: application.id})">Metrics</a></li>
<li ui-sref-active="active"><a ui-sref="apps.details.env({id: application.id})">Environment</a></li>
</ul>
<div class="tab-content">
<div ui-view></div>
......
......@@ -4,9 +4,6 @@
<th>Used Memory</th>
<th>Free Memory</th>
<th>Processors</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
......@@ -14,9 +11,6 @@
<td>{{ application.metrics['mem'] / 1024 | number:2 }} MB</td>
<td>{{ application.metrics['mem.free'] / 1024 | number:2 }} MB</td>
<td>{{ application.metrics['processors'] }}</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
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