Commit 94aec760 by Johannes Edmeier

Hide logging / jmx section when endpoints are inactive.

When the jolokia endpoint is missing the jmx section is hidden additionally when the logging endpoint is also missing the logging section is hidden too. closes #398
parent 163c9f13
......@@ -25,6 +25,5 @@ module.exports = function ($scope, application, ApplicationJmx) {
$scope.domains = domains;
}).catch(function (response) {
$scope.error = response;
$scope.errorWhileListing = true;
});
};
......@@ -40,10 +40,17 @@ module.config(function ($stateProvider) {
});
});
module.run(function (ApplicationViews, $sce) {
module.run(function (ApplicationViews, $sce, $http) {
ApplicationViews.register({
order: 40,
title: $sce.trustAsHtml('<i class="fa fa-cogs fa-fw"></i>JMX'),
state: 'applications.jmx'
state: 'applications.jmx',
show: function (application) {
return $http.head('api/applications/' + application.id + '/jolokia').then(function () {
return true;
}).catch(function () {
return false;
});
}
});
});
<div class="container">
<div ng-if="errorWhileListing">
<p>To make the JMX section work you need to make the /jolokia-endpoint accessible.
<br/> Include the jolokia-core.jar in your spring-boot-application:
<pre>&lt;dependency&gt; &lt;groupId>org.jolokia&lt;/groupId&gt; &lt;artifactId>jolokia-core&lt;/artifactId&gt; &lt;/dependency&gt;
</pre>
</p>
</div>
<pre class="alert alert-error" ng-if="error"><b>Error:</b><br/>{{ error | json }}</pre>
<sba-accordion>
<sba-accordion-group ng-repeat="domain in domains | orderBy:'name' track by domain.name">
......
......@@ -90,12 +90,10 @@ module.exports = function ($scope, application, ApplicationLogging) {
$scope.loggers = loggers;
}).catch(function (response) {
$scope.error = response;
$scope.errorWhileListing = true;
});
}
).catch(function (response) {
$scope.error = response;
$scope.errorWhileListing = true;
});
};
......
......@@ -33,10 +33,21 @@ module.config(function ($stateProvider) {
});
});
module.run(function (ApplicationViews, $sce) {
module.run(function (ApplicationViews, $sce, $http) {
ApplicationViews.register({
order: 30,
title: $sce.trustAsHtml('<i class="fa fa-sliders fa-fw"></i>Logging'),
state: 'applications.logging'
state: 'applications.logging',
show: function (application) {
return $http.head('api/applications/' + application.id + '/logging').then(function () {
return true;
}).catch(function () {
return $http.head('api/applications/' + application.id + '/jolokia').then(function () {
return true;
}).catch(function () {
return false;
});
});
}
});
});
<div class="container">
<div ng-if="errorWhileListing">
<p><b>This only applies to Spring Boot 1.4.x and older applications:</b>
<br/> To make the logging section work you need to make the /jolokia-endpoint accessible.
<br/>Include the jolokia-core.jar in your spring-boot-application:
<pre>&lt;dependency&gt; &lt;groupId>org.jolokia&lt;/groupId&gt; &lt;artifactId>jolokia-core&lt;/artifactId&gt; &lt;/dependency&gt;</pre>
</p>
<p>Please note that the logging section currently only works with Logback.
<br/> To make the section work with Logback please activate the JMXConfigurator in your <b>logback.xml</b>:
<pre>&lt;configuration&gt; &lt;include resource="org/springframework/boot/logging/logback/base.xml"/&gt; &lt;jmxConfigurator/&gt;&lt;/configuration&gt;</pre>
</p>
</div>
<pre class="alert alert-error" ng-if="error"><b>Error:</b><br/>{{ error | json }}</pre>
<div ng-show="loggers">
<form>
......
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