[APM] Service Inventory Updated the EuiBadge
to use the behind_text
vars instead of the base colors for the health status badges (#77844)
* Use behind_text colors in health status * Separated badge color usage from getSeverityColor
This commit is contained in:
parent
6c015cfbef
commit
e92a4ab4bf
3 changed files with 19 additions and 3 deletions
|
@ -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:
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import React from 'react';
|
||||
import { EuiBadge } from '@elastic/eui';
|
||||
import {
|
||||
getServiceHealthStatusColor,
|
||||
getServiceHealthStatusBadgeColor,
|
||||
getServiceHealthStatusLabel,
|
||||
ServiceHealthStatus,
|
||||
} from '../../../../../common/service_health_status';
|
||||
|
@ -20,7 +20,7 @@ export function HealthBadge({
|
|||
const theme = useTheme();
|
||||
|
||||
return (
|
||||
<EuiBadge color={getServiceHealthStatusColor(theme, healthStatus)}>
|
||||
<EuiBadge color={getServiceHealthStatusBadgeColor(theme, healthStatus)}>
|
||||
{getServiceHealthStatusLabel(healthStatus)}
|
||||
</EuiBadge>
|
||||
);
|
||||
|
|
|
@ -153,7 +153,7 @@ NodeList [
|
|||
>
|
||||
<span
|
||||
class="euiBadge euiBadge--iconLeft"
|
||||
style="background-color: rgb(214, 191, 87); color: rgb(0, 0, 0);"
|
||||
style="background-color: rgb(241, 216, 111); color: rgb(0, 0, 0);"
|
||||
title="Warning"
|
||||
>
|
||||
<span
|
||||
|
|
Loading…
Reference in a new issue