[Uptime] Add link for logs host integration (#38010) (#40152)

* Add link for logs host link.

* Update test snapshot.

* Update IntegrationGroup component to handle updated data shape.
This commit is contained in:
Justin Kambic 2019-07-02 11:43:34 -04:00 committed by GitHub
parent 21d857d64e
commit 74783c7a20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 1 deletions

View file

@ -28,6 +28,14 @@ exports[`IntegrationGroup will not display APM links when APM is unavailable 1`]
tooltipContent="Check Infrastructure UI for container ID \\"\\""
/>
</EuiFlexItem>
<EuiFlexItem>
<IntegrationLink
ariaLabel="Check Logging UI for this monitor's ip address"
iconType="loggingApp"
message="Show host logs"
tooltipContent="Check Logging UI for the IP \\"\\""
/>
</EuiFlexItem>
<EuiFlexItem>
<IntegrationLink
ariaLabel="Show pod logs"
@ -60,6 +68,14 @@ exports[`IntegrationGroup will not display infra links when infra is unavailable
tooltipContent="Click here to check APM for the domain \\"\\"."
/>
</EuiFlexItem>
<EuiFlexItem>
<IntegrationLink
ariaLabel="Check Logging UI for this monitor's ip address"
iconType="loggingApp"
message="Show host logs"
tooltipContent="Check Logging UI for the IP \\"\\""
/>
</EuiFlexItem>
<EuiFlexItem>
<IntegrationLink
ariaLabel="Show pod logs"

View file

@ -16,6 +16,7 @@ import {
getInfraIpHref,
getInfraKubernetesHref,
getLoggingContainerHref,
getLoggingIpHref,
getLoggingKubernetesHref,
} from '../../lib/helper';
import { MonitorSummary } from '../../../common/graphql/types';
@ -166,6 +167,30 @@ export const IntegrationGroup = ({
) : null}
{isLogsAvailable ? (
<React.Fragment>
<EuiFlexItem>
<IntegrationLink
ariaLabel={i18n.translate(
'xpack.uptime.monitorList.loggingIntegrationAction.ip.description',
{
defaultMessage: `Check Logging UI for this monitor's ip address`,
description: 'This value is shown as the aria label for screen readers.',
}
)}
href={getLoggingIpHref(summary, basePath)}
iconType="loggingApp"
message={i18n.translate(
'xpack.uptime.monitorList.loggingIntegrationAction.ip.message',
{
defaultMessage: 'Show host logs',
description: `A message explaining that this link will take the user to the Infrastructure UI filtered for the monitor's IP Address`,
}
)}
tooltipContent={i18n.translate(
'xpack.uptime.monitorList.loggingIntegrationAction.ip.tooltip',
{ defaultMessage: 'Check Logging UI for the IP "{ip}"', values: { ip } }
)}
/>
</EuiFlexItem>
<EuiFlexItem>
<IntegrationLink
ariaLabel={i18n.translate(

View file

@ -6,4 +6,8 @@
export { getApmHref } from './get_apm_href';
export { getInfraContainerHref, getInfraIpHref, getInfraKubernetesHref } from './get_infra_href';
export { getLoggingKubernetesHref, getLoggingContainerHref } from './get_logging_href';
export {
getLoggingContainerHref,
getLoggingIpHref,
getLoggingKubernetesHref,
} from './get_logging_href';