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aAAc,EACnE,EAEDO,EAAe,SAAS,QAAQR,CAAO,CACzC,EACA,MAAMc,EAAmB,CACvB,MAAMC,KAAM,MAAW,IAAU,qBAAqB,MAAMD,CAAS,EAAE,GAAG,EACpEd,KAAU,MAAM,OAAQe,CAAG,EAEjCP,EAAe,MAAM,QAAQR,CAAO,CACtC,EACA,OAAOc,EAAmB,CACxB,MAAMC,KAAM,MAAW,IAAU,qBAAqB,OAAOD,CAAS,EAAE,GAAG,EACrEd,KAAU,MAAM,SAAUe,CAAG,EAEnCP,EAAe,OAAO,QAAQR,CAAO,CACvC,EACA,OAAOc,EAAmB,CACxB,MAAMC,KAAM,MAAW,IAAU,qBAAqB,OAAOD,CAAS,EAAE,GAAG,EACrEd,KAAU,MAAM,OAAQe,CAAG,EAEjCP,EAAe,OAAO,QAAQR,CAAO,CACvC,EACA,UAAUc,EAAmB,CAC3B,KAAK,cAAcA,CAAS,EAAI,KAAK,cAAcA,CAAS,EAAI,KAAK,cAAcA,CAAS,EAAI,EAAI,CACtG,EACA,YAAYA,EAAmB,CAC7B,KAAK,cAAcA,CAAS,EAAI,KAAK,cAAcA,CAAS,EAAI,EAAI,KAAK,cAAcA,CAAS,EAAI,EAAI,EAEpG,KAAK,cAAcA,CAAS,IAAM,GACpC,OAAO,KAAK,cAAcA,CAAS,CAEvC,CACF,CAAC,CACH,C","sources":["webpack://graylog-web-interface/./src/components/indices/IndexMaintenanceStrategiesConfiguration.tsx","webpack://graylog-web-interface/./src/components/indices/IndexMaintenanceStrategiesSummary.jsx","webpack://graylog-web-interface/./src/components/indices/contexts/IndexRetentionContext.tsx","webpack://graylog-web-interface/./src/components/indices/contexts/IndexRetentionProvider.tsx","webpack://graylog-web-interface/./src/components/indices/retention/DeletionRetentionStrategyConfiguration.jsx","webpack://graylog-web-interface/./src/components/indices/retention/DeletionRetentionStrategySummary.jsx","webpack://graylog-web-interface/./src/components/indices/retention/ClosingRetentionStrategyConfiguration.jsx","webpack://graylog-web-interface/./src/components/indices/retention/ClosingRetentionStrategySummary.jsx","webpack://graylog-web-interface/./src/components/indices/retention/NoopRetentionStrategyConfiguration.jsx","webpack://graylog-web-interface/./src/components/indices/retention/NoopRetentionStrategySummary.jsx","webpack://graylog-web-interface/./src/components/indices/retention/index.ts","webpack://graylog-web-interface/./src/components/indices/rotation/MessageCountRotationStrategyConfiguration.jsx","webpack://graylog-web-interface/./src/components/indices/rotation/MessageCountRotationStrategySummary.jsx","webpack://graylog-web-interface/./src/components/indices/rotation/SizeBasedRotationStrategyConfiguration.jsx","webpack://graylog-web-interface/./src/components/indices/rotation/SizeBasedRotationStrategySummary.jsx","webpack://graylog-web-interface/./src/components/indices/rotation/TimeBasedRotationStrategyConfiguration.jsx","webpack://graylog-web-interface/./src/components/indices/rotation/TimeBasedRotationStrategySummary.jsx","webpack://graylog-web-interface/./src/hooks/useMaxIndexRotationLimit.ts","webpack://graylog-web-interface/./src/components/common/RangeInput.tsx","webpack://graylog-web-interface/./src/hooks/useTimeSizeOptimizingFixedLeeway.ts","webpack://graylog-web-interface/./src/components/indices/rotation/TimeBasedSizeOptimizingStrategyConfiguration.tsx","webpack://graylog-web-interface/./src/components/indices/rotation/TimeBasedSizeOptimizingStrategySummary.tsx","webpack://graylog-web-interface/./src/components/indices/rotation/index.ts","webpack://graylog-web-interface/./src/stores/indices/IndicesConfigurationStore.ts","webpack://graylog-web-interface/./src/stores/indices/IndicesStore.ts"],"sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport { useCallback, useState, useEffect } from 'react';\nimport { useFormikContext } from 'formik';\nimport styled from 'styled-components';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\n\nimport type {\n RetentionStrategyConfig,\n RotationStrategy,\n TimeBasedRotationStrategyConfig,\n JsonSchema,\n StrategyConfig,\n Strategy,\n Strategies,\n} from 'components/indices/Types';\nimport type { SystemConfigurationComponentProps } from 'views/types';\nimport {\n ARCHIVE_RETENTION_STRATEGY,\n NOOP_RETENTION_STRATEGY,\n RETENTION,\n TIME_BASED_ROTATION_STRATEGY,\n TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY,\n TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY_TYPE,\n} from 'stores/indices/IndicesStore';\nimport { Alert, Col, Input, Row } from 'components/bootstrap';\nimport { Select } from 'components/common';\nimport { useIndexRetention } from 'components/indices/contexts/IndexRetentionContext';\n\ntype IndexMaintenanceStrategiesFormValues = {\n rotation_strategy?: RotationStrategy,\n rotation_strategy_class?: string,\n retention_strategy_class?: string,\n}\n\ninterface ConfigComponentProps extends SystemConfigurationComponentProps {\n config: StrategyConfig,\n jsonSchema: JsonSchema,\n updateConfig: (update: StrategyConfig) => void\n useMaxNumberOfIndices?: () => [\n number | undefined,\n React.Dispatch>\n ],\n}\n\ntype Props = {\n title: string,\n name: string,\n description?: string,\n selectPlaceholder: string,\n pluginExports: Array<{\n type: string,\n displayName: string,\n configComponent: React.ComponentType\n }>,\n strategies: Strategies,\n retentionStrategiesContext: {\n max_index_retention_period?: string,\n },\n activeConfig: {\n strategy: string,\n config: StrategyConfig,\n },\n getState: (strategy: string, data: StrategyConfig) => {\n rotation_strategy_config?: StrategyConfig,\n rotation_strategy_class?: string,\n retention_strategy_config?: StrategyConfig,\n retention_strategy_class?: string,\n },\n}\n\nconst hasRetentionConfigField = (configData: StrategyConfig, field: string): configData is RetentionStrategyConfig => field in configData;\n\nconst StyledH3 = styled.h3`\n margin-bottom: 10px;\n`;\nconst StyledSelect = styled(Select)`\n margin-bottom: 10px;\n`;\nconst StyledAlert = styled(Alert)`\n overflow: auto;\n margin-right: 15px;\n margin-left: 15px;\n`;\n\nconst getStrategyJsonSchema = (selectedStrategy: string, strategies: Strategies) : JsonSchema | undefined => {\n const result = strategies.filter((s) => s.type === selectedStrategy)[0];\n\n return result ? result.json_schema : undefined;\n};\n\nconst getDefaultStrategyConfig = (selectedStrategy: string, strategies: Strategies) : StrategyConfig | undefined => {\n const result = strategies.filter((s) => s.type === selectedStrategy)[0];\n\n return result ? result.default_config : undefined;\n};\n\nconst getTimeBaseStrategyWithElasticLimit = (activeConfig: TimeBasedRotationStrategyConfig, strategies: Strategies) : StrategyConfig => {\n const timeBasedStrategy = getDefaultStrategyConfig(TIME_BASED_ROTATION_STRATEGY, strategies) as TimeBasedRotationStrategyConfig;\n\n return { ...activeConfig, max_rotation_period: timeBasedStrategy?.max_rotation_period };\n};\n\nconst getStrategyConfig = (configTypeName: string, selectedStrategy: string, activeStrategy: string, activeConfig: StrategyConfig, strategies: Strategies) : StrategyConfig | undefined => {\n if (selectedStrategy === TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY && configTypeName === 'retention') {\n return activeConfig;\n }\n\n if (activeStrategy === selectedStrategy) {\n // If the newly selected strategy is the current active strategy, we use the active configuration.\n return activeStrategy === TIME_BASED_ROTATION_STRATEGY ? getTimeBaseStrategyWithElasticLimit(activeConfig as TimeBasedRotationStrategyConfig, strategies) : activeConfig;\n }\n\n // If the newly selected strategy is not the current active strategy, we use the selected strategy's default config.\n return getDefaultStrategyConfig(selectedStrategy, strategies);\n};\n\nconst getConfigurationComponent = (\n configTypeName: string,\n selectedStrategy: string,\n pluginExports: Array<{\n type: string,\n displayName: string,\n configComponent: React.ComponentType,\n }>,\n strategies: Strategies,\n strategy: Strategy | string,\n config: StrategyConfig,\n onConfigUpdate: (update: StrategyConfig) => void,\n useMaxNumberOfIndices: () => [\n number | undefined,\n React.Dispatch>\n ]) => {\n if (!selectedStrategy || selectedStrategy.length < 1) {\n return null;\n }\n\n const strategyPlugin = pluginExports.filter((exportedStrategy) => exportedStrategy.type === selectedStrategy)[0];\n\n if (!strategyPlugin) {\n return null;\n }\n\n const strategyType = typeof strategy === 'string' ? strategy : strategy.type;\n\n const strategyConfig = getStrategyConfig(configTypeName, selectedStrategy, strategyType, config, strategies);\n\n let componentProps : ConfigComponentProps = {\n config: strategyConfig,\n jsonSchema: getStrategyJsonSchema(selectedStrategy, strategies),\n updateConfig: onConfigUpdate,\n };\n\n if (selectedStrategy === ARCHIVE_RETENTION_STRATEGY) {\n componentProps = { ...componentProps, useMaxNumberOfIndices };\n }\n\n const element = React.createElement(strategyPlugin.configComponent as React.ComponentType, componentProps);\n\n return ({element});\n};\n\nconst IndexMaintenanceStrategiesConfiguration = ({\n title,\n name,\n description,\n selectPlaceholder,\n pluginExports,\n strategies,\n retentionStrategiesContext: { max_index_retention_period: maxRetentionPeriod },\n activeConfig: { strategy, config },\n getState,\n} : Props) => {\n const [newStrategy, setNewStrategy] = useState(strategy);\n const {\n setValues,\n values,\n values: {\n rotation_strategy: rotationStrategy,\n rotation_strategy_class: rotationStrategyClass,\n retention_strategy_class: retentionStrategyClass,\n },\n } = useFormikContext();\n\n const [maxNumberOfIndices, setMaxNumberOfIndices] = useIndexRetention().useMaxNumberOfIndices;\n\n useEffect(() => {\n if (config && hasRetentionConfigField(config, 'max_number_of_indices')) {\n setMaxNumberOfIndices(config.max_number_of_indices);\n }\n }, [config, setMaxNumberOfIndices]);\n\n const retentionIsNotNoop = retentionStrategyClass !== NOOP_RETENTION_STRATEGY;\n const isArchiveRetention = retentionStrategyClass !== ARCHIVE_RETENTION_STRATEGY;\n const shouldShowMaxRetentionWarning = maxRetentionPeriod && rotationStrategyClass === TIME_BASED_ROTATION_STRATEGY && retentionIsNotNoop;\n const isTimeBasedSizeOptimizing = rotationStrategyClass === TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY;\n const shouldShowTimeBasedSizeOptimizingForm = isTimeBasedSizeOptimizing && name === 'retention' && retentionIsNotNoop;\n const shouldShowNormalRetentionForm = (!isTimeBasedSizeOptimizing || (name === 'retention' && (!retentionIsNotNoop || !isArchiveRetention)));\n const helpText = isTimeBasedSizeOptimizing && name === 'rotation'\n ? 'The Time Based Size Optimizing Rotation Strategy tries to rotate the index daily.'\n + ' It can however skip the rotation to achieve optimal sized indices by keeping the shard size between 20 and 50 GB.'\n + ' The optimization can delay the rotation within the range of the configured retention min/max lifetime.'\n + ' If an index is older than the range between min/max, it will be rotated regardless of its current size.'\n : null;\n\n const _onSelect = (selectedStrategy) => {\n if (!selectedStrategy || selectedStrategy.length < 1) {\n setNewStrategy(undefined);\n\n return;\n }\n\n const newConfig = getStrategyConfig(name, selectedStrategy, strategy, config, strategies);\n setNewStrategy(selectedStrategy);\n setValues({ ...values, ...getState(selectedStrategy, newConfig) });\n };\n\n const _onConfigUpdate = useCallback((newConfig) => {\n const _addConfigType = (selectedStrategy, data) => {\n // The config object needs to have the \"type\" field set to the \"default_config.type\" to make the REST call work.\n const result = strategies.filter((s) => s.type === selectedStrategy)[0];\n const copy = data;\n\n if (result) {\n copy.type = result.default_config.type;\n }\n\n return copy;\n };\n\n const configuration = _addConfigType(newStrategy, newConfig);\n setValues({ ...values, ...getState(newStrategy, configuration) });\n }, [getState, newStrategy, setValues, strategies, values]);\n\n const _onIndexTimeSizeOptimizingUpdate = useCallback((newConfig) => {\n if (isTimeBasedSizeOptimizing) {\n setValues({ ...values, ...{ rotation_strategy_class: rotationStrategyClass, rotation_strategy: { ...newConfig, type: TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY_TYPE } } });\n }\n }, [isTimeBasedSizeOptimizing, rotationStrategyClass, setValues, values]);\n\n const getAvailableSelectOptions = () => {\n const availableStrategies = pluginExports\n .filter((pluginOptions) => strategies.find(({ type }) => type === pluginOptions.type));\n\n const isSelectedItemInList = availableStrategies.filter((availableStrategy) => availableStrategy.type === newStrategy).length > 0;\n\n if (!isSelectedItemInList) {\n return [...availableStrategies, pluginExports.find((pluginOptions) => pluginOptions.type === newStrategy)].map((pluginOptions) => ({ value: pluginOptions.type, label: pluginOptions.displayName }));\n }\n\n return availableStrategies\n .map((c) => ({ value: c.type, label: c.displayName }));\n };\n\n const getDisplayName = () => pluginExports.find((pluginOptions) => pluginOptions.type === newStrategy).displayName;\n\n const getActiveSelection = () => newStrategy;\n\n const shouldShowInvalidRetentionWarning = () => (\n name === RETENTION && !getStrategyJsonSchema(getActiveSelection(), strategies)\n );\n\n return (\n \n {title} \n {description && (\n \n {description}\n \n )}\n {helpText && (\n \n {helpText}\n \n )}\n {shouldShowMaxRetentionWarning && (\n \n The effective retention period value calculated from the\n Rotation period and the max number of indices should not be greater than the\n Max retention period of {maxRetentionPeriod} set by the Administrator.\n \n )}\n {shouldShowInvalidRetentionWarning() && (\n \n {getDisplayName()} strategy was deactivated.\n Please configure a valid retention strategy.\n \n )}\n \n \n \n \n \n \n
\n \n \n {shouldShowTimeBasedSizeOptimizingForm && getConfigurationComponent(\n name,\n TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY,\n PluginStore.exports('indexRotationConfig'),\n [rotationStrategy],\n rotationStrategy,\n rotationStrategy,\n _onIndexTimeSizeOptimizingUpdate,\n () => [maxNumberOfIndices, setMaxNumberOfIndices],\n )}\n {shouldShowNormalRetentionForm && getConfigurationComponent(\n name,\n getActiveSelection(),\n pluginExports,\n strategies,\n strategy,\n config,\n _onConfigUpdate,\n () => [maxNumberOfIndices, setMaxNumberOfIndices],\n )}\n \n
\n \n );\n};\n\nIndexMaintenanceStrategiesConfiguration.propTypes = {\n title: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n description: PropTypes.string,\n selectPlaceholder: PropTypes.string.isRequired,\n pluginExports: PropTypes.array.isRequired,\n strategies: PropTypes.array.isRequired,\n retentionStrategiesContext: PropTypes.shape({\n max_index_retention_period: PropTypes.string,\n }),\n activeConfig: PropTypes.object.isRequired,\n getState: PropTypes.func.isRequired,\n};\n\nIndexMaintenanceStrategiesConfiguration.defaultProps = {\n description: undefined,\n retentionStrategiesContext: {\n max_index_retention_period: undefined,\n },\n};\n\nexport default IndexMaintenanceStrategiesConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { Alert } from 'components/bootstrap';\nimport Spinner from 'components/common/Spinner';\n\nclass IndexMaintenanceStrategiesSummary extends React.Component {\n static propTypes = {\n config: PropTypes.object.isRequired,\n pluginExports: PropTypes.array.isRequired,\n };\n\n render() {\n if (!this.props.config) {\n return ( );\n }\n\n const activeStrategy = this.props.config.strategy;\n const strategy = this.props.pluginExports.filter((exportedStrategy) => exportedStrategy.type === activeStrategy)[0];\n\n if (!strategy || !strategy.summaryComponent) {\n return (Summary for strategy {activeStrategy} not found! );\n }\n\n const element = React.createElement(strategy.summaryComponent, { config: this.props.config.config });\n\n return ({element});\n }\n}\n\nexport default IndexMaintenanceStrategiesSummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useContext } from 'react';\n\nexport type IndexRetentionContextType = {\n useMaxNumberOfIndices: [\n number | undefined,\n React.Dispatch>\n ]\n}\n\nconst IndexRetentionContext = React.createContext(null);\n\nconst useIndexRetention = (): IndexRetentionContextType => {\n try {\n const context = useContext(IndexRetentionContext);\n\n if (!context) {\n throw new Error('useIndexRetention must be used within a IndexRetentionProvider');\n }\n\n return context;\n } catch {\n return { useMaxNumberOfIndices: [9999, () => {}] };\n }\n};\n\nexport { useIndexRetention };\nexport default IndexRetentionContext;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useMemo, useState } from 'react';\n\nimport IndexRetentionContext from './IndexRetentionContext';\nimport type { IndexRetentionContextType } from './IndexRetentionContext';\n\ntype Props = {\n children: React.ReactNode,\n};\n\nconst IndexRetentionProvider = ({ children }: Props) => {\n const [maxNumberOfIndices, setMaxNumberOfIndices] = useState(undefined);\n\n const value: IndexRetentionContextType = useMemo(() => ({ useMaxNumberOfIndices: [maxNumberOfIndices, setMaxNumberOfIndices] }), [maxNumberOfIndices]);\n\n return (\n \n {children}\n \n );\n};\n\nexport default IndexRetentionProvider;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\n\nimport { getValueFromInput } from 'util/FormsUtils';\nimport { Input } from 'components/bootstrap';\nimport { useIndexRetention } from 'components/indices/contexts/IndexRetentionContext';\n\nconst DeletionRetentionStrategyConfiguration = ({ updateConfig }) => {\n const [maxNumberOfIndices, setMaxNumberOfIndices] = useIndexRetention().useMaxNumberOfIndices;\n\n const _onInputUpdate = (field) => (e) => {\n const update = {};\n const value = getValueFromInput(e.target);\n update[field] = value;\n\n setMaxNumberOfIndices(value);\n updateConfig(update);\n };\n\n return (\n \n Maximum number of indices to keep before deleting the oldest ones}\n required />\n \n );\n};\n\nDeletionRetentionStrategyConfiguration.propTypes = {\n updateConfig: PropTypes.func.isRequired,\n};\n\nexport default DeletionRetentionStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nconst DeletionRetentionStrategySummary = ({ config }) => (\n \n \n - Index retention strategy:
\n - Delete
\n - Max number of indices:
\n - {config.max_number_of_indices}
\n
\n \n);\n\nDeletionRetentionStrategySummary.propTypes = {\n config: PropTypes.object.isRequired,\n};\n\nexport default DeletionRetentionStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\n\nimport { getValueFromInput } from 'util/FormsUtils';\nimport { Input } from 'components/bootstrap';\nimport { useIndexRetention } from 'components/indices/contexts/IndexRetentionContext';\n\nconst ClosingRetentionStrategyConfiguration = ({ updateConfig }) => {\n const [maxNumberOfIndices, setMaxNumberOfIndices] = useIndexRetention().useMaxNumberOfIndices;\n\n const _onInputUpdate = (field) => (e) => {\n const update = {};\n const value = getValueFromInput(e.target);\n update[field] = value;\n\n setMaxNumberOfIndices(value);\n updateConfig(update);\n };\n\n return (\n \n Maximum number of indices to keep before closing the oldest ones}\n required />\n \n );\n};\n\nClosingRetentionStrategyConfiguration.propTypes = {\n updateConfig: PropTypes.func.isRequired,\n};\n\nexport default ClosingRetentionStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nconst ClosingRetentionStrategySummary = ({ config }) => (\n \n \n - Index retention strategy:
\n - Close
\n - Max number of indices:
\n - {config.max_number_of_indices}
\n
\n \n);\n\nClosingRetentionStrategySummary.propTypes = {\n config: PropTypes.object.isRequired,\n};\n\nexport default ClosingRetentionStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React from 'react';\nimport styled from 'styled-components';\n\nimport { Alert } from 'components/bootstrap';\n\nconst StyledAlert = styled(Alert)`\n overflow: auto;\n margin-right: 15px;\n margin-left: 15px;\n`;\n\nconst NoopRetentionStrategyConfiguration = () => (\n \n This retention strategy is not configurable because it does not do anything.\n \n);\n\nexport default NoopRetentionStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React from 'react';\n\nconst NoopRetentionStrategySummary = () => (\n \n \n - Index retention strategy:
\n - Do nothing
\n
\n \n);\n\nexport default NoopRetentionStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { PluginManifest, PluginStore } from 'graylog-web-plugin/plugin';\n\nimport DeletionRetentionStrategyConfiguration from './DeletionRetentionStrategyConfiguration';\nimport DeletionRetentionStrategySummary from './DeletionRetentionStrategySummary';\nimport ClosingRetentionStrategyConfiguration from './ClosingRetentionStrategyConfiguration';\nimport ClosingRetentionStrategySummary from './ClosingRetentionStrategySummary';\nimport NoopRetentionStrategyConfiguration from './NoopRetentionStrategyConfiguration';\nimport NoopRetentionStrategySummary from './NoopRetentionStrategySummary';\n\nPluginStore.register(new PluginManifest({}, {\n indexRetentionConfig: [\n {\n type: 'org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy',\n displayName: 'Delete Index',\n configComponent: DeletionRetentionStrategyConfiguration,\n summaryComponent: DeletionRetentionStrategySummary,\n },\n {\n type: 'org.graylog2.indexer.retention.strategies.ClosingRetentionStrategy',\n displayName: 'Close Index',\n configComponent: ClosingRetentionStrategyConfiguration,\n summaryComponent: ClosingRetentionStrategySummary,\n },\n {\n type: 'org.graylog2.indexer.retention.strategies.NoopRetentionStrategy',\n displayName: 'Do nothing',\n configComponent: NoopRetentionStrategyConfiguration,\n summaryComponent: NoopRetentionStrategySummary,\n },\n ],\n}));\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport { useState } from 'react';\n\nimport { getValueFromInput } from 'util/FormsUtils';\nimport { Input } from 'components/bootstrap';\n\nconst MessageCountRotationStrategyConfiguration = ({ config, updateConfig }) => {\n const { max_docs_per_index } = config;\n const [maxDocsPerIndex, setMaxDocsPerIndex] = useState(max_docs_per_index);\n\n const _onInputUpdate = (field) => (e) => {\n const update = {};\n const value = getValueFromInput(e.target);\n update[field] = value;\n\n setMaxDocsPerIndex(value);\n updateConfig(update);\n };\n\n return (\n \n \n \n );\n};\n\nMessageCountRotationStrategyConfiguration.propTypes = {\n config: PropTypes.object.isRequired,\n updateConfig: PropTypes.func.isRequired,\n};\n\nexport default MessageCountRotationStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nconst MessageCountRotationStrategySummary = ({ config }) => (\n \n \n - Index rotation strategy:
\n - Message Count
\n - Max docs per index:
\n - {config.max_docs_per_index}
\n
\n \n);\n\nMessageCountRotationStrategySummary.propTypes = {\n config: PropTypes.object.isRequired,\n};\n\nexport default MessageCountRotationStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport { useState } from 'react';\n\nimport { getValueFromInput } from 'util/FormsUtils';\nimport { Input } from 'components/bootstrap';\nimport NumberUtils from 'util/NumberUtils';\n\nconst SizeBasedRotationStrategyConfiguration = ({ config, updateConfig }) => {\n const { max_size } = config;\n const [maxSize, setMaxSize] = useState(max_size);\n\n const _onInputUpdate = (field) => (e) => {\n const update = {};\n const value = getValueFromInput(e.target);\n update[field] = value;\n\n setMaxSize(value);\n updateConfig(update);\n };\n\n const _formatSize = () => NumberUtils.formatBytes(maxSize);\n\n return (\n \n \n \n );\n};\n\nSizeBasedRotationStrategyConfiguration.propTypes = {\n config: PropTypes.object.isRequired,\n updateConfig: PropTypes.func.isRequired,\n};\n\nexport default SizeBasedRotationStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nimport NumberUtils from 'util/NumberUtils';\n\nconst SizeBasedRotationStrategySummary = ({ config }) => {\n const { max_size: maxSize } = config;\n\n return (\n \n \n - Index rotation strategy:
\n - Index Size
\n - Max index size:
\n - {maxSize} bytes ({NumberUtils.formatBytes(maxSize)})
\n
\n \n );\n};\n\nSizeBasedRotationStrategySummary.propTypes = {\n config: PropTypes.object.isRequired,\n};\n\nexport default SizeBasedRotationStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport moment from 'moment';\n\nimport { Input } from 'components/bootstrap';\n\nconst _validationLimit = (durationInMilliseconds, rotationLimit) => durationInMilliseconds <= moment.duration(rotationLimit).asMilliseconds();\n\nclass TimeBasedRotationStrategyConfiguration extends React.Component {\n static propTypes = {\n config: PropTypes.object.isRequired,\n updateConfig: PropTypes.func.isRequired,\n };\n\n inputs = {};\n\n constructor(props) {\n super(props);\n const {\n config: {\n rotation_period: rotationPeriod,\n max_rotation_period: rotationLimit,\n rotate_empty_index_set: rotateEmptyIndexSet,\n },\n } = this.props;\n\n this.state = {\n rotation_period: rotationPeriod,\n rotationLimit,\n rotate_empty_index_set: rotateEmptyIndexSet,\n };\n }\n\n _onPeriodUpdate = (field) => {\n const { updateConfig } = this.props;\n\n return () => {\n const update = {};\n let period = this.inputs[field].getValue().toUpperCase();\n\n if (!period.startsWith('P')) {\n period = `P${period}`;\n }\n\n update[field] = period;\n\n this.setState(update);\n\n if (this._isValidPeriod(update[field])) {\n // Only propagate state if the config is valid.\n updateConfig({\n rotation_period: period,\n rotate_empty_index_set: this.state.rotate_empty_index_set,\n });\n }\n };\n };\n\n _onRotateEmptyIndexSetUpdate = (field) => {\n const { updateConfig } = this.props;\n\n return () => {\n const update = {};\n const rotateEmptyIndexSet = this.inputs[field].getValue();\n\n update[field] = rotateEmptyIndexSet;\n this.setState(update);\n\n updateConfig({\n rotation_period: this.state.rotation_period,\n rotate_empty_index_set: rotateEmptyIndexSet,\n });\n };\n };\n\n _isValidPeriod = (duration) => {\n const { rotation_period: rotationPeriod, rotationLimit } = this.state;\n const check = duration || rotationPeriod;\n const checkInMilliseconds = moment.duration(check).asMilliseconds();\n\n return checkInMilliseconds >= 3600000 && (\n rotationLimit ? _validationLimit(checkInMilliseconds, rotationLimit) : true\n );\n };\n\n _validationState = () => {\n if (this._isValidPeriod()) {\n return undefined;\n }\n\n return 'error';\n };\n\n _formatDuration = () => {\n const { rotation_period: rotationPeriod, rotationLimit } = this.state;\n const maxRotationPeriodErrorMessage = rotationLimit ? ` and max ${moment.duration(rotationLimit).humanize()}` : '';\n\n return this._isValidPeriod() ? moment.duration(rotationPeriod).humanize() : `invalid (min 1 hour${maxRotationPeriodErrorMessage})`;\n };\n\n render() {\n const {\n rotation_period: rotationPeriod,\n rotate_empty_index_set: rotateEmptyIndexSet,\n rotationLimit,\n } = this.state;\n const maxRotationPeriodHelpText = rotationLimit ? ` The max rotation period is set to ${moment.duration(rotationLimit).humanize()} by Administrator.` : '';\n\n return (\n \n { this.inputs.rotation_period = rotationPeriodRef; }}\n label=\"Rotation period (ISO8601 Duration)\"\n onChange={this._onPeriodUpdate('rotation_period')}\n value={rotationPeriod}\n help={`How long an index gets written to before it is rotated. (i.e. \"P1D\" for 1 day, \"PT6H\" for 6 hours).${maxRotationPeriodHelpText}`}\n addonAfter={this._formatDuration()}\n bsStyle={this._validationState()}\n required />\n \n { this.inputs.rotate_empty_index_set = rotateEmptyIndexSetRef; }}\n label=\"Rotate empty index set\"\n onChange={this._onRotateEmptyIndexSetUpdate('rotate_empty_index_set')}\n checked={rotateEmptyIndexSet}\n help=\"Apply the rotation strategy even when the index set is empty (not recommended).\" />\n \n \n );\n }\n}\n\nexport default TimeBasedRotationStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport moment from 'moment';\nimport 'moment-duration-format';\n\nclass TimeBasedRotationStrategySummary extends React.Component {\n static propTypes = {\n config: PropTypes.object.isRequired,\n };\n\n _humanizedPeriod = () => {\n const duration = moment.duration(this.props.config.rotation_period);\n\n return `${duration.format()}, ${duration.humanize()}`;\n };\n\n render() {\n return (\n \n \n - Index rotation strategy:
\n - Index Time
\n - Rotation period:
\n - {this.props.config.rotation_period} ({this._humanizedPeriod()})
\n - Rotate empty index set:
\n - {this.props.config.rotate_empty_index_set ? 'Yes' : 'No'}
\n
\n \n );\n }\n}\n\nexport default TimeBasedRotationStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { useEffect } from 'react';\n\nimport { useStore } from 'stores/connect';\nimport { IndicesConfigurationActions, IndicesConfigurationStore } from 'stores/indices/IndicesConfigurationStore';\n\nconst useMaxIndexRotationLimit = () => {\n const { retentionStrategiesContext } = useStore(IndicesConfigurationStore);\n const maxRetentionPeriod = retentionStrategiesContext?.max_index_retention_period;\n\n useEffect(() => {\n IndicesConfigurationActions.loadRetentionStrategies();\n }, []);\n\n return maxRetentionPeriod;\n};\n\nexport default useMaxIndexRotationLimit;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport ReactSlider from 'react-slider';\nimport type { ReactSliderProps } from 'react-slider';\nimport styled, { css } from 'styled-components';\n\nimport { Input, Tooltip } from 'components/bootstrap';\nimport OverlayTrigger from 'components/common/OverlayTrigger';\n\ntype Props = {\n id: string,\n label?: string,\n help?: string | React.ReactElement,\n error?: string,\n bsStyle?: 'success' | 'warning' | 'error',\n labelClassName?: string\n wrapperClassName?: string,\n} & ReactSliderProps | number>;\n\nconst StyledSlider = styled(ReactSlider)(({ theme }) => css`\n width: 100%;\n height: 10px;\n margin: ${theme.spacings.md} 0;\n`);\n\nconst StyledThumb = styled.div(({ theme }) => css`\n height: auto;\n min-height: 25px;\n line-height: 25px;\n width: auto;\n min-width: 25px;\n text-align: center;\n background-color: #5082bc;\n color: ${theme.colors.input.color};\n border-radius: 50%;\n cursor: grab;\n top: -5px;\n`);\n\nconst Thumb = (props, state) => {\n const tooltip = {state.valueNow} ;\n\n return (\n \n \n {state.valueNow}\n \n \n );\n};\n\nconst StyledTrack = styled.div(({ theme }) => css`\n top: ${theme.spacings.xxs};\n bottom: 0;\n background: ${(props: any) => (props.index === 1 ? '#5082bc' : theme.colors.variant.default)};\n border-radius: 999px;\n`);\n\nconst Track = (props, state) => ;\n\nconst RangeInput = ({\n id,\n label,\n help,\n error,\n bsStyle,\n labelClassName,\n wrapperClassName,\n ...otherProps\n}: Props) => (\n \n \n \n);\n\nRangeInput.defaultProps = {\n label: undefined,\n help: undefined,\n error: undefined,\n bsStyle: undefined,\n labelClassName: undefined,\n wrapperClassName: undefined,\n};\n\nexport default RangeInput;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { useEffect } from 'react';\n\nimport { useStore } from 'stores/connect';\nimport { IndicesConfigurationActions, IndicesConfigurationStore } from 'stores/indices/IndicesConfigurationStore';\n\nconst useTimeSizeOptimizingFixedLeeway = () => {\n const { rotationStrategiesContext } = useStore(IndicesConfigurationStore);\n const maxTimeSizeOptimizingFixedLeeway = rotationStrategiesContext?.time_size_optimizing_retention_fixed_leeway;\n\n useEffect(() => {\n IndicesConfigurationActions.loadRotationStrategies();\n }, []);\n\n return maxTimeSizeOptimizingFixedLeeway;\n};\n\nexport default useTimeSizeOptimizingFixedLeeway;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\n\nimport useMaxIndexRotationLimit from 'hooks/useMaxIndexRotationLimit';\nimport RangeInput from 'components/common/RangeInput';\nimport useTimeSizeOptimizingFixedLeeway from 'hooks/useTimeSizeOptimizingFixedLeeway';\n\nexport type TimeBasedSizeOptimizingStrategyConfig = {\n index_lifetime_max: string,\n index_lifetime_min: string,\n type: string,\n}\n\ntype Props = {\n config: TimeBasedSizeOptimizingStrategyConfig,\n updateConfig: (config: Omit) => void,\n}\n\nexport const durationToRoundedDays = (duration: string) => Math.round(moment.duration(duration).asDays());\n\nconst getInitialRangeInDays = (indexLifeTimeMin, IndexLifeTimeMax, timeSizeOptimizingFixedLeeway) => (\n timeSizeOptimizingFixedLeeway\n ? [durationToRoundedDays(indexLifeTimeMin), durationToRoundedDays(indexLifeTimeMin) + durationToRoundedDays(timeSizeOptimizingFixedLeeway)]\n : [durationToRoundedDays(indexLifeTimeMin), durationToRoundedDays(IndexLifeTimeMax)]\n);\n\nconst YEAR_IN_DAYS = 365;\n\nconst getMaxRange = (maxRotationPeriod: number, maxLifetime: number, timeSizeOptimizingFixedLeeway: number | null) => {\n if (maxRotationPeriod) {\n return timeSizeOptimizingFixedLeeway ? maxRotationPeriod - timeSizeOptimizingFixedLeeway : maxRotationPeriod;\n }\n\n return maxLifetime >= YEAR_IN_DAYS ? maxLifetime + YEAR_IN_DAYS : YEAR_IN_DAYS;\n};\n\nconst durationToISOString = (days: number) => moment.duration(days, 'days').toISOString();\n\nconst TimeBasedSizeOptimizingStrategyConfiguration = ({\n config: { index_lifetime_max, index_lifetime_min },\n updateConfig,\n}: Props) => {\n const timeSizeOptimizingFixedLeeway = useTimeSizeOptimizingFixedLeeway();\n const [indexLifetimeRange, setIndexLifetimeRange] = useState(getInitialRangeInDays(index_lifetime_min, index_lifetime_max, timeSizeOptimizingFixedLeeway));\n const maxRotationPeriod = useMaxIndexRotationLimit();\n const [maxRange, setMaxRange] = useState(getMaxRange(durationToRoundedDays(maxRotationPeriod), indexLifetimeRange[1], durationToRoundedDays(timeSizeOptimizingFixedLeeway)));\n\n const isValidRange = useCallback((range: Array) => range[0] < range[1] && range[1] <= maxRange, [maxRange]);\n\n const validationState = (range: Array): null | 'error' => {\n if (isValidRange(range)) {\n return null;\n }\n\n return 'error';\n };\n\n const errorMessage = 'There needs to be at least 1 day between the minimum and maximum lifetime.';\n\n const addYearToMaxRange = (currentMax: number, currentSelectedMax: number) => {\n if (!maxRotationPeriod && currentMax <= currentSelectedMax) {\n setMaxRange(currentMax + YEAR_IN_DAYS);\n }\n };\n\n const onRangeChange = (range: Array | number) => {\n const currentRange = Array.isArray(range) ? range : [range, range + durationToRoundedDays(timeSizeOptimizingFixedLeeway)];\n setIndexLifetimeRange(currentRange);\n addYearToMaxRange(maxRange, currentRange[1]);\n\n if (isValidRange(currentRange)) {\n updateConfig({\n index_lifetime_min: durationToISOString(currentRange[0]),\n index_lifetime_max: durationToISOString(currentRange[1]),\n });\n }\n };\n\n const maxRotationPeriodHelpText = maxRotationPeriod ? ` The max rotation period is set to ${durationToRoundedDays(maxRotationPeriod)} days by the Administrator.` : '';\n const rangeHelpTitle = timeSizeOptimizingFixedLeeway ? 'minimum' : 'minimum / maximum';\n const fixedLeewayHint = timeSizeOptimizingFixedLeeway ? ` The maximum number of days is ${durationToISOString(indexLifetimeRange[1])} because the fixed number of days between min and max is set to ${timeSizeOptimizingFixedLeeway}.` : '';\n\n return (\n \n onRangeChange(value)} />\n \n );\n};\n\nTimeBasedSizeOptimizingStrategyConfiguration.propTypes = {\n config: PropTypes.object.isRequired,\n updateConfig: PropTypes.func.isRequired,\n};\n\nexport default TimeBasedSizeOptimizingStrategyConfiguration;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Pluralize } from 'components/common';\n\nimport type { TimeBasedSizeOptimizingStrategyConfig } from './TimeBasedSizeOptimizingStrategyConfiguration';\nimport { durationToRoundedDays } from './TimeBasedSizeOptimizingStrategyConfiguration';\n\nconst TimeBasedSizeOptimizingStrategySummary = ({ config: { index_lifetime_max, index_lifetime_min } }: {config: TimeBasedSizeOptimizingStrategyConfig}) => {\n const minLifetimeAsDays = durationToRoundedDays(index_lifetime_min);\n const maxLifetimeAsDays = durationToRoundedDays(index_lifetime_max);\n\n return (\n \n \n - Index rotation strategy:
\n - Index Time Size Optimizing
\n - Minimum lifetime:
\n - {index_lifetime_min} ({minLifetimeAsDays}
) \n - Maximum lifetime:
\n - {index_lifetime_max} ({maxLifetimeAsDays}
) \n
\n \n );\n};\n\nTimeBasedSizeOptimizingStrategySummary.propTypes = {\n config: PropTypes.object.isRequired,\n};\n\nexport default TimeBasedSizeOptimizingStrategySummary;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport { PluginManifest, PluginStore } from 'graylog-web-plugin/plugin';\n\nimport MessageCountRotationStrategyConfiguration from './MessageCountRotationStrategyConfiguration';\nimport MessageCountRotationStrategySummary from './MessageCountRotationStrategySummary';\nimport SizeBasedRotationStrategyConfiguration from './SizeBasedRotationStrategyConfiguration';\nimport SizeBasedRotationStrategySummary from './SizeBasedRotationStrategySummary';\nimport TimeBasedRotationStrategyConfiguration from './TimeBasedRotationStrategyConfiguration';\nimport TimeBasedRotationStrategySummary from './TimeBasedRotationStrategySummary';\nimport TimeBasedSizeOptimizingStrategyConfiguration from './TimeBasedSizeOptimizingStrategyConfiguration';\nimport TimeBasedSizeOptimizingStrategySummary from './TimeBasedSizeOptimizingStrategySummary';\n\nPluginStore.register(new PluginManifest({}, {\n indexRotationConfig: [\n {\n type: 'org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy',\n displayName: 'Index Message Count',\n configComponent: MessageCountRotationStrategyConfiguration,\n summaryComponent: MessageCountRotationStrategySummary,\n },\n {\n type: 'org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategy',\n displayName: 'Index Size',\n configComponent: SizeBasedRotationStrategyConfiguration,\n summaryComponent: SizeBasedRotationStrategySummary,\n },\n {\n type: 'org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategy',\n displayName: 'Index Time',\n configComponent: TimeBasedRotationStrategyConfiguration,\n summaryComponent: TimeBasedRotationStrategySummary,\n },\n {\n type: 'org.graylog2.indexer.rotation.strategies.TimeBasedSizeOptimizingStrategy',\n displayName: 'Index Time Size Optimizing',\n configComponent: TimeBasedSizeOptimizingStrategyConfiguration,\n summaryComponent: TimeBasedSizeOptimizingStrategySummary,\n },\n ],\n}));\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport Reflux from 'reflux';\n\nimport type {\n IndicesConfigurationActionsType,\n IndicesConfigurationStoreState,\n RetentionStrategyResponse,\n RotationStrategyResponse,\n} from 'components/indices/Types';\nimport UserNotification from 'util/UserNotification';\nimport * as URLUtils from 'util/URLUtils';\nimport fetch from 'logic/rest/FetchProvider';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const IndicesConfigurationActions = singletonActions(\n 'core.IndicesConfiguration',\n () => Reflux.createActions({\n loadRotationStrategies: { asyncResult: true },\n loadRetentionStrategies: { asyncResult: true },\n }),\n);\n\nconst urlPrefix = '/system/indices';\n\nexport const IndicesConfigurationStore = singletonStore(\n 'core.IndicesConfiguration',\n () => Reflux.createStore({\n listenables: [IndicesConfigurationActions],\n\n rotationStrategies: undefined,\n retentionStrategies: undefined,\n retentionStrategiesContext: undefined,\n rotationStrategiesContext: undefined,\n\n getInitialState() {\n return {\n activeRotationConfig: undefined,\n rotationStrategies: undefined,\n activeRetentionConfig: undefined,\n retentionStrategies: undefined,\n retentionStrategiesContext: undefined,\n };\n },\n getState() {\n return {\n activeRotationConfig: this.activeRotationConfig,\n rotationStrategies: this.rotationStrategies,\n activeRetentionConfig: this.activeRetentionConfig,\n retentionStrategies: this.retentionStrategies,\n retentionStrategiesContext: this.retentionStrategiesContext,\n rotationStrategiesContext: this.rotationStrategiesContext,\n };\n },\n _url(path) {\n return URLUtils.qualifyUrl(urlPrefix + path);\n },\n\n loadRotationStrategies() {\n const promise = fetch('GET', this._url('/rotation/strategies'));\n\n promise.then(\n (response: RotationStrategyResponse) => {\n this.rotationStrategies = response.strategies;\n\n this.rotationStrategiesContext = response.context;\n this.trigger(this.getState());\n },\n (error) => {\n UserNotification.error(`Fetching rotation strategies failed: ${error}`, 'Could not retrieve rotation strategies');\n },\n );\n\n IndicesConfigurationActions.loadRotationStrategies.promise(promise);\n },\n\n loadRetentionStrategies() {\n const promise = fetch('GET', this._url('/retention/strategies'));\n\n promise.then(\n (response: RetentionStrategyResponse) => {\n this.retentionStrategiesContext = response.context;\n this.retentionStrategies = response.strategies;\n this.trigger(this.getState());\n },\n (error) => {\n UserNotification.error(`Fetching retention strategies failed: ${error}`, 'Could not retrieve retention strategies');\n },\n );\n\n IndicesConfigurationActions.loadRetentionStrategies.promise(promise);\n },\n }),\n);\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport Reflux from 'reflux';\n\nimport { qualifyUrl } from 'util/URLUtils';\nimport ApiRoutes from 'routing/ApiRoutes';\nimport fetch, { fetchPeriodically } from 'logic/rest/FetchProvider';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const TIME_BASED_ROTATION_STRATEGY = 'org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategy';\nexport const NOOP_RETENTION_STRATEGY = 'org.graylog2.indexer.retention.strategies.NoopRetentionStrategy';\nexport const TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY = 'org.graylog2.indexer.rotation.strategies.TimeBasedSizeOptimizingStrategy';\nexport const ARCHIVE_RETENTION_STRATEGY = 'org.graylog.plugins.archive.indexer.retention.strategies.ArchiveRetentionStrategy';\nexport const TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY_TYPE = 'org.graylog2.indexer.rotation.strategies.TimeBasedSizeOptimizingStrategyConfig';\nexport const RETENTION = 'retention';\n\nexport type IndexTimeAndTotalStats = {\n total: number,\n time_seconds: number,\n};\n\nexport type IndexShardRouting = {\n id: number,\n state: string,\n active: boolean,\n primary: boolean,\n node_id: string,\n node_name: string,\n node_hostname: string,\n relocating_to: string | null,\n};\n\nexport type IndexInfo = {\n index_name: string,\n primary_shards: {\n flush: IndexTimeAndTotalStats,\n get: IndexTimeAndTotalStats,\n index: IndexTimeAndTotalStats,\n merge: IndexTimeAndTotalStats,\n refresh: IndexTimeAndTotalStats,\n search_query: IndexTimeAndTotalStats,\n search_fetch: IndexTimeAndTotalStats,\n open_search_contexts: number,\n store_size_bytes: number,\n segments: number,\n documents: {\n count: number,\n deleted: number,\n },\n },\n all_shards: {\n flush: IndexTimeAndTotalStats,\n get: IndexTimeAndTotalStats,\n index: IndexTimeAndTotalStats,\n merge: IndexTimeAndTotalStats,\n refresh: IndexTimeAndTotalStats,\n search_query: IndexTimeAndTotalStats,\n search_fetch: IndexTimeAndTotalStats,\n open_search_contexts: number,\n store_size_bytes: number,\n segments: number,\n documents: {\n count: number,\n deleted: number,\n },\n },\n routing: Array,\n reopened: boolean,\n};\n\nexport type Indices = Array\n\ntype IndicesListResponse = {\n all: {\n indices: Indices,\n },\n closed: {\n indices: Indices,\n },\n};\n\ntype IndicesActionsType = {\n list: (indexSetId: string) => Promise,\n listAll: () => Promise,\n close: (indexName: string) => Promise,\n delete: (indexName: string) => Promise,\n multiple: () => Promise,\n reopen: () => Promise,\n subscribe: (indexName: string) => Promise,\n unsubscribe: (indexName: string) => Promise,\n}\nexport const IndicesActions = singletonActions(\n 'core.Indices',\n () => Reflux.createActions({\n list: { asyncResult: true },\n listAll: { asyncResult: true },\n close: { asyncResult: true },\n delete: { asyncResult: true },\n multiple: { asyncResult: true },\n reopen: { asyncResult: true },\n subscribe: { asyncResult: false },\n unsubscribe: { asyncResult: false },\n }),\n);\nexport const IndicesStore = singletonStore(\n 'core.Indices',\n () => Reflux.createStore({\n listenables: [IndicesActions],\n indices: undefined,\n closedIndices: undefined,\n registrations: {},\n\n getInitialState() {\n return { indices: this.indices, closedIndices: this.closedIndices };\n },\n\n list(indexSetId: string) {\n const urlList = qualifyUrl(ApiRoutes.IndicesApiController.list(indexSetId).url);\n const promise = fetch('GET', urlList).then((response: IndicesListResponse) => {\n this.indices = response.all.indices;\n this.closedIndices = response.closed.indices;\n this.trigger({ indices: this.indices, closedIndices: this.closedIndices });\n\n return { indices: this.indices, closedIndices: this.closedIndices };\n });\n\n IndicesActions.list.promise(promise);\n },\n\n listAll() {\n const urlList = qualifyUrl(ApiRoutes.IndicesApiController.listAll().url);\n const promise = fetch('GET', urlList).then((response: IndicesListResponse) => {\n this.indices = response.all.indices;\n this.closedIndices = response.closed.indices;\n this.trigger({ indices: this.indices, closedIndices: this.closedIndices });\n\n return { indices: this.indices, closedIndices: this.closedIndices };\n });\n\n IndicesActions.listAll.promise(promise);\n },\n\n multiple() {\n const indexNames = Object.keys(this.registrations);\n\n if (!indexNames.length) {\n return;\n }\n\n const urlList = qualifyUrl(ApiRoutes.IndicesApiController.multiple().url);\n const request = { indices: indexNames };\n const promise = fetchPeriodically('POST', urlList, request).then((response: Indices) => {\n this.indices = [...this.indices, ...response];\n this.trigger({ indices: this.indices, closedIndices: this.closedIndices });\n\n return { indices: this.indices, closedIndices: this.closedIndices };\n });\n\n IndicesActions.multiple.promise(promise);\n },\n close(indexName: string) {\n const url = qualifyUrl(ApiRoutes.IndicesApiController.close(indexName).url);\n const promise = fetch('POST', url);\n\n IndicesActions.close.promise(promise);\n },\n delete(indexName: string) {\n const url = qualifyUrl(ApiRoutes.IndicesApiController.delete(indexName).url);\n const promise = fetch('DELETE', url);\n\n IndicesActions.delete.promise(promise);\n },\n reopen(indexName: string) {\n const url = qualifyUrl(ApiRoutes.IndicesApiController.reopen(indexName).url);\n const promise = fetch('POST', url);\n\n IndicesActions.reopen.promise(promise);\n },\n subscribe(indexName: string) {\n this.registrations[indexName] = this.registrations[indexName] ? this.registrations[indexName] + 1 : 1;\n },\n unsubscribe(indexName: string) {\n this.registrations[indexName] = this.registrations[indexName] > 0 ? this.registrations[indexName] - 1 : 0;\n\n if (this.registrations[indexName] === 0) {\n delete this.registrations[indexName];\n }\n },\n }),\n);\n"],"names":["hasRetentionConfigField","configData","field","StyledH3","StyledSelect","StyledAlert","getStrategyJsonSchema","selectedStrategy","strategies","result","s","getDefaultStrategyConfig","getTimeBaseStrategyWithElasticLimit","activeConfig","timeBasedStrategy","getStrategyConfig","configTypeName","activeStrategy","getConfigurationComponent","pluginExports","strategy","config","onConfigUpdate","useMaxNumberOfIndices","strategyPlugin","exportedStrategy","strategyType","componentProps","element","IndexMaintenanceStrategiesConfiguration","title","name","description","selectPlaceholder","maxRetentionPeriod","getState","newStrategy","setNewStrategy","setValues","values","rotationStrategy","rotationStrategyClass","retentionStrategyClass","maxNumberOfIndices","setMaxNumberOfIndices","retentionIsNotNoop","isArchiveRetention","shouldShowMaxRetentionWarning","isTimeBasedSizeOptimizing","shouldShowTimeBasedSizeOptimizingForm","shouldShowNormalRetentionForm","helpText","_onSelect","newConfig","_onConfigUpdate","configuration","data","copy","_onIndexTimeSizeOptimizingUpdate","getAvailableSelectOptions","availableStrategies","pluginOptions","type","availableStrategy","c","getDisplayName","getActiveSelection","shouldShowInvalidRetentionWarning","IndexMaintenanceStrategiesSummary","IndexRetentionContext","useIndexRetention","context","children","value","DeletionRetentionStrategyConfiguration","updateConfig","_onInputUpdate","e","update","DeletionRetentionStrategySummary","ClosingRetentionStrategyConfiguration","ClosingRetentionStrategySummary","MessageCountRotationStrategyConfiguration","max_docs_per_index","maxDocsPerIndex","setMaxDocsPerIndex","MessageCountRotationStrategySummary","SizeBasedRotationStrategyConfiguration","max_size","maxSize","setMaxSize","_formatSize","NumberUtils","SizeBasedRotationStrategySummary","_validationLimit","durationInMilliseconds","rotationLimit","TimeBasedRotationStrategyConfiguration","props","period","rotateEmptyIndexSet","duration","rotationPeriod","check","checkInMilliseconds","maxRotationPeriodErrorMessage","maxRotationPeriodHelpText","rotationPeriodRef","rotateEmptyIndexSetRef","TimeBasedRotationStrategySummary","retentionStrategiesContext","IndicesConfigurationStore","StyledSlider","ReactSlider","theme","StyledThumb","Thumb","state","tooltip","OverlayTrigger","StyledTrack","Track","RangeInput","id","label","help","error","bsStyle","labelClassName","wrapperClassName","otherProps","rotationStrategiesContext","maxTimeSizeOptimizingFixedLeeway","durationToRoundedDays","getInitialRangeInDays","indexLifeTimeMin","IndexLifeTimeMax","timeSizeOptimizingFixedLeeway","YEAR_IN_DAYS","getMaxRange","maxRotationPeriod","maxLifetime","durationToISOString","days","TimeBasedSizeOptimizingStrategyConfiguration","index_lifetime_max","index_lifetime_min","indexLifetimeRange","setIndexLifetimeRange","maxRange","setMaxRange","isValidRange","range","validationState","errorMessage","addYearToMaxRange","currentMax","currentSelectedMax","onRangeChange","currentRange","rangeHelpTitle","fixedLeewayHint","TimeBasedSizeOptimizingStrategySummary","minLifetimeAsDays","maxLifetimeAsDays","IndicesConfigurationActions","urlPrefix","path","promise","response","TIME_BASED_ROTATION_STRATEGY","NOOP_RETENTION_STRATEGY","TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY","ARCHIVE_RETENTION_STRATEGY","TIME_BASED_SIZE_OPTIMIZING_ROTATION_STRATEGY_TYPE","RETENTION","IndicesActions","IndicesStore","indexSetId","urlList","indexNames","request","indexName","url"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy