-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1fa221
commit d129791
Showing
5 changed files
with
161 additions
and
55 deletions.
There are no files selected for viewing
105 changes: 105 additions & 0 deletions
105
...ervability_solution/observability_onboarding/public/application/header/header_section.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { | ||
EuiButtonEmpty, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiIcon, | ||
EuiPageTemplate, | ||
EuiSpacer, | ||
EuiTitle, | ||
useEuiShadow, | ||
useEuiTheme, | ||
} from '@elastic/eui'; | ||
import { css } from '@emotion/react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import React from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { Header } from './header'; | ||
import backgroundImageUrl from './background.svg'; | ||
import { useIconForLogo } from '../../hooks/use_icon_for_logo'; | ||
|
||
export function HeaderSection() { | ||
const path = useLocation().pathname; | ||
const kubernetesLogo = useIconForLogo('kubernetes'); | ||
const theme = useEuiTheme(); | ||
const shadow = useEuiShadow('s'); | ||
// theme.euiTheme.size. | ||
if (path === '/kubernetes') { | ||
return ( | ||
<EuiPageTemplate.Section paddingSize="xl"> | ||
<EuiButtonEmpty | ||
iconType="arrowLeft" | ||
flush="left" | ||
href="/observability" | ||
data-test-subj="observabilityOnboardingFlowBackToSelectionButton" | ||
> | ||
<FormattedMessage | ||
id="xpack.observability_onboarding.experimentalOnboardingFlow.button.returnButtonLabel" | ||
defaultMessage="Return" | ||
/> | ||
</EuiButtonEmpty> | ||
<EuiSpacer size="l" /> | ||
<EuiFlexGroup> | ||
<EuiFlexItem grow={false}> | ||
<div | ||
css={css` | ||
border-radius: ${theme.euiTheme.border.radius.medium}; | ||
${shadow} | ||
`} | ||
> | ||
<EuiIcon | ||
size="xxl" | ||
type={kubernetesLogo} | ||
css={css` | ||
margin: 12px; | ||
width: 56px; | ||
height: 56px; | ||
`} | ||
/> | ||
</div> | ||
</EuiFlexItem> | ||
<EuiFlexItem> | ||
<EuiTitle> | ||
<h1> | ||
<FormattedMessage | ||
id="xpack.observability_onboarding.experimentalOnboardingFlow.header.text" | ||
defaultMessage="Setting up Kubernetes with Elastic Agent" | ||
/> | ||
</h1> | ||
</EuiTitle> | ||
<EuiSpacer size="l" /> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.observability_onboarding.experimentalOnboardingFlow.kubernetesDescription" | ||
defaultMessage="This installation is tailored for configuring and collecting metrics and logs by deploying a new Elastic Agent within your host" | ||
/> | ||
</p> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiPageTemplate.Section> | ||
); | ||
} | ||
return ( | ||
<EuiPageTemplate.Section | ||
paddingSize="xl" | ||
css={css` | ||
& > div { | ||
background-image: url(${backgroundImageUrl}); | ||
background-position: right center; | ||
background-repeat: no-repeat; | ||
} | ||
`} | ||
grow={false} | ||
restrictWidth | ||
> | ||
<EuiSpacer size="xl" /> | ||
<Header /> | ||
</EuiPageTemplate.Section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
x-pack/plugins/observability_solution/observability_onboarding/public/hooks/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export type SupportedLogo = | ||
| 'aws' | ||
| 'azure' | ||
| 'docker' | ||
| 'dotnet' | ||
| 'prometheus' | ||
| 'gcp' | ||
| 'java' | ||
| 'javascript' | ||
| 'kubernetes' | ||
| 'nginx' | ||
| 'opentelemetry'; |
33 changes: 33 additions & 0 deletions
33
...plugins/observability_solution/observability_onboarding/public/hooks/use_icon_for_logo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { useKibana } from '@kbn/kibana-react-plugin/public'; | ||
import type { SupportedLogo } from './types'; | ||
|
||
export function useIconForLogo(logo?: SupportedLogo): string | undefined { | ||
const { | ||
services: { http }, | ||
} = useKibana(); | ||
switch (logo) { | ||
case 'aws': | ||
return 'logoAWS'; | ||
case 'azure': | ||
return 'logoAzure'; | ||
case 'gcp': | ||
return 'logoGCP'; | ||
case 'kubernetes': | ||
return 'logoKubernetes'; | ||
case 'nginx': | ||
return 'logoNginx'; | ||
case 'prometheus': | ||
return 'logoPrometheus'; | ||
case 'docker': | ||
return 'logoDocker'; | ||
default: | ||
return http?.staticAssets.getPluginAssetHref(`${logo}.svg`); | ||
} | ||
} |