Commit 5bb5fd09 by joshiste Committed by Johannes Stelzer

Added classpath section to details-view

parent 7808d798
......@@ -67,6 +67,11 @@ angular.module('springBootAdmin', [
templateUrl: 'views/apps/details/props.html',
controller: 'detailsPropsCtrl'
})
.state('apps.details.classpath', {
url: '/classpath',
templateUrl: 'views/apps/details/classpath.html',
controller: 'detailsClasspathCtrl'
})
.state('apps.logging', {
url: '/logging/:id',
abstract: true,
......
......@@ -156,7 +156,7 @@ angular.module('springBootAdmin')
$scope.abbreviateFunction = function(targetLength, preserveLast, shortenThreshold){
return function(s) {
return Abbreviator.abbreviate(s, targetLength, preserveLast, shortenThreshold)
return Abbreviator.abbreviate(s, '.', targetLength, preserveLast, shortenThreshold)
};
}
......@@ -183,6 +183,11 @@ angular.module('springBootAdmin')
ApplicationDetails.getProps(application);
});
})
.controller('detailsClasspathCtrl', function ($scope, $stateParams, Application, ApplicationDetails, Abbreviator) {
$scope.application = Application.query({id: $stateParams.id}, function(application) {
ApplicationDetails.getClasspath(application);
});
})
.controller('loggingCtrl', function ($scope, $stateParams, Application) {
$scope.application = Application.query({id: $stateParams.id});
})
......
......@@ -98,6 +98,11 @@ angular.module('springBootAdmin.services', ['ngResource'])
}
});
}
this.getClasspath = function(app) {
return $http.get(app.url + '/env').success(function(response) {
app.classpath = response['systemProperties']['java.class.path'].split(":");
});
}
}])
.service('ApplicationLogging', ['$http', function($http) {
this.getLoglevel = function(app) {
......@@ -126,13 +131,13 @@ angular.module('springBootAdmin.services', ['ngResource'])
}
}])
.service('Abbreviator', [function() {
function _computeDotIndexes(fqName, preserveLast) {
function _computeDotIndexes(fqName, delimiter, preserveLast) {
var dotArray = [];
//iterate over String and find dots
var lastIndex = -1;
do {
lastIndex = fqName.indexOf('.', lastIndex + 1);
lastIndex = fqName.indexOf(delimiter, lastIndex + 1);
if (lastIndex !== -1) {
dotArray.push(lastIndex);
}
......@@ -169,12 +174,12 @@ angular.module('springBootAdmin.services', ['ngResource'])
return lengthArray;
}
this.abbreviate = function(fqName, targetLength, preserveLast, shortenThreshold) {
this.abbreviate = function(fqName, delimiter, targetLength, preserveLast, shortenThreshold) {
if (fqName.length < targetLength) {
return fqName;
}
var dotIndexesArray = _computeDotIndexes(fqName, preserveLast);
var dotIndexesArray = _computeDotIndexes(fqName, delimiter, preserveLast);
if (dotIndexesArray.length === 0) {
return fqName;
......
......@@ -12,6 +12,7 @@
<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>
<li ui-sref-active="active"><a ui-sref="apps.details.classpath({id: application.id})">Classpath</a></li>
</ul>
<div class="tab-content">
<div ui-view></div>
......
<table class="table table-striped">
<col style="width:30%">
<col style="width:auto">
<thead>
<tr>
<th>Classpath <small class="pull-right"><a href="{{ application.url }}/env">raw JSON</a></small></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="element in application.classpath">
<td style="text-wrap: none;">
{{ element }}
</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