|
|
@ -2,9 +2,14 @@ import { helper } from '@ember/component/helper';
|
|
|
|
|
|
|
|
|
|
|
|
export default helper(function serviceHealthPercentage([params] /*, hash*/) {
|
|
|
|
export default helper(function serviceHealthPercentage([params] /*, hash*/) {
|
|
|
|
const total = params.ChecksCritical + params.ChecksPassing + params.ChecksWarning;
|
|
|
|
const total = params.ChecksCritical + params.ChecksPassing + params.ChecksWarning;
|
|
|
|
return {
|
|
|
|
|
|
|
|
passing: Math.round((params.ChecksPassing / total) * 100),
|
|
|
|
if (total === 0) {
|
|
|
|
warning: Math.round((params.ChecksWarning / total) * 100),
|
|
|
|
return '';
|
|
|
|
critical: Math.round((params.ChecksCritical / total) * 100),
|
|
|
|
} else {
|
|
|
|
};
|
|
|
|
return {
|
|
|
|
|
|
|
|
passing: Math.round((params.ChecksPassing / total) * 100),
|
|
|
|
|
|
|
|
warning: Math.round((params.ChecksWarning / total) * 100),
|
|
|
|
|
|
|
|
critical: Math.round((params.ChecksCritical / total) * 100),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|