Commit efa71e4c by Thomas Bosch

show properties

parent 7e16e193
......@@ -45,6 +45,11 @@ angular.module('springBootAdmin', [
url: '/env',
templateUrl: 'views/apps/details/env.html',
controller: 'envCtrl'
})
.state('apps.details.props', {
url: '/props',
templateUrl: 'views/apps/details/props.html',
controller: 'propsCtrl'
});
})
.run(function ($rootScope, $state, $stateParams, $log) {
......
......@@ -47,4 +47,9 @@ angular.module('springBootAdmin')
$scope.application = Application.query({id: $stateParams.id}, function(application) {
ApplicationDetails.getEnv(application);
});
})
.controller('propsCtrl', function ($scope, $stateParams, Application, ApplicationDetails) {
$scope.application = Application.query({id: $stateParams.id}, function(application) {
ApplicationDetails.getProps(application);
});
});
......@@ -56,7 +56,19 @@ angular.module('springBootAdmin.services', ['ngResource'])
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]'];
});
}
this.getProps = function(app) {
return $http.get(app.url + '/env').success(function(response) {
app.props = [];
for (var attr in response) {
if (attr.indexOf('[') != -1 && attr.indexOf('.properties]') != -1) {
var prop = new Object();
prop.key = attr;
prop.value = angular.toJson(response[attr], true);
app.props.push(prop);
}
}
});
}
}]);
......@@ -11,6 +11,7 @@
<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>
<li ui-sref-active="active"><a ui-sref="apps.details.props({id: application.id})">Properties</a></li>
</ul>
<div class="tab-content">
<div ui-view></div>
......
......@@ -4,15 +4,13 @@
<th>Profiles</th>
<th width="400">System Properties</th>
<th width="400">System Environment</th>
<!-- <th width="250">Application Config</th> -->
</tr>
</thead>
<tbody>
<tr>
<td>{{ application.env['profiles'] }}</td>
<td>{{ application.env.profiles }}</td>
<td style="word-break: break-all; ">{{ application.env.systemProp }}</td>
<td style="word-break: break-all; ">{{ application.env.systemEnv }}</td>
<!-- <td style="word-break: break-all; ">{{ application.env.config }}</td> -->
</tr>
</tbody>
</table>
<table class="table table-striped">
<thead>
<tr>
<th>Resource</th>
<th>Properties</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="prop in application.props">
<td>{{ prop.key }}</td>
<td style="word-break: normal; ">{{ prop.value }}</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