Commit 09b8a956 by Dmitry Shmatko Committed by Johannes Edmeier

Add a referesh button to details

Instead of alway hitting F5 and do a full page reload, this adds a small button to refresh the details view.
parent 880f10f0
......@@ -23,33 +23,37 @@ module.exports = function ($scope, application) {
$scope.application = application;
$scope.metrics = {};
application.getInfo().then(function (response) {
$scope.info = response.data;
}).catch(function (response) {
$scope.error = response.data;
});
$scope.getDetails = function () {
application.getInfo().then(function (response) {
$scope.info = response.data;
}).catch(function (response) {
$scope.error = response.data;
});
application.getHealth().then(function (response) {
$scope.health = response.data;
}).catch(function (response) {
$scope.health = response.data;
});
application.getHealth().then(function (response) {
$scope.health = response.data;
}).catch(function (response) {
$scope.health = response.data;
});
application.getMetrics().then(
function (response) {
$scope.metrics = response.data;
$scope.hasDatasources = false;
$scope.hasCaches = false;
angular.forEach($scope.metrics, function (value, key) {
if (!$scope.hasDatasources && key.startsWith('datasource.')) {
$scope.hasDatasources = true;
}
if (!$scope.hasCaches && key.startsWith('cache.')) {
$scope.hasCaches = true;
}
});
}
).catch(function (response) {
$scope.error = response.data;
});
application.getMetrics().then(
function (response) {
$scope.metrics = response.data;
$scope.hasDatasources = false;
$scope.hasCaches = false;
angular.forEach($scope.metrics, function (value, key) {
if (!$scope.hasDatasources && key.startsWith('datasource.')) {
$scope.hasDatasources = true;
}
if (!$scope.hasCaches && key.startsWith('cache.')) {
$scope.hasCaches = true;
}
});
}
).catch(function (response) {
$scope.error = response.data;
});
};
$scope.getDetails();
};
......@@ -2,6 +2,13 @@
<div class="alert alert-error" ng-if="error">
<b>Error:</b> {{ error }}
</div>
<div class="row">
<div class="text-center">
<form>
<button class="btn" ng-click="getDetails()"><i class="fa fa-repeat"></i> refresh</button>
</form>
</div>
</div>
<div style="display: flex; flex-wrap: wrap; justify-content: space-around;">
<sba-info-panel class="span6" style="margin-left:0px" panel-title="Application" raw="api/applications/{{ application.id }}/info">
<table class="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