Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Better onboarding experience for Fleet Server on premise #103550

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ import { DefaultPageTitle } from './default_page_title';
interface Props {
section?: Section;
children?: React.ReactNode;
rightColumn?: JSX.Element;
}

export const DefaultLayout: React.FunctionComponent<Props> = ({ section, children }) => {
export const DefaultLayout: React.FunctionComponent<Props> = ({
section,
children,
rightColumn,
}) => {
const { getHref } = useLink();
const { agents } = useConfig();

return (
<WithHeaderLayout
leftColumn={<DefaultPageTitle />}
rightColumn={rightColumn}
tabs={[
{
name: (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* 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 React, { useEffect } from 'react';
import {
EuiButton,
EuiPanel,
EuiLink,
EuiEmptyPrompt,
EuiFlexItem,
EuiFlexGroup,
EuiText,
EuiLoadingSpinner,
EuiSpacer,
} from '@elastic/eui';

import { FormattedMessage } from '@kbn/i18n/react';

import { useFleetStatus, useStartServices } from '../../../../hooks';

const REFRESH_INTERVAL = 10000;

export const CloudInstructions: React.FC<{ deploymentUrl: string }> = ({ deploymentUrl }) => {
const { docLinks } = useStartServices();

const { refresh } = useFleetStatus();

useEffect(() => {
const interval = setInterval(() => {
refresh();
}, REFRESH_INTERVAL);

return () => clearInterval(interval);
}, [refresh]);

return (
<>
<EuiPanel
paddingSize="none"
grow={false}
hasShadow={false}
hasBorder={true}
className="eui-textCenter"
>
<EuiEmptyPrompt
title={
<h2>
<FormattedMessage
id="xpack.fleet.fleetServerSetup.cloudSetupTitle"
defaultMessage="Enable APM & Fleet"
/>
</h2>
}
body={
<FormattedMessage
id="xpack.fleet.fleetServerSetup.cloudSetupText"
defaultMessage="A Fleet Server is required before you can enroll agents with Fleet. You can add one to your deployment by enabling APM & Fleet. For more information see the {link}"
values={{
link: (
<EuiLink
href={docLinks.links.fleet.fleetServerAddFleetServer}
target="_blank"
external
>
<FormattedMessage
id="xpack.fleet.settings.userGuideLink"
defaultMessage="Fleet User Guide"
/>
</EuiLink>
),
}}
/>
}
actions={
<>
<EuiButton
iconSide="right"
iconType="popout"
fill
isLoading={false}
type="submit"
href={`${deploymentUrl}/edit`}
target="_blank"
>
<FormattedMessage
id="xpack.fleet.fleetServerSetup.cloudDeploymentLink"
defaultMessage="Edit deployment"
/>
</EuiButton>
</>
}
/>
</EuiPanel>
<EuiSpacer size="m" />
<EuiFlexItem>
<EuiFlexGroup justifyContent="center" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiLoadingSpinner size="m" />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText size="s" color="subdued">
<FormattedMessage
id="xpack.fleet.fleetServerSetup.waitingText"
defaultMessage="Waiting for a Fleet Server to connect..."
/>
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
</>
);
};
Loading