|
|
@ -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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (total === 0) {
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
passing: Math.round((params.ChecksPassing / total) * 100),
|
|
|
|
passing: Math.round((params.ChecksPassing / total) * 100),
|
|
|
|
warning: Math.round((params.ChecksWarning / total) * 100),
|
|
|
|
warning: Math.round((params.ChecksWarning / total) * 100),
|
|
|
|
critical: Math.round((params.ChecksCritical / total) * 100),
|
|
|
|
critical: Math.round((params.ChecksCritical / total) * 100),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|