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,oBAC3C,2BAA4BA,EAAsB,0BACpD,EACF,C","sources":["webpack://graylog-web-interface/./src/pages/useIndexDefaults.ts","webpack://graylog-web-interface/./src/pages/IndexSetCreationPage.tsx"],"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 { useQuery } from '@tanstack/react-query';\n\nimport UserNotification from 'util/UserNotification';\nimport fetch from 'logic/rest/FetchProvider';\nimport { qualifyUrl } from 'util/URLUtils';\nimport ApiRoutes from 'routing/ApiRoutes';\nimport type { IndexConfig } from 'components/configurations/IndexSetsDefaultsConfig';\n\nconst fetchIndexDefaults: () => Promise = () => fetch('GET', qualifyUrl(`${ApiRoutes.ClusterConfigResource.config().url}/org.graylog2.configuration.IndexSetsDefaultConfiguration`));\n\nconst useIndexDefaults = () => {\n const { data, isLoading } = useQuery(\n ['index-defaults'],\n fetchIndexDefaults,\n {\n onError: (fetchError: Error) => {\n UserNotification.error(`Error fetching index defaults: ${fetchError.message}`);\n },\n retry: 1,\n },\n );\n\n return {\n loadingIndexDefaultsConfig: isLoading,\n indexDefaultsConfig: data,\n };\n};\n\nexport default useIndexDefaults;\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, { useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\n\nimport { LinkContainer } from 'components/common/router';\nimport { Row, Col, Button } from 'components/bootstrap';\nimport { DocumentTitle, PageHeader, Spinner } from 'components/common';\nimport { IndexSetConfigurationForm } from 'components/indices';\nimport DocsHelper from 'util/DocsHelper';\nimport Routes from 'routing/Routes';\nimport connect from 'stores/connect';\nimport { IndexSetsActions, IndexSetsStore } from 'stores/indices/IndexSetsStore';\nimport type { IndexSet } from 'stores/indices/IndexSetsStore';\nimport { IndicesConfigurationActions, IndicesConfigurationStore } from 'stores/indices/IndicesConfigurationStore';\nimport {\n RetentionStrategyPropType,\n RotationStrategyPropType,\n} from 'components/indices/Types';\nimport type {\n RetentionStrategy, RotationStrategy, RetentionStrategyContext,\n RetentionStrategyConfig,\n RotationStrategyConfig,\n} from 'components/indices/Types';\nimport { adjustFormat } from 'util/DateTime';\nimport useIndexDefaults from 'pages/useIndexDefaults';\nimport useHistory from 'routing/useHistory';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\n\ntype Props = {\n retentionStrategies?: Array | null | undefined,\n rotationStrategies?: Array | null | undefined,\n retentionStrategiesContext?: RetentionStrategyContext | null | undefined,\n}\n\nconst IndexSetCreationPage = ({ retentionStrategies, rotationStrategies, retentionStrategiesContext }: Props) => {\n const history = useHistory();\n const sendTelemetry = useSendTelemetry();\n\n useEffect(() => {\n IndicesConfigurationActions.loadRotationStrategies();\n IndicesConfigurationActions.loadRetentionStrategies();\n }, []);\n\n const _saveConfiguration = (indexSetItem: IndexSet) => {\n sendTelemetry(TELEMETRY_EVENT_TYPE.INDICES.INDEX_SET_CREATED, {\n app_pathname: 'indexsets',\n });\n\n const copy = indexSetItem;\n\n copy.creation_date = adjustFormat(new Date(), 'internal');\n\n return IndexSetsActions.create(copy).then(() => {\n history.push(Routes.SYSTEM.INDICES.LIST);\n });\n };\n\n const { loadingIndexDefaultsConfig, indexDefaultsConfig: config } = useIndexDefaults();\n\n const _isLoading = () => !rotationStrategies || !retentionStrategies || loadingIndexDefaultsConfig;\n\n if (_isLoading()) {\n return ;\n }\n\n const indexSet: IndexSet = {\n title: '',\n description: '',\n index_prefix: config.index_prefix,\n writable: true,\n can_be_default: true,\n shards: config.shards,\n replicas: config.replicas,\n rotation_strategy_class: config.rotation_strategy_class,\n rotation_strategy: config.rotation_strategy_config as RotationStrategyConfig,\n retention_strategy_class: config.retention_strategy_class,\n retention_strategy: config.retention_strategy_config as RetentionStrategyConfig,\n index_analyzer: config.index_analyzer,\n index_optimization_max_num_segments: config.index_optimization_max_num_segments,\n index_optimization_disabled: config.index_optimization_disabled,\n field_type_refresh_interval: moment.duration(config.field_type_refresh_interval, config.field_type_refresh_interval_unit).asMilliseconds(),\n };\n\n return (\n \n \n \n \n \n )}>\n \n Create a new index set that will let you configure the retention, sharding, and replication of messages\n coming from one or more streams.\n \n \n\n \n \n \n \n
\n \n \n );\n};\n\nIndexSetCreationPage.propTypes = {\n retentionStrategies: PropTypes.arrayOf(RetentionStrategyPropType),\n rotationStrategies: PropTypes.arrayOf(RotationStrategyPropType),\n retentionStrategiesContext: PropTypes.shape({\n max_index_retention_period: PropTypes.string,\n }),\n};\n\nIndexSetCreationPage.defaultProps = {\n retentionStrategies: undefined,\n rotationStrategies: undefined,\n retentionStrategiesContext: {\n max_index_retention_period: undefined,\n },\n};\n\nexport default connect(\n IndexSetCreationPage,\n {\n indexSets: IndexSetsStore,\n indicesConfigurations: IndicesConfigurationStore,\n },\n ({ indexSets, indicesConfigurations }) => ({\n indexSet: indexSets.indexSet,\n rotationStrategies: indicesConfigurations.rotationStrategies,\n retentionStrategies: indicesConfigurations.retentionStrategies,\n retentionStrategiesContext: indicesConfigurations.retentionStrategiesContext,\n }),\n);\n"],"names":["fetchIndexDefaults","ApiRoutes","data","isLoading","fetchError","UserNotification","IndexSetCreationPage","retentionStrategies","rotationStrategies","retentionStrategiesContext","history","useHistory","sendTelemetry","useSendTelemetry","_saveConfiguration","indexSetItem","copy","Routes","loadingIndexDefaultsConfig","config","indexSet","DocsHelper","connect","IndexSetsStore","IndicesConfigurationStore","indexSets","indicesConfigurations"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy