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,KAAO,OAAO,aAAa,MAC5C,gBAAC,SAAM,CAAC,QAAQ,QAAO,eAAa,CACtC,GAEZ,gBAAC,YAAK,iJAEJ,gBAAC,SAAG,EAAE,8BACsB,IAC5B,gBAAC,KAAE,KAAK,mCAAmC,OAAO,SAAS,IAAI,uBAAsB,yBAAuB,EAAI,GAClH,CACF,EACA,gBAAC,KAAgB,YAAAV,EACA,cAAe,KAAK,aACpB,cAAe,KAAK,gBACpB,gBAAAwB,EACA,iBAAAlB,EACA,YAAaF,EACb,iBAAAM,EACA,KAAI,GACJ,OAAQ,KAAK,QAAS,CACzC,CACF,CAEJ,CACF,CAAC,EAED,KAAe,KAAWhB,CAAmB,C,0EC/L7C,QANiD+B,GAAgGC,GAAU,CACzJ,MAAM/B,KAAS,aAAU,EAEzB,OAAO,gBAAC8B,EAAA,CAAW,GAAGC,EAAgB,OAAA/B,CAAA,CAAgB,CACxD,C","sources":["webpack://graylog-web-interface/./src/pages/EditContentPackPage.jsx","webpack://graylog-web-interface/./src/routing/withParams.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 React from 'react';\nimport PropTypes from 'prop-types';\nimport Reflux from 'reflux';\n// eslint-disable-next-line no-restricted-imports\nimport createReactClass from 'create-react-class';\nimport cloneDeep from 'lodash/cloneDeep';\nimport groupBy from 'lodash/groupBy';\n\nimport { LinkContainer } from 'components/common/router';\nimport Routes from 'routing/Routes';\nimport { Button } from 'components/bootstrap';\nimport UserNotification from 'util/UserNotification';\nimport { DocumentTitle, PageHeader } from 'components/common';\nimport ValueReferenceData from 'util/ValueReferenceData';\nimport ContentPackEdit from 'components/content-packs/ContentPackEdit';\nimport Entity from 'logic/content-packs/Entity';\nimport withParams from 'routing/withParams';\nimport { CatalogActions, CatalogStore } from 'stores/content-packs/CatalogStore';\nimport { ContentPacksActions, ContentPacksStore } from 'stores/content-packs/ContentPacksStore';\n\nconst EditContentPackPage = createReactClass({\n // eslint-disable-next-line react/no-unused-class-component-methods\n displayName: 'EditContentPackPage',\n\n // eslint-disable-next-line react/no-unused-class-component-methods\n propTypes: {\n history: PropTypes.object.isRequired,\n params: PropTypes.object.isRequired,\n },\n\n mixins: [Reflux.connect(CatalogStore), Reflux.connect(ContentPacksStore)],\n\n getInitialState() {\n return {\n selectedEntities: {},\n contentPackEntities: undefined,\n appliedParameter: {},\n entityCatalog: {},\n };\n },\n\n componentDidMount() {\n const { params } = this.props;\n\n ContentPacksActions.get(params.contentPackId).then((result) => {\n const { contentPackRevisions } = result;\n const originContentPackRev = params.contentPackRev;\n const newContentPack = contentPackRevisions.createNewVersionFromRev(originContentPackRev);\n\n this.setState({ contentPack: newContentPack, contentPackEntities: cloneDeep(newContentPack.entities) });\n\n CatalogActions.showEntityIndex().then(() => {\n this._createEntityCatalog();\n this._getSelectedEntities();\n this._getAppliedParameter();\n });\n });\n },\n\n _createEntityCatalog() {\n const { contentPack, contentPackEntities, entityIndex } = this.state;\n\n if (!contentPack || !entityIndex) {\n return;\n }\n\n const groupedContentPackEntities = groupBy(contentPackEntities, 'type.name');\n const entityCatalog = Object.keys(entityIndex)\n .reduce((result, entityType) => {\n /* eslint-disable-next-line no-param-reassign */\n result[entityType] = entityIndex[entityType].concat(groupedContentPackEntities[entityType] || []);\n\n return result;\n }, {});\n\n this.setState({ entityCatalog });\n },\n\n _getSelectedEntities() {\n const { contentPack, entityCatalog, entityIndex } = this.state;\n\n if (!contentPack || !entityIndex) {\n return;\n }\n\n const selectedEntities = contentPack.entities.reduce((result, entity) => {\n if (entityCatalog[entity.type.name]\n && entityCatalog[entity.type.name].findIndex((fetchedEntity) => fetchedEntity.id === entity.id) >= 0) {\n const newResult = result;\n\n newResult[entity.type.name] = result[entity.type.name] || [];\n newResult[entity.type.name].push(entity);\n\n return newResult;\n }\n\n return result;\n }, {});\n\n this.setState({ selectedEntities: selectedEntities });\n },\n\n _getAppliedParameter() {\n const { contentPack } = this.state;\n\n const appliedParameter = contentPack.entities.reduce((result, entity) => {\n const entityData = new ValueReferenceData(entity.data);\n const configPaths = entityData.getPaths();\n\n const paramMap = Object.keys(configPaths).filter((path) => configPaths[path].isValueParameter()).map((path) => ({ configKey: path, paramName: configPaths[path].getValue(), readOnly: true }));\n const newResult = result;\n\n if (paramMap.length > 0) {\n newResult[entity.id] = paramMap;\n }\n\n return newResult;\n }, {});\n\n this.setState({ appliedParameter: appliedParameter });\n },\n\n _onStateChanged(newState) {\n const { contentPack, selectedEntities, appliedParameter } = this.state;\n\n this.setState({\n contentPack: newState.contentPack || contentPack,\n selectedEntities: newState.selectedEntities || selectedEntities,\n appliedParameter: newState.appliedParameter || appliedParameter,\n });\n },\n\n _onSave() {\n const { contentPack } = this.state;\n const { history } = this.props;\n\n ContentPacksActions.create.triggerPromise(contentPack.toJSON())\n .then(\n () => {\n UserNotification.success('Content pack imported successfully', 'Success!');\n history.push(Routes.SYSTEM.CONTENTPACKS.LIST);\n },\n (response) => {\n const message = 'Error importing content pack, please ensure it is a valid JSON file. Check your '\n + 'Graylog logs for more information.';\n const title = 'Could not import content pack';\n let smallMessage = '';\n\n if (response.additional && response.additional.body && response.additional.body.message) {\n smallMessage = `
${response.additional.body.message}`;\n }\n\n UserNotification.error(message + smallMessage, title);\n },\n );\n },\n\n _getEntities(selectedEntities) {\n const { contentPack } = this.state;\n\n CatalogActions.getSelectedEntities(selectedEntities).then((result) => {\n const contentPackEntities = Object.keys(selectedEntities)\n .reduce((acc, entityType) => acc.concat(selectedEntities[entityType]), []).filter((e) => e instanceof Entity);\n /* Mark entities from server */\n const entities = contentPackEntities.concat(result.entities.map((e) => Entity.fromJSON(e, true)));\n const builtContentPack = contentPack.toBuilder()\n .entities(entities)\n .build();\n\n this.setState({ contentPack: builtContentPack, fetchedEntities: builtContentPack.entities });\n });\n },\n\n render() {\n const { contentPack, fetchedEntities, selectedEntities, entityCatalog, appliedParameter } = this.state;\n\n return (\n \n \n \n \n \n )}>\n \n Content packs accelerate the set up process for a specific data source. A content pack can include inputs/extractors, streams, and dashboards.\n
\n Find more content packs in {' '}\n the Graylog Marketplace.\n \n \n \n \n \n );\n },\n});\n\nexport default withParams(EditContentPackPage);\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 { useParams } from 'react-router-dom';\nimport type { Subtract } from 'utility-types';\n\ntype ParamsContext = {\n params: {\n [key: string]: string | null | undefined;\n };\n};\n\nconst withParams = (Component: React.ComponentType): React.ComponentType> => (props) => {\n const params = useParams();\n\n return ;\n};\n\nexport default withParams;\n"],"names":["EditContentPackPage","params","result","contentPackRevisions","originContentPackRev","newContentPack","contentPack","contentPackEntities","entityIndex","groupedContentPackEntities","entityCatalog","entityType","selectedEntities","entity","fetchedEntity","newResult","appliedParameter","configPaths","paramMap","path","newState","history","response","message","title","smallMessage","entities","acc","e","builtContentPack","fetchedEntities","Component","props"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy