Skip to content

Commit

Permalink
Fix #684
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Oct 29, 2013
1 parent 064dc94 commit 82a0027
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions hawtio-web/src/main/webapp/app/health/js/health.ts
Expand Up @@ -58,14 +58,25 @@ module Health {
});

values.forEach((value) => {
value.data = {

var healthPercentCurrent = 0;
var healthPercentRemaining = 1;

if ('healthPercent' in value) {
var healthPercent = <number>value['healthPercent'];
healthPercentCurrent = healthPercent.round(3);
healthPercentRemaining = 1 - healthPercentCurrent;
healthPercentRemaining = healthPercentRemaining.round(3);
}

value.data = {
total: 1,
terms: [{
term: 'Health',
count: (<number>(value.healthPercent)).round(3)
count: healthPercentCurrent
}, {
term: 'Remaining',
count: (<number>(1 - value.healthPercent)).round(3)
count: healthPercentRemaining
}]
};
value.colorMap = $scope.colorMaps[value.level];
Expand Down

0 comments on commit 82a0027

Please sign in to comment.