mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ILM] Migrate to new page layout (#101927)
This commit is contained in:
parent
b430a985c2
commit
8424a92533
5 changed files with 337 additions and 349 deletions
|
@ -46,71 +46,67 @@ Array [
|
|||
`;
|
||||
|
||||
exports[`policy table should show empty state when there are not any policies 1`] = `
|
||||
<main
|
||||
class="euiPageBody euiPageBody--borderRadiusNone"
|
||||
<div
|
||||
class="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--subdued euiPanel--noShadow euiPanel--noBorder euiPageContent euiPageContent--verticalCenter euiPageContent--horizontalCenter"
|
||||
role="main"
|
||||
>
|
||||
<div
|
||||
class="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent euiPageContent--verticalCenter euiPageContent--horizontalCenter"
|
||||
role="main"
|
||||
class="euiEmptyPrompt"
|
||||
>
|
||||
<span
|
||||
color="subdued"
|
||||
data-euiicon-type="managementApp"
|
||||
/>
|
||||
<div
|
||||
class="euiEmptyPrompt"
|
||||
class="euiSpacer euiSpacer--s"
|
||||
/>
|
||||
<span
|
||||
class="euiTextColor euiTextColor--subdued"
|
||||
>
|
||||
<h1
|
||||
class="euiTitle euiTitle--medium"
|
||||
>
|
||||
Create your first index lifecycle policy
|
||||
</h1>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--m"
|
||||
/>
|
||||
<div
|
||||
class="euiText euiText--medium"
|
||||
>
|
||||
<p>
|
||||
An index lifecycle policy helps you manage your indices as they age.
|
||||
</p>
|
||||
</div>
|
||||
</span>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--l"
|
||||
/>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--s"
|
||||
/>
|
||||
<button
|
||||
class="euiButton euiButton--primary euiButton--fill"
|
||||
data-test-subj="createPolicyButton"
|
||||
type="button"
|
||||
>
|
||||
<span
|
||||
color="subdued"
|
||||
data-euiicon-type="managementApp"
|
||||
/>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--s"
|
||||
/>
|
||||
<span
|
||||
class="euiTextColor euiTextColor--subdued"
|
||||
>
|
||||
<h1
|
||||
class="euiTitle euiTitle--medium"
|
||||
>
|
||||
Create your first index lifecycle policy
|
||||
</h1>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--m"
|
||||
/>
|
||||
<div
|
||||
class="euiText euiText--medium"
|
||||
>
|
||||
<p>
|
||||
An index lifecycle policy helps you manage your indices as they age.
|
||||
</p>
|
||||
</div>
|
||||
</span>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--l"
|
||||
/>
|
||||
<div
|
||||
class="euiSpacer euiSpacer--s"
|
||||
/>
|
||||
<button
|
||||
class="euiButton euiButton--primary euiButton--fill"
|
||||
data-test-subj="createPolicyButton"
|
||||
type="button"
|
||||
class="euiButtonContent euiButton__content"
|
||||
>
|
||||
<span
|
||||
class="euiButtonContent euiButton__content"
|
||||
class="euiButtonContent__icon"
|
||||
color="inherit"
|
||||
data-euiicon-type="plusInCircle"
|
||||
/>
|
||||
<span
|
||||
class="euiButton__text"
|
||||
>
|
||||
<span
|
||||
class="euiButtonContent__icon"
|
||||
color="inherit"
|
||||
data-euiicon-type="plusInCircle"
|
||||
/>
|
||||
<span
|
||||
class="euiButton__text"
|
||||
>
|
||||
Create policy
|
||||
</span>
|
||||
Create policy
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`policy table should sort when linked indices header is clicked 1`] = `
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { useEffect } from 'react';
|
||||
import { RouteComponentProps } from 'react-router-dom';
|
||||
import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner, EuiPageContent } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { MIN_SEARCHABLE_SNAPSHOT_LICENSE } from '../../../../common/constants';
|
||||
|
@ -52,43 +52,47 @@ export const EditPolicy: React.FunctionComponent<Props & RouteComponentProps<Rou
|
|||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<EuiEmptyPrompt
|
||||
title={<EuiLoadingSpinner size="xl" />}
|
||||
body={
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.policiesLoading"
|
||||
defaultMessage="Loading policies..."
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
||||
<EuiEmptyPrompt
|
||||
title={<EuiLoadingSpinner size="xl" />}
|
||||
body={
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.policiesLoading"
|
||||
defaultMessage="Loading policies..."
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</EuiPageContent>
|
||||
);
|
||||
}
|
||||
if (error || !policies) {
|
||||
const { statusCode, message } = error ? error : { statusCode: '', message: '' };
|
||||
return (
|
||||
<EuiEmptyPrompt
|
||||
title={
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.lifecyclePoliciesLoadingFailedTitle"
|
||||
defaultMessage="Unable to load existing lifecycle policies"
|
||||
/>
|
||||
</h2>
|
||||
}
|
||||
body={
|
||||
<p>
|
||||
{message} ({statusCode})
|
||||
</p>
|
||||
}
|
||||
actions={
|
||||
<EuiButton onClick={resendRequest} iconType="refresh" color="danger">
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.lifecyclePoliciesReloadButton"
|
||||
defaultMessage="Try again"
|
||||
/>
|
||||
</EuiButton>
|
||||
}
|
||||
/>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
|
||||
<EuiEmptyPrompt
|
||||
title={
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.lifecyclePoliciesLoadingFailedTitle"
|
||||
defaultMessage="Unable to load existing lifecycle policies"
|
||||
/>
|
||||
</h2>
|
||||
}
|
||||
body={
|
||||
<p>
|
||||
{message} ({statusCode})
|
||||
</p>
|
||||
}
|
||||
actions={
|
||||
<EuiButton onClick={resendRequest} iconType="refresh" color="danger">
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.lifecyclePoliciesReloadButton"
|
||||
defaultMessage="Try again"
|
||||
/>
|
||||
</EuiButton>
|
||||
}
|
||||
/>
|
||||
</EuiPageContent>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,15 +19,10 @@ import {
|
|||
EuiFlexItem,
|
||||
EuiFormRow,
|
||||
EuiHorizontalRule,
|
||||
EuiPage,
|
||||
EuiPageBody,
|
||||
EuiPageContent,
|
||||
EuiPageContentHeader,
|
||||
EuiPageContentHeaderSection,
|
||||
EuiSpacer,
|
||||
EuiSwitch,
|
||||
EuiText,
|
||||
EuiTitle,
|
||||
EuiPageHeader,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { TextField, useForm, useFormData, useKibana } from '../../../shared_imports';
|
||||
|
@ -153,201 +148,199 @@ export const EditPolicy: React.FunctionComponent<Props> = ({ history }) => {
|
|||
};
|
||||
|
||||
return (
|
||||
<EuiPage>
|
||||
<EuiPageBody>
|
||||
<EuiPageContent>
|
||||
<EuiPageContentHeader>
|
||||
<EuiPageContentHeaderSection>
|
||||
<EuiTitle size="l" data-test-subj="policyTitle">
|
||||
<h1>
|
||||
{isNewPolicy
|
||||
? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.createPolicyMessage', {
|
||||
defaultMessage: 'Create policy',
|
||||
})
|
||||
: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.editPolicyMessage', {
|
||||
defaultMessage: 'Edit policy {originalPolicyName}',
|
||||
values: { originalPolicyName },
|
||||
})}
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
</EuiPageContentHeaderSection>
|
||||
<EuiPageContentHeaderSection>
|
||||
<EuiButtonEmpty
|
||||
href={createDocLink('index-lifecycle-management.html')}
|
||||
target="_blank"
|
||||
iconType="help"
|
||||
>
|
||||
<>
|
||||
<EuiPageHeader
|
||||
pageTitle={
|
||||
<span data-test-subj="policyTitle">
|
||||
{isNewPolicy
|
||||
? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.createPolicyMessage', {
|
||||
defaultMessage: 'Create policy',
|
||||
})
|
||||
: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.editPolicyMessage', {
|
||||
defaultMessage: 'Edit policy {originalPolicyName}',
|
||||
values: { originalPolicyName },
|
||||
})}
|
||||
</span>
|
||||
}
|
||||
bottomBorder
|
||||
rightSideItems={[
|
||||
<EuiButtonEmpty
|
||||
href={createDocLink('index-lifecycle-management.html')}
|
||||
target="_blank"
|
||||
iconType="help"
|
||||
>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.documentationLinkText"
|
||||
defaultMessage="Documentation"
|
||||
/>
|
||||
</EuiButtonEmpty>,
|
||||
]}
|
||||
/>
|
||||
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<Form form={form}>
|
||||
{isNewPolicy ? null : (
|
||||
<Fragment>
|
||||
<EuiText>
|
||||
<p>
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.editingExistingPolicyMessage"
|
||||
defaultMessage="You are editing an existing policy"
|
||||
/>
|
||||
</strong>
|
||||
.{' '}
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.documentationLinkText"
|
||||
defaultMessage="Documentation"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
</EuiPageContentHeaderSection>
|
||||
</EuiPageContentHeader>
|
||||
<Form form={form}>
|
||||
{isNewPolicy ? null : (
|
||||
<Fragment>
|
||||
<EuiText>
|
||||
<p>
|
||||
<strong>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.editingExistingPolicyMessage"
|
||||
defaultMessage="You are editing an existing policy"
|
||||
/>
|
||||
</strong>
|
||||
.{' '}
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.editingExistingPolicyExplanationMessage"
|
||||
defaultMessage="Any changes you make will affect the indices that are
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.editingExistingPolicyExplanationMessage"
|
||||
defaultMessage="Any changes you make will affect the indices that are
|
||||
attached to this policy. Alternatively, you can save these changes in
|
||||
a new policy."
|
||||
/>
|
||||
</p>
|
||||
</EuiText>
|
||||
<EuiSpacer />
|
||||
|
||||
<EuiFormRow>
|
||||
<EuiSwitch
|
||||
data-test-subj="saveAsNewSwitch"
|
||||
style={{ maxWidth: '100%' }}
|
||||
checked={saveAsNew}
|
||||
onChange={(e) => {
|
||||
setSaveAsNew(e.target.checked);
|
||||
}}
|
||||
label={
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.saveAsNewPolicyMessage"
|
||||
defaultMessage="Save as new policy"
|
||||
/>
|
||||
</p>
|
||||
</EuiText>
|
||||
<EuiSpacer />
|
||||
|
||||
<EuiFormRow>
|
||||
<EuiSwitch
|
||||
data-test-subj="saveAsNewSwitch"
|
||||
style={{ maxWidth: '100%' }}
|
||||
checked={saveAsNew}
|
||||
onChange={(e) => {
|
||||
setSaveAsNew(e.target.checked);
|
||||
}}
|
||||
label={
|
||||
<span>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.saveAsNewPolicyMessage"
|
||||
defaultMessage="Save as new policy"
|
||||
/>
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</Fragment>
|
||||
)}
|
||||
|
||||
{saveAsNew || isNewPolicy ? (
|
||||
<UseField<string, FormInternal>
|
||||
path={policyNamePath}
|
||||
config={{
|
||||
label: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.policyNameLabel', {
|
||||
defaultMessage: 'Policy name',
|
||||
}),
|
||||
helpText: i18n.translate(
|
||||
'xpack.indexLifecycleMgmt.editPolicy.validPolicyNameMessage',
|
||||
{
|
||||
defaultMessage:
|
||||
'A policy name cannot start with an underscore and cannot contain a comma or a space.',
|
||||
}
|
||||
),
|
||||
validations: policyNameValidations,
|
||||
}}
|
||||
component={TextField}
|
||||
componentProps={{
|
||||
fullWidth: false,
|
||||
euiFieldProps: {
|
||||
'data-test-subj': 'policyNameField',
|
||||
},
|
||||
}}
|
||||
</span>
|
||||
}
|
||||
/>
|
||||
) : null}
|
||||
</EuiFormRow>
|
||||
</Fragment>
|
||||
)}
|
||||
|
||||
<EuiHorizontalRule />
|
||||
{saveAsNew || isNewPolicy ? (
|
||||
<UseField<string, FormInternal>
|
||||
path={policyNamePath}
|
||||
config={{
|
||||
label: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.policyNameLabel', {
|
||||
defaultMessage: 'Policy name',
|
||||
}),
|
||||
helpText: i18n.translate(
|
||||
'xpack.indexLifecycleMgmt.editPolicy.validPolicyNameMessage',
|
||||
{
|
||||
defaultMessage:
|
||||
'A policy name cannot start with an underscore and cannot contain a comma or a space.',
|
||||
}
|
||||
),
|
||||
validations: policyNameValidations,
|
||||
}}
|
||||
component={TextField}
|
||||
componentProps={{
|
||||
fullWidth: false,
|
||||
euiFieldProps: {
|
||||
'data-test-subj': 'policyNameField',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
<Timeline />
|
||||
<EuiHorizontalRule />
|
||||
|
||||
<EuiSpacer size="l" />
|
||||
<Timeline />
|
||||
|
||||
<div>
|
||||
<HotPhase />
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
<div>
|
||||
<HotPhase />
|
||||
|
||||
<EuiSpacer />
|
||||
<WarmPhase />
|
||||
|
||||
<EuiSpacer />
|
||||
<ColdPhase />
|
||||
|
||||
{isAllowedByLicense && (
|
||||
<>
|
||||
<EuiSpacer />
|
||||
<WarmPhase />
|
||||
<FrozenPhase />
|
||||
</>
|
||||
)}
|
||||
|
||||
<EuiSpacer />
|
||||
<ColdPhase />
|
||||
|
||||
{isAllowedByLicense && (
|
||||
<>
|
||||
<EuiSpacer />
|
||||
<FrozenPhase />
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* We can't add the <EuiSpacer /> here as it breaks the layout
|
||||
{/* We can't add the <EuiSpacer /> here as it breaks the layout
|
||||
and makes the connecting line go further that it needs to.
|
||||
There is an issue in EUI to fix this (https://github.com/elastic/eui/issues/4492) */}
|
||||
<DeletePhase />
|
||||
</div>
|
||||
<DeletePhase />
|
||||
</div>
|
||||
|
||||
<EuiHorizontalRule />
|
||||
<EuiHorizontalRule />
|
||||
|
||||
<FormErrorsCallout />
|
||||
<FormErrorsCallout />
|
||||
|
||||
<EuiFlexGroup justifyContent="spaceBetween">
|
||||
<EuiFlexGroup justifyContent="spaceBetween">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiFlexGroup>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButton
|
||||
data-test-subj="savePolicyButton"
|
||||
fill
|
||||
iconType="check"
|
||||
iconSide="left"
|
||||
disabled={form.isValid === false || form.isSubmitting}
|
||||
onClick={submit}
|
||||
>
|
||||
{saveAsNew ? (
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.saveAsNewButton"
|
||||
defaultMessage="Save as new policy"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.saveButton"
|
||||
defaultMessage="Save policy"
|
||||
/>
|
||||
)}
|
||||
</EuiButton>
|
||||
</EuiFlexItem>
|
||||
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty data-test-subj="cancelTestPolicy" onClick={backToPolicyList}>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.cancelButton"
|
||||
defaultMessage="Cancel"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty onClick={togglePolicyJsonFlyout} data-test-subj="requestButton">
|
||||
{isShowingPolicyJsonFlyout ? (
|
||||
<EuiButton
|
||||
data-test-subj="savePolicyButton"
|
||||
fill
|
||||
iconType="check"
|
||||
iconSide="left"
|
||||
disabled={form.isValid === false || form.isSubmitting}
|
||||
onClick={submit}
|
||||
>
|
||||
{saveAsNew ? (
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.hidePolicyJsonButto"
|
||||
defaultMessage="Hide request"
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.saveAsNewButton"
|
||||
defaultMessage="Save as new policy"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.showPolicyJsonButto"
|
||||
defaultMessage="Show request"
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.saveButton"
|
||||
defaultMessage="Save policy"
|
||||
/>
|
||||
)}
|
||||
</EuiButton>
|
||||
</EuiFlexItem>
|
||||
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty data-test-subj="cancelTestPolicy" onClick={backToPolicyList}>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.cancelButton"
|
||||
defaultMessage="Cancel"
|
||||
/>
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</EuiFlexItem>
|
||||
|
||||
{isShowingPolicyJsonFlyout ? (
|
||||
<PolicyJsonFlyout
|
||||
policyName={saveAsNew ? currentPolicyName : policyName}
|
||||
close={() => setIsShowingPolicyJsonFlyout(false)}
|
||||
/>
|
||||
) : null}
|
||||
</Form>
|
||||
</EuiPageContent>
|
||||
</EuiPageBody>
|
||||
</EuiPage>
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiButtonEmpty onClick={togglePolicyJsonFlyout} data-test-subj="requestButton">
|
||||
{isShowingPolicyJsonFlyout ? (
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.hidePolicyJsonButto"
|
||||
defaultMessage="Hide request"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.editPolicy.showPolicyJsonButto"
|
||||
defaultMessage="Show request"
|
||||
/>
|
||||
)}
|
||||
</EuiButtonEmpty>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
|
||||
{isShowingPolicyJsonFlyout ? (
|
||||
<PolicyJsonFlyout
|
||||
policyName={saveAsNew ? currentPolicyName : policyName}
|
||||
close={() => setIsShowingPolicyJsonFlyout(false)}
|
||||
/>
|
||||
) : null}
|
||||
</Form>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { useEffect } from 'react';
|
||||
import { ApplicationStart } from 'kibana/public';
|
||||
import { RouteComponentProps } from 'react-router-dom';
|
||||
import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { EuiButton, EuiEmptyPrompt, EuiLoadingSpinner, EuiPageContent } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { PolicyTable as PresentationComponent } from './policy_table';
|
||||
import { useKibana } from '../../../shared_imports';
|
||||
|
@ -33,43 +33,47 @@ export const PolicyTable: React.FunctionComponent<Props & RouteComponentProps> =
|
|||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<EuiEmptyPrompt
|
||||
title={<EuiLoadingSpinner size="xl" />}
|
||||
body={
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.policiesLoading"
|
||||
defaultMessage="Loading policies..."
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
||||
<EuiEmptyPrompt
|
||||
title={<EuiLoadingSpinner size="xl" />}
|
||||
body={
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.policiesLoading"
|
||||
defaultMessage="Loading policies..."
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</EuiPageContent>
|
||||
);
|
||||
}
|
||||
if (error) {
|
||||
const { statusCode, message } = error ? error : { statusCode: '', message: '' };
|
||||
return (
|
||||
<EuiEmptyPrompt
|
||||
title={
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.policiesLoadingFailedTitle"
|
||||
defaultMessage="Unable to load existing lifecycle policies"
|
||||
/>
|
||||
</h2>
|
||||
}
|
||||
body={
|
||||
<p>
|
||||
{message} ({statusCode})
|
||||
</p>
|
||||
}
|
||||
actions={
|
||||
<EuiButton onClick={resendRequest} iconType="refresh" color="danger">
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.policiesReloadButton"
|
||||
defaultMessage="Try again"
|
||||
/>
|
||||
</EuiButton>
|
||||
}
|
||||
/>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="danger">
|
||||
<EuiEmptyPrompt
|
||||
title={
|
||||
<h2>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.policiesLoadingFailedTitle"
|
||||
defaultMessage="Unable to load existing lifecycle policies"
|
||||
/>
|
||||
</h2>
|
||||
}
|
||||
body={
|
||||
<p>
|
||||
{message} ({statusCode})
|
||||
</p>
|
||||
}
|
||||
actions={
|
||||
<EuiButton onClick={resendRequest} iconType="refresh" color="danger">
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.policiesReloadButton"
|
||||
defaultMessage="Try again"
|
||||
/>
|
||||
</EuiButton>
|
||||
}
|
||||
/>
|
||||
</EuiPageContent>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,9 +16,7 @@ import {
|
|||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiSpacer,
|
||||
EuiTitle,
|
||||
EuiText,
|
||||
EuiPageBody,
|
||||
EuiPageHeader,
|
||||
EuiPageContent,
|
||||
} from '@elastic/eui';
|
||||
import { ApplicationStart } from 'kibana/public';
|
||||
|
@ -119,67 +117,60 @@ export const PolicyTable: React.FunctionComponent<Props> = ({
|
|||
);
|
||||
} else {
|
||||
return (
|
||||
<EuiPageBody>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center">
|
||||
<EuiEmptyPrompt
|
||||
iconType="managementApp"
|
||||
title={
|
||||
<h1>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center" color="subdued">
|
||||
<EuiEmptyPrompt
|
||||
iconType="managementApp"
|
||||
title={
|
||||
<h1>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.emptyPromptTitle"
|
||||
defaultMessage="Create your first index lifecycle policy"
|
||||
/>
|
||||
</h1>
|
||||
}
|
||||
body={
|
||||
<Fragment>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.emptyPromptTitle"
|
||||
defaultMessage="Create your first index lifecycle policy"
|
||||
id="xpack.indexLifecycleMgmt.policyTable.emptyPromptDescription"
|
||||
defaultMessage=" An index lifecycle policy helps you manage your indices as they age."
|
||||
/>
|
||||
</h1>
|
||||
}
|
||||
body={
|
||||
<Fragment>
|
||||
<p>
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.emptyPromptDescription"
|
||||
defaultMessage=" An index lifecycle policy helps you manage your indices as they age."
|
||||
/>
|
||||
</p>
|
||||
</Fragment>
|
||||
}
|
||||
actions={createPolicyButton}
|
||||
/>
|
||||
</EuiPageContent>
|
||||
</EuiPageBody>
|
||||
</p>
|
||||
</Fragment>
|
||||
}
|
||||
actions={createPolicyButton}
|
||||
/>
|
||||
</EuiPageContent>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<EuiPageBody>
|
||||
<EuiPageContent verticalPosition="center" horizontalPosition="center">
|
||||
{confirmModal}
|
||||
<>
|
||||
{confirmModal}
|
||||
|
||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiTitle size="l">
|
||||
<h1 data-test-subj="sectionHeading">
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.sectionHeading"
|
||||
defaultMessage="Index Lifecycle Policies"
|
||||
/>
|
||||
</h1>
|
||||
</EuiTitle>
|
||||
</EuiFlexItem>
|
||||
<EuiFlexItem grow={false}>{createPolicyButton}</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
<EuiSpacer size="s" />
|
||||
<EuiText>
|
||||
<p>
|
||||
<EuiPageHeader
|
||||
pageTitle={
|
||||
<span data-test-subj="sectionHeading">
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.sectionDescription"
|
||||
defaultMessage="Manage your indices as they age. Attach a policy to automate
|
||||
when and how to transition an index through its lifecycle."
|
||||
id="xpack.indexLifecycleMgmt.policyTable.sectionHeading"
|
||||
defaultMessage="Index Lifecycle Policies"
|
||||
/>
|
||||
</p>
|
||||
</EuiText>
|
||||
</span>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.indexLifecycleMgmt.policyTable.sectionDescription"
|
||||
defaultMessage="Manage your indices as they age. Attach a policy to automate
|
||||
when and how to transition an index through its lifecycle."
|
||||
/>
|
||||
}
|
||||
bottomBorder
|
||||
rightSideItems={[createPolicyButton]}
|
||||
/>
|
||||
|
||||
<EuiSpacer />
|
||||
{content}
|
||||
</EuiPageContent>
|
||||
</EuiPageBody>
|
||||
<EuiSpacer size="l" />
|
||||
|
||||
{content}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue