mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[ML] range control for top n buckets
This commit is contained in:
parent
8dc6d5b6ca
commit
e039f250e2
1 changed files with 16 additions and 2 deletions
|
@ -10,10 +10,12 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
||||||
import {
|
import {
|
||||||
EuiAccordion,
|
EuiAccordion,
|
||||||
EuiDescribedFormGroup,
|
EuiDescribedFormGroup,
|
||||||
EuiFieldNumber,
|
|
||||||
EuiFormRow,
|
EuiFormRow,
|
||||||
|
EuiHorizontalRule,
|
||||||
|
EuiRange,
|
||||||
EuiSpacer,
|
EuiSpacer,
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
|
import { i18n } from '@kbn/i18n';
|
||||||
import { MlAnomalyDetectionAlertAdvancedSettings } from '../../common/types/alerts';
|
import { MlAnomalyDetectionAlertAdvancedSettings } from '../../common/types/alerts';
|
||||||
import { TimeIntervalControl } from './time_interval_control';
|
import { TimeIntervalControl } from './time_interval_control';
|
||||||
import { numberValidator, timeIntervalInputValidator } from '../../common/util/validators';
|
import { numberValidator, timeIntervalInputValidator } from '../../common/util/validators';
|
||||||
|
@ -96,15 +98,27 @@ export const AdvancedSettings: FC<AdvancedSettingsProps> = React.memo(({ value,
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<EuiFieldNumber
|
<EuiRange
|
||||||
|
showInput
|
||||||
|
showRange
|
||||||
|
showValue
|
||||||
|
showTicks
|
||||||
|
tickInterval={1}
|
||||||
|
step={1}
|
||||||
value={value.topNBuckets ?? TOP_N_BUCKETS_COUNT}
|
value={value.topNBuckets ?? TOP_N_BUCKETS_COUNT}
|
||||||
min={1}
|
min={1}
|
||||||
|
max={5}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
// @ts-ignore Property 'value' does not exist on type 'EventTarget' | (EventTarget & HTMLInputElement)
|
||||||
onChange({ topNBuckets: Number(e.target.value) });
|
onChange({ topNBuckets: Number(e.target.value) });
|
||||||
}}
|
}}
|
||||||
|
aria-label={i18n.translate('xpack.ml.anomalyDetectionAlert.topNBucketsLabel', {
|
||||||
|
defaultMessage: 'Top N buckets',
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
</EuiFormRow>
|
</EuiFormRow>
|
||||||
</EuiDescribedFormGroup>
|
</EuiDescribedFormGroup>
|
||||||
|
<EuiHorizontalRule margin={'m'} />
|
||||||
</EuiAccordion>
|
</EuiAccordion>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue