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MT,EAAY,UAAU,CAAC,CAAC,EACrF,MAAM,EACHU,EAAkBH,EAAO,SAAS,IAAKE,GAAM,IAAO,SAASA,EAAG,GAAOT,EAAY,UAAU,CAAC,EAEpGL,EAAqBG,IAAS,CAAE,GAAGA,EAAK,YAAaU,EAAgB,gBAAAE,CAAgB,EAAE,CACzF,CAAC,CACH,EAEA,OACE,gBAAC,KAAa,CAAC,MAAM,iBACnB,gBAAC,YACC,gBAAC,MAAW,MAAM,uBACN,WACE,gBAAC,IAAa,CAAC,GAAI,KAAO,OAAO,aAAa,MAC5C,gBAAC,SAAM,CAAC,QAAQ,QAAO,eAAa,CACtC,GAEZ,gBAAC,YAAK,iJAEJ,gBAAC,SAAG,EAAE,8BACsB,IAAI,IAAC,gBAAC,KAAE,KAAK,mCAAmC,OAAO,SAAS,IAAI,uBAAsB,yBAAuB,EAAI,GACnJ,CACF,EACA,gBAAC,KAAgB,YAAahB,EAAiB,YAC9B,cAAeW,EACf,cAAeT,EACf,gBAAiBF,EAAiB,gBAClC,iBAAkBA,EAAiB,iBACnC,iBAAkBA,EAAiB,iBACnC,YAAAD,EACA,OAAQM,CAAA,CAAS,CACpC,CACF,CAEJ,C","sources":["webpack://graylog-web-interface/./src/pages/CreateContentPackPage.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, { useEffect, useState } from 'react';\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 ContentPackEdit from 'components/content-packs/ContentPackEdit';\nimport ContentPack from 'logic/content-packs/ContentPack';\nimport Entity from 'logic/content-packs/Entity';\nimport { CatalogStore, CatalogActions } from 'stores/content-packs/CatalogStore';\nimport { ContentPacksActions } from 'stores/content-packs/ContentPacksStore';\nimport useHistory from 'routing/useHistory';\nimport { useStore } from 'stores/connect';\n\nconst CreateContentPackPage = () => {\n const history = useHistory();\n const { entityIndex } = useStore<{ entityIndex: string | undefined }>(CatalogStore);\n const [contentPackState, setContentPackState] = useState({\n contentPack: ContentPack.builder().build(),\n appliedParameter: {},\n selectedEntities: {},\n fetchedEntities: undefined,\n });\n\n useEffect(() => {\n CatalogActions.showEntityIndex();\n }, []);\n\n const _onStateChanged = (newState: { contentPack: unknown, selectedEntities: unknown, appliedParameter: unknown }) => {\n setContentPackState((cur) => ({\n ...cur,\n contentPack: newState.contentPack || cur.contentPack,\n selectedEntities: newState.selectedEntities || cur.selectedEntities,\n appliedParameter: newState.appliedParameter || cur.appliedParameter,\n }));\n };\n\n const _onSave = () => {\n const { contentPack } = contentPackState;\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 const _getEntities = (selectedEntities: unknown) => {\n const { contentPack } = contentPackState;\n\n CatalogActions.getSelectedEntities(selectedEntities).then((result) => {\n const newContentPack = contentPack.toBuilder()\n /* Mark entities from server */\n .entities(result.entities.map((e) => Entity.fromJSON(e, true, contentPack.parameters)))\n .build();\n const fetchedEntities = result.entities.map((e) => Entity.fromJSON(e, false, contentPack.parameters));\n\n setContentPackState((cur) => ({ ...cur, contentPack: newContentPack, fetchedEntities }));\n });\n };\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 {' '} the Graylog Marketplace.\n \n \n \n \n \n );\n};\n\nexport default CreateContentPackPage;\n"],"names":["history","entityIndex","contentPackState","setContentPackState","_onStateChanged","newState","cur","_onSave","contentPack","response","message","title","smallMessage","_getEntities","selectedEntities","result","newContentPack","e","fetchedEntities"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy