Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/elastic/kibana into jvm-m…
Browse files Browse the repository at this point in the history
…emory-usage
  • Loading branch information
igoristic committed Oct 2, 2020
2 parents 509be7e + e92a4ab commit 14c456e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions x-pack/plugins/apm/common/service_health_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ export function getServiceHealthStatusColor(
}
}

export function getServiceHealthStatusBadgeColor(
theme: EuiTheme,
status: ServiceHealthStatus
) {
switch (status) {
case ServiceHealthStatus.healthy:
return theme.eui.euiColorVis0_behindText;
case ServiceHealthStatus.warning:
return theme.eui.euiColorVis5_behindText;
case ServiceHealthStatus.critical:
return theme.eui.euiColorVis9_behindText;
case ServiceHealthStatus.unknown:
return theme.eui.euiColorMediumShade;
}
}

export function getServiceHealthStatusLabel(status: ServiceHealthStatus) {
switch (status) {
case ServiceHealthStatus.critical:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React from 'react';
import { EuiBadge } from '@elastic/eui';
import {
getServiceHealthStatusColor,
getServiceHealthStatusBadgeColor,
getServiceHealthStatusLabel,
ServiceHealthStatus,
} from '../../../../../common/service_health_status';
Expand All @@ -20,7 +20,7 @@ export function HealthBadge({
const theme = useTheme();

return (
<EuiBadge color={getServiceHealthStatusColor(theme, healthStatus)}>
<EuiBadge color={getServiceHealthStatusBadgeColor(theme, healthStatus)}>
{getServiceHealthStatusLabel(healthStatus)}
</EuiBadge>
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 14c456e

Please sign in to comment.