Commit b9b97677 by Jochen Wierum Committed by Johannes Edmeier

Disable application tabs in the frontend if backing endpoint is not available

parent 6f129e74
......@@ -32,10 +32,17 @@ module.config(function ($stateProvider) {
});
});
module.run(function (ApplicationViews, $sce) {
module.run(function (ApplicationViews, $http, $sce) {
ApplicationViews.register({
order: 10,
title: $sce.trustAsHtml('<i class="fa fa-server fa-fw"></i>Environment'),
state: 'applications.environment'
state: 'applications.environment',
show: function (application) {
return $http.head('api/applications/' + application.id + '/env').then(function () {
return true;
}).catch(function () {
return false;
});
}
});
});
......@@ -40,14 +40,18 @@ module.config(function ($stateProvider) {
});
});
module.run(function (ApplicationViews, $sce, $http) {
module.run(function (ApplicationViews, $sce, $http, jolokia, ApplicationJmx) {
ApplicationViews.register({
order: 40,
title: $sce.trustAsHtml('<i class="fa fa-cogs fa-fw"></i>JMX'),
state: 'applications.jmx',
show: function (application) {
return $http.head('api/applications/' + application.id + '/jolokia').then(function () {
return true;
return ApplicationJmx.list(application).then(function () {
return true;
}).catch(function () {
return false;
});
}).catch(function () {
return false;
});
......
......@@ -33,10 +33,17 @@ module.config(function ($stateProvider) {
});
});
module.run(function (ApplicationViews, $sce) {
module.run(function (ApplicationViews, $http, $sce) {
ApplicationViews.register({
order: 5,
title: $sce.trustAsHtml('<i class="fa fa-bar-chart fa-fw"></i>Metrics'),
state: 'applications.metrics'
state: 'applications.metrics',
show: function (application) {
return $http.head('api/applications/' + application.id + '/metrics').then(function () {
return true;
}).catch(function () {
return false;
});
}
});
});
......@@ -33,10 +33,17 @@ module.config(function ($stateProvider) {
});
});
module.run(function (ApplicationViews, $sce) {
module.run(function (ApplicationViews, $http, $sce) {
ApplicationViews.register({
order: 50,
title: $sce.trustAsHtml('<i class="fa fa-list fa-fw"></i>Threads'),
state: 'applications.threads'
state: 'applications.threads',
show: function (application) {
return $http.head('api/applications/' + application.id + '/dump').then(function () {
return true;
}).catch(function () {
return 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