Commit fb94c57e by Johannes Edmeier

Check logfile-availability via HEAD-request

If the management.port and server.port is not the same, the current logfile- endpoint detection fails. With this commit the presence of the endpoint is determined via a HEAD-request fixes #165
parent bf92987f
...@@ -54,13 +54,17 @@ module.exports = function ($resource, $http, $q, ApplicationLogging) { ...@@ -54,13 +54,17 @@ module.exports = function ($resource, $http, $q, ApplicationLogging) {
this.capabilities = {}; this.capabilities = {};
if (this.managementUrl) { if (this.managementUrl) {
$http.get('api/applications/' + application.id + '/configprops').success(function(configprops) { $http.get('api/applications/' + application.id + '/configprops').success(function(configprops) {
application.capabilities.logfile = isEndpointPresent('logfileMvcEndpoint', configprops);
application.capabilities.activiti = isEndpointPresent('processEngineEndpoint', configprops); application.capabilities.activiti = isEndpointPresent('processEngineEndpoint', configprops);
application.capabilities.restart = isEndpointPresent('restartEndpoint', configprops); application.capabilities.restart = isEndpointPresent('restartEndpoint', configprops);
application.capabilities.refresh = isEndpointPresent('refreshEndpoint', configprops); application.capabilities.refresh = isEndpointPresent('refreshEndpoint', configprops);
application.capabilities.pause = isEndpointPresent('pauseEndpoint', configprops); application.capabilities.pause = isEndpointPresent('pauseEndpoint', configprops);
application.capabilities.resume = isEndpointPresent('resumeEndpoint', configprops); application.capabilities.resume = isEndpointPresent('resumeEndpoint', configprops);
}); });
$http.head('api/applications/' + application.id + '/logfile').success(function() {
application.capabilities.logfile = true;
}).error(function() {
application.capabilities.logfile = false;
});
} }
}; };
......
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