mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Metrics UI] Pass relevant shouldAllowEdit capabilities into SettingsPage (#49781)
* [Metrics UI] Pass relevant shouldAllowEdit capabilities into SettingsPage * Split settings pages in two; add loading screen to settings page * Restore timestamp field to metrics screen Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
89e4daf5bd
commit
8edb53ddbc
7 changed files with 334 additions and 288 deletions
|
@ -26,6 +26,7 @@ interface FieldsConfigurationPanelProps {
|
|||
podFieldProps: InputFieldProps;
|
||||
tiebreakerFieldProps: InputFieldProps;
|
||||
timestampFieldProps: InputFieldProps;
|
||||
displaySettings: 'metrics' | 'logs';
|
||||
}
|
||||
|
||||
export const FieldsConfigurationPanel = ({
|
||||
|
@ -36,6 +37,7 @@ export const FieldsConfigurationPanel = ({
|
|||
podFieldProps,
|
||||
tiebreakerFieldProps,
|
||||
timestampFieldProps,
|
||||
displaySettings,
|
||||
}: FieldsConfigurationPanelProps) => (
|
||||
<EuiForm>
|
||||
<EuiTitle size="s">
|
||||
|
@ -94,193 +96,201 @@ export const FieldsConfigurationPanel = ({
|
|||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="tiebreakerField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldLabel"
|
||||
defaultMessage="Tiebreaker"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldDescription"
|
||||
defaultMessage="Field used to break ties between two entries with the same timestamp"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['tiebreakerField']}
|
||||
error={tiebreakerFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>_doc</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={tiebreakerFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldLabel"
|
||||
defaultMessage="Tiebreaker"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...tiebreakerFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="containerField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldLabel"
|
||||
defaultMessage="Container ID"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldDescription"
|
||||
defaultMessage="Field used to identify Docker containers"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['containerField']}
|
||||
error={containerFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>container.id</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={containerFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldLabel"
|
||||
defaultMessage="Container ID"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...containerFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="hostNameField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostNameFieldLabel"
|
||||
defaultMessage="Host name"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostNameFieldDescription"
|
||||
defaultMessage="Field used to identify hosts"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['hostNameField']}
|
||||
error={hostFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostFieldDescription"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>host.name</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={hostFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostFieldLabel"
|
||||
defaultMessage="Host name"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...hostFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="podField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldLabel"
|
||||
defaultMessage="Pod ID"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldDescription"
|
||||
defaultMessage="Field used to identify Kubernetes pods"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['podField']}
|
||||
error={podFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>kubernetes.pod.uid</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={podFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldLabel"
|
||||
defaultMessage="Pod ID"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...podFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
{displaySettings === 'logs' && (
|
||||
<>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="tiebreakerField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldLabel"
|
||||
defaultMessage="Tiebreaker"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldDescription"
|
||||
defaultMessage="Field used to break ties between two entries with the same timestamp"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['tiebreakerField']}
|
||||
error={tiebreakerFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>_doc</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={tiebreakerFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.tiebreakerFieldLabel"
|
||||
defaultMessage="Tiebreaker"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...tiebreakerFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
</>
|
||||
)}
|
||||
{displaySettings === 'metrics' && (
|
||||
<>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="containerField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldLabel"
|
||||
defaultMessage="Container ID"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldDescription"
|
||||
defaultMessage="Field used to identify Docker containers"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['containerField']}
|
||||
error={containerFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>container.id</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={containerFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.containerFieldLabel"
|
||||
defaultMessage="Container ID"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...containerFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="hostNameField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostNameFieldLabel"
|
||||
defaultMessage="Host name"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostNameFieldDescription"
|
||||
defaultMessage="Field used to identify hosts"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['hostNameField']}
|
||||
error={hostFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostFieldDescription"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>host.name</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={hostFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.hostFieldLabel"
|
||||
defaultMessage="Host name"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...hostFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="podField"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldLabel"
|
||||
defaultMessage="Pod ID"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldDescription"
|
||||
defaultMessage="Field used to identify Kubernetes pods"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['podField']}
|
||||
error={podFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>kubernetes.pod.uid</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={podFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.podFieldLabel"
|
||||
defaultMessage="Pod ID"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...podFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
</>
|
||||
)}
|
||||
</EuiForm>
|
||||
);
|
||||
|
|
|
@ -23,6 +23,7 @@ interface IndicesConfigurationPanelProps {
|
|||
readOnly: boolean;
|
||||
logAliasFieldProps: InputFieldProps;
|
||||
metricAliasFieldProps: InputFieldProps;
|
||||
displaySettings: 'metrics' | 'logs';
|
||||
}
|
||||
|
||||
export const IndicesConfigurationPanel = ({
|
||||
|
@ -30,6 +31,7 @@ export const IndicesConfigurationPanel = ({
|
|||
readOnly,
|
||||
logAliasFieldProps,
|
||||
metricAliasFieldProps,
|
||||
displaySettings,
|
||||
}: IndicesConfigurationPanelProps) => (
|
||||
<EuiForm>
|
||||
<EuiTitle size="s">
|
||||
|
@ -41,101 +43,105 @@ export const IndicesConfigurationPanel = ({
|
|||
</h3>
|
||||
</EuiTitle>
|
||||
<EuiSpacer size="m" />
|
||||
<EuiDescribedFormGroup
|
||||
idAria="metricIndices"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesTitle"
|
||||
defaultMessage="Metric indices"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesDescription"
|
||||
defaultMessage="Index pattern for matching indices that contain Metricbeat data"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['metricIndices']}
|
||||
error={metricAliasFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>metricbeat-*</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
{displaySettings === 'metrics' && (
|
||||
<EuiDescribedFormGroup
|
||||
idAria="metricIndices"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesTitle"
|
||||
defaultMessage="Metric indices"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
isInvalid={metricAliasFieldProps.isInvalid}
|
||||
label={
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesLabel"
|
||||
defaultMessage="Metric indices"
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesDescription"
|
||||
defaultMessage="Index pattern for matching indices that contain Metricbeat data"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
data-test-subj="metricIndicesInput"
|
||||
<EuiFormRow
|
||||
describedByIds={['metricIndices']}
|
||||
error={metricAliasFieldProps.error}
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...metricAliasFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
<EuiDescribedFormGroup
|
||||
idAria="logIndices"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesTitle"
|
||||
defaultMessage="Log indices"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesDescription"
|
||||
defaultMessage="Index pattern for matching indices that contain log data"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFormRow
|
||||
describedByIds={['logIndices']}
|
||||
error={logAliasFieldProps.error}
|
||||
fullWidth
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>filebeat-*</EuiCode>,
|
||||
}}
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>metricbeat-*</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={metricAliasFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.metricIndicesLabel"
|
||||
defaultMessage="Metric indices"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
data-test-subj="metricIndicesInput"
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
readOnly={readOnly}
|
||||
isLoading={isLoading}
|
||||
{...metricAliasFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
)}
|
||||
{displaySettings === 'logs' && (
|
||||
<EuiDescribedFormGroup
|
||||
idAria="logIndices"
|
||||
title={
|
||||
<h4>
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesTitle"
|
||||
defaultMessage="Log indices"
|
||||
/>
|
||||
</h4>
|
||||
}
|
||||
isInvalid={logAliasFieldProps.isInvalid}
|
||||
label={
|
||||
description={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesLabel"
|
||||
defaultMessage="Log indices"
|
||||
id="xpack.infra.sourceConfiguration.logIndicesDescription"
|
||||
defaultMessage="Index pattern for matching indices that contain log data"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
data-test-subj="logIndicesInput"
|
||||
<EuiFormRow
|
||||
describedByIds={['logIndices']}
|
||||
error={logAliasFieldProps.error}
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
isLoading={isLoading}
|
||||
readOnly={readOnly}
|
||||
{...logAliasFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
helpText={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesRecommendedValue"
|
||||
defaultMessage="The recommended value is {defaultValue}"
|
||||
values={{
|
||||
defaultValue: <EuiCode>filebeat-*</EuiCode>,
|
||||
}}
|
||||
/>
|
||||
}
|
||||
isInvalid={logAliasFieldProps.isInvalid}
|
||||
label={
|
||||
<FormattedMessage
|
||||
id="xpack.infra.sourceConfiguration.logIndicesLabel"
|
||||
defaultMessage="Log indices"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<EuiFieldText
|
||||
data-test-subj="logIndicesInput"
|
||||
fullWidth
|
||||
disabled={isLoading}
|
||||
isLoading={isLoading}
|
||||
readOnly={readOnly}
|
||||
{...logAliasFieldProps}
|
||||
/>
|
||||
</EuiFormRow>
|
||||
</EuiDescribedFormGroup>
|
||||
)}
|
||||
</EuiForm>
|
||||
);
|
||||
|
|
|
@ -25,13 +25,16 @@ import { IndicesConfigurationPanel } from './indices_configuration_panel';
|
|||
import { NameConfigurationPanel } from './name_configuration_panel';
|
||||
import { LogColumnsConfigurationPanel } from './log_columns_configuration_panel';
|
||||
import { useSourceConfigurationFormState } from './source_configuration_form_state';
|
||||
import { SourceLoadingPage } from '../source_loading_page';
|
||||
|
||||
interface SourceConfigurationSettingsProps {
|
||||
shouldAllowEdit: boolean;
|
||||
displaySettings: 'metrics' | 'logs';
|
||||
}
|
||||
|
||||
export const SourceConfigurationSettings = ({
|
||||
shouldAllowEdit,
|
||||
displaySettings,
|
||||
}: SourceConfigurationSettingsProps) => {
|
||||
const {
|
||||
createSourceConfiguration,
|
||||
|
@ -80,7 +83,10 @@ export const SourceConfigurationSettings = ({
|
|||
source,
|
||||
]);
|
||||
|
||||
if (!source || !source.configuration) {
|
||||
if (!source) {
|
||||
return <SourceLoadingPage />;
|
||||
}
|
||||
if (!source.configuration) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -112,6 +118,7 @@ export const SourceConfigurationSettings = ({
|
|||
logAliasFieldProps={indicesConfigurationProps.logAlias}
|
||||
metricAliasFieldProps={indicesConfigurationProps.metricAlias}
|
||||
readOnly={!isWriteable}
|
||||
displaySettings={displaySettings}
|
||||
/>
|
||||
</EuiPanel>
|
||||
<EuiSpacer />
|
||||
|
@ -124,18 +131,21 @@ export const SourceConfigurationSettings = ({
|
|||
readOnly={!isWriteable}
|
||||
tiebreakerFieldProps={indicesConfigurationProps.tiebreakerField}
|
||||
timestampFieldProps={indicesConfigurationProps.timestampField}
|
||||
displaySettings={displaySettings}
|
||||
/>
|
||||
</EuiPanel>
|
||||
<EuiSpacer />
|
||||
<EuiPanel paddingSize="l">
|
||||
<LogColumnsConfigurationPanel
|
||||
addLogColumn={addLogColumn}
|
||||
moveLogColumn={moveLogColumn}
|
||||
availableFields={availableFields}
|
||||
isLoading={isLoading}
|
||||
logColumnConfiguration={logColumnConfigurationProps}
|
||||
/>
|
||||
</EuiPanel>
|
||||
{displaySettings === 'logs' && (
|
||||
<EuiPanel paddingSize="l">
|
||||
<LogColumnsConfigurationPanel
|
||||
addLogColumn={addLogColumn}
|
||||
moveLogColumn={moveLogColumn}
|
||||
availableFields={availableFields}
|
||||
isLoading={isLoading}
|
||||
logColumnConfiguration={logColumnConfigurationProps}
|
||||
/>
|
||||
</EuiPanel>
|
||||
)}
|
||||
{errors.length > 0 ? (
|
||||
<>
|
||||
<EuiCallOut color="danger">
|
||||
|
|
|
@ -20,7 +20,7 @@ import { WithSource } from '../../containers/with_source';
|
|||
import { Source } from '../../containers/source';
|
||||
import { MetricsExplorerPage } from './metrics_explorer';
|
||||
import { SnapshotPage } from './snapshot';
|
||||
import { SettingsPage } from '../shared/settings';
|
||||
import { MetricsSettingsPage } from './settings';
|
||||
import { AppNavigation } from '../../components/navigation/app_navigation';
|
||||
import { SourceLoadingPage } from '../../components/source_loading_page';
|
||||
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
|
||||
|
@ -106,7 +106,7 @@ export const InfrastructurePage = ({ match }: RouteComponentProps) => {
|
|||
</WithSource>
|
||||
)}
|
||||
/>
|
||||
<Route path={`${match.path}/settings`} component={SettingsPage} />
|
||||
<Route path={`${match.path}/settings`} component={MetricsSettingsPage} />
|
||||
</Switch>
|
||||
</ColumnarPage>
|
||||
</Source.Provider>
|
||||
|
|
|
@ -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;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { SourceConfigurationSettings } from '../../components/source_configuration/source_configuration_settings';
|
||||
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
|
||||
|
||||
export const MetricsSettingsPage = () => {
|
||||
const uiCapabilities = useKibana().services.application?.capabilities;
|
||||
return (
|
||||
<SourceConfigurationSettings
|
||||
shouldAllowEdit={uiCapabilities?.infrastructure?.configureSource as boolean}
|
||||
displaySettings="metrics"
|
||||
/>
|
||||
);
|
||||
};
|
|
@ -17,7 +17,7 @@ import { SourceLoadingPage } from '../../components/source_loading_page';
|
|||
import { SourceErrorPage } from '../../components/source_error_page';
|
||||
import { Source, useSource } from '../../containers/source';
|
||||
import { StreamPage } from './stream';
|
||||
import { SettingsPage } from '../shared/settings';
|
||||
import { LogsSettingsPage } from './settings';
|
||||
import { AppNavigation } from '../../components/navigation/app_navigation';
|
||||
import {
|
||||
useLogAnalysisCapabilities,
|
||||
|
@ -107,7 +107,7 @@ export const LogsPage = ({ match }: RouteComponentProps) => {
|
|||
<Route path={streamTab.path} component={StreamPage} />
|
||||
<Route path={logRateTab.path} component={LogEntryRatePage} />
|
||||
<Route path={logCategoriesTab.path} component={LogEntryCategoriesPage} />
|
||||
<Route path={settingsTab.path} component={SettingsPage} />
|
||||
<Route path={settingsTab.path} component={LogsSettingsPage} />
|
||||
<RedirectWithQueryParams
|
||||
from={`${match.path}/analysis`}
|
||||
to={logRateTab.path}
|
||||
|
|
|
@ -5,14 +5,15 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { SourceConfigurationSettings } from '../../../components/source_configuration/source_configuration_settings';
|
||||
import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
||||
import { SourceConfigurationSettings } from '../../components/source_configuration/source_configuration_settings';
|
||||
import { useKibana } from '../../../../../../../src/plugins/kibana_react/public';
|
||||
|
||||
export const SettingsPage = () => {
|
||||
export const LogsSettingsPage = () => {
|
||||
const uiCapabilities = useKibana().services.application?.capabilities;
|
||||
return (
|
||||
<SourceConfigurationSettings
|
||||
shouldAllowEdit={uiCapabilities?.logs?.configureSource as boolean}
|
||||
displaySettings="logs"
|
||||
/>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue