All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.07ba022f-4889.73d6df333beac1cc17a5.js.map Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
{"version":3,"file":"07ba022f-4889.73d6df333beac1cc17a5.js","mappings":"gVAoGA,QA1EyB,IAAiB,CACxC,YAAa,mBAEb,UAAW,CACT,MAAO,WAAiB,UAC1B,EAEA,OAAQ,CAAC,YAAeA,EAAA,CAAe,EAAG,mBAAsB,EAEhE,mBAAoB,CAClB,IAAkB,KAAK,eAAe,KAAK,MAAM,MAAM,EAAE,CAC3D,EAEA,YAAa,CACX,MAAO,CAAC,KAAK,MAAM,UACrB,EAEA,QAAS,CACP,GAAI,KAAK,WAAW,EAClB,OAAO,gBAAC,KAAO,IAAC,EAGlB,MAAMC,EAAyB,CAC7B,WAAY,KAAK,MAAM,WAAW,IAAKC,GAAc,CACnD,MAAMC,EAAO,CAAC,EAId,cAAO,KAAKD,CAAS,EAAE,QAASE,GAAQ,CACtC,OAAQA,EAAK,CACX,IAAK,OAEHD,EAAK,eAAiBD,EAAUE,CAAG,EACnC,MACF,IAAK,KACL,IAAK,UACL,IAAK,kBACL,IAAK,aACL,IAAK,uBACH,MACF,QACED,EAAKC,CAAG,EAAIF,EAAUE,CAAG,CAC7B,CACF,CAAC,EAEMD,CACT,CAAC,EACD,QAASE,EAAA,kBAAuB,CAClC,EAEMC,EAAgB,KAAK,UAAUL,EAAwB,KAAM,CAAC,EAEpE,OACE,gBAAC,MAAG,CAAC,UAAU,WACb,gBAAC,MAAG,CAAC,GAAI,IACP,gBAAC,MAAG,KACF,gBAAC,MAAG,CAAC,GAAI,GACP,gBAAC,UAAG,iBAAe,CACrB,EACA,gBAAC,MAAG,CAAC,GAAI,GACP,gBAAC,KAAe,CAAC,MAAM,kBAAkB,UAAU,aAAa,OAAO,4BAA6B,EACtG,CACF,EACA,gBAAC,MAAG,KACF,gBAAC,MAAG,CAAC,GAAI,IACP,gBAAC,QAAK,CAAC,KAAK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AAOc,GAAU,CAChB,IAAiB,MAAM,8BAA8BA,CAAK,GACxD,8BAA8BnB,EAAU,KAAK,EAAE,CACnD,CAAC,EAEHS,EAAkB,OAAO,QAAQG,CAAO,CAC1C,EAEA,MAAMP,EAASe,EAAmB,CAChC,MAAMH,EAAM,KAAoB,IAAU,qBAAqB,MAAMZ,CAAO,EAAE,GAAG,EAC3EgB,EAAuB,CAAC,EAE9BD,EAAkB,QAAQ,CAACpB,EAAWsB,IAAQ,CAC5CD,EAAqBC,CAAG,EAAItB,EAAU,EACxC,CAAC,EAED,MAAMY,KAAU,MAAM,OAAQK,EAAK,CAAE,MAAOI,CAAqB,CAAC,EAElET,EAAQ,KAAK,IAAM,CACjB,IAAiB,QAAQ,0CAA0C,EAE/D,KAAK,YACPH,EAAkB,KAAK,eAAeJ,CAAO,CAEjD,CAAC,EAEDO,EAAQ,MAAOO,GAAU,CACvB,IAAiB,MAAM,wCAAwCA,CAAK,GAClE,sCAAsC,CAC1C,CAAC,EAEDV,EAAkB,MAAM,QAAQG,CAAO,CACzC,EAEA,OAAOP,EAASkB,EAAY,CAC1B,IAAIC,EAAoB,EACpBC,EAAgB,EACpB,MAAMC,EAAW,CAAC,EAElBH,EAAW,QAASvB,GAAc,CAChC,MAAMY,EAAU,KAAK,uBAAuBP,EAASL,CAAS,EAE9DY,EACG,KAAK,IAAM,CAAEY,GAAqB,CAAG,CAAC,EACtC,MAAM,IAAM,CAAEC,GAAiB,CAAG,CAAC,EAEtCC,EAAS,KAAKd,CAAO,CACvB,CAAC,EAED,QAAQ,WAAWc,CAAQ,EAAE,KAAK,IAAM,CAClCD,IAAkB,EACpB,IAAiB,QAAQ,mBAAmBD,CAAiB,0BAC3D,6BAA6B,EAE/B,IAAiB,QAAQ,mBAAmBA,CAAiB,2BAA2BC,CAAa,aACnG,4BAA4B,CAElC,CAAC,CACH,CACF,CAAC,CACH,C","sources":["webpack://graylog-web-interface/./src/components/extractors/ExportExtractors.jsx","webpack://graylog-web-interface/./src/pages/ExportExtractorsPage.tsx","webpack://graylog-web-interface/./src/stores/extractors/ExtractorsStore.js"],"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 React from 'react';\nimport createReactClass from 'create-react-class';\nimport Reflux from 'reflux';\n\nimport { ClipboardButton, Spinner } from 'components/common';\nimport { Row, Col, Input } from 'components/bootstrap';\nimport Version from 'util/Version';\nimport { ExtractorsActions, ExtractorsStore } from 'stores/extractors/ExtractorsStore';\n\nconst ExportExtractors = createReactClass({\n  displayName: 'ExportExtractors',\n\n  propTypes: {\n    input: PropTypes.object.isRequired,\n  },\n\n  mixins: [Reflux.connect(ExtractorsStore), Reflux.ListenerMethods],\n\n  componentDidMount() {\n    ExtractorsActions.list.triggerPromise(this.props.input.id);\n  },\n\n  _isLoading() {\n    return !this.state.extractors;\n  },\n\n  render() {\n    if (this._isLoading()) {\n      return ;\n    }\n\n    const extractorsExportObject = {\n      extractors: this.state.extractors.map((extractor) => {\n        const copy = {};\n\n        // Create Graylog 1.x compatible export format.\n        // TODO: This should be done on the server.\n        Object.keys(extractor).forEach((key) => {\n          switch (key) {\n            case 'type':\n              // The import expects \"extractor_type\", not \"type\".\n              copy.extractor_type = extractor[key];\n              break;\n            case 'id':\n            case 'metrics':\n            case 'creator_user_id':\n            case 'exceptions':\n            case 'converter_exceptions':\n              break;\n            default:\n              copy[key] = extractor[key];\n          }\n        });\n\n        return copy;\n      }),\n      version: Version.getFullVersion(),\n    };\n\n    const formattedJSON = JSON.stringify(extractorsExportObject, null, 2);\n\n    return (\n      \n        \n          \n            \n              

Extractors JSON

\n \n \n \n \n
\n \n \n \n \n \n \n
\n );\n },\n});\n\nexport default ExportExtractors;\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';\n\nimport { DocumentTitle, PageHeader, Spinner } from 'components/common';\nimport ExportExtractors from 'components/extractors/ExportExtractors';\nimport { InputsActions, InputsStore } from 'stores/inputs/InputsStore';\nimport useParams from 'routing/useParams';\nimport { useStore } from 'stores/connect';\n\nconst ExportExtractorsPage = () => {\n const { inputId } = useParams();\n const { input } = useStore(InputsStore);\n\n useEffect(() => {\n InputsActions.get.triggerPromise(inputId);\n }, [inputId]);\n\n if (!input) {\n return ;\n }\n\n return (\n \n
\n Export extractors of {input.title}}>\n \n The extractors of an input can be exported to JSON for importing into other setups\n or sharing in the Graylog Marketplace.\n \n \n \n
\n
\n );\n};\n\nexport default ExportExtractorsPage;\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 ApiRoutes from 'routing/ApiRoutes';\nimport fetch from 'logic/rest/FetchProvider';\nimport ExtractorUtils from 'util/ExtractorUtils';\nimport * as URLUtils from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const ExtractorsActions = singletonActions(\n 'core.Extractors',\n () => Reflux.createActions({\n list: { asyncResult: true },\n get: { asyncResult: true },\n create: { asyncResult: true },\n save: { asyncResult: true },\n update: { asyncResult: true },\n delete: { asyncResult: true },\n order: { asyncResult: true },\n import: {},\n }),\n);\n\nfunction getExtractorDTO(extractor) {\n const conditionValue = extractor.condition_type && extractor.condition_type !== 'none' ? extractor.condition_value : '';\n\n return {\n title: extractor.title,\n cursor_strategy: extractor.cursor_strategy || 'copy',\n source_field: extractor.source_field,\n target_field: extractor.target_field,\n extractor_type: extractor.type || extractor.extractor_type, // \"extractor_type\" needed for imports\n extractor_config: extractor.extractor_config,\n converters: extractor.converters,\n condition_type: extractor.condition_type || 'none',\n condition_value: conditionValue,\n order: extractor.order,\n };\n}\n\nexport const ExtractorsStore = singletonStore(\n 'core.Extractors',\n () => Reflux.createStore({\n listenables: [ExtractorsActions],\n sourceUrl: '/system/inputs/',\n extractors: undefined,\n extractor: undefined,\n\n init() {\n this.trigger({ extractors: this.extractors, extractor: this.extractor });\n },\n\n list(inputId) {\n const promise = fetch('GET', URLUtils.qualifyUrl(URLUtils.concatURLPath(this.sourceUrl, inputId, 'extractors')));\n\n promise.then((response) => {\n this.extractors = response.extractors;\n this.trigger({ extractors: this.extractors });\n });\n\n ExtractorsActions.list.promise(promise);\n },\n\n // Creates an basic extractor object that we can use to create new extractors.\n new(type, field) {\n if (ExtractorUtils.EXTRACTOR_TYPES.indexOf(type) === -1) {\n throw new Error(`Invalid extractor type provided: ${type}`);\n }\n\n return {\n type: type,\n source_field: field,\n converters: [],\n extractor_config: {},\n target_field: '',\n };\n },\n\n get(inputId, extractorId) {\n const promise = fetch('GET', URLUtils.qualifyUrl(URLUtils.concatURLPath(this.sourceUrl, inputId, 'extractors', extractorId)));\n\n promise.then((response) => {\n this.extractor = response;\n this.trigger({ extractor: this.extractor });\n });\n\n ExtractorsActions.get.promise(promise);\n },\n\n save(inputId, extractor) {\n let promise;\n\n if (extractor.id) {\n promise = this.update(inputId, extractor, true);\n } else {\n promise = this.create(inputId, extractor, true);\n }\n\n ExtractorsActions.save.promise(promise);\n },\n\n _silentExtractorCreate(inputId, extractor) {\n const url = URLUtils.qualifyUrl(ApiRoutes.ExtractorsController.create(inputId).url);\n\n return fetch('POST', url, getExtractorDTO(extractor));\n },\n\n create(inputId, extractor, calledFromMethod) {\n const promise = this._silentExtractorCreate(inputId, extractor);\n\n promise\n .then(() => {\n UserNotification.success(`Extractor ${extractor.title} created successfully`);\n\n if (this.extractor) {\n ExtractorsActions.get.triggerPromise(inputId, extractor.id);\n }\n })\n .catch((error) => {\n UserNotification.error(`Creating extractor failed: ${error}`,\n 'Could not create extractor');\n });\n\n if (!calledFromMethod) {\n ExtractorsActions.create.promise(promise);\n }\n\n return promise;\n },\n\n update(inputId, extractor, calledFromMethod) {\n const url = URLUtils.qualifyUrl(ApiRoutes.ExtractorsController.update(inputId, extractor.id).url);\n\n const promise = fetch('PUT', url, getExtractorDTO(extractor));\n\n promise\n .then(() => {\n UserNotification.success(`Extractor \"${extractor.title}\" updated successfully`);\n\n if (this.extractor) {\n ExtractorsActions.get.triggerPromise(inputId, extractor.id);\n }\n })\n .catch((error) => {\n UserNotification.error(`Updating extractor failed: ${error}`,\n 'Could not update extractor');\n });\n\n if (!calledFromMethod) {\n ExtractorsActions.update.promise(promise);\n }\n\n return promise;\n },\n\n delete(inputId, extractor) {\n const url = URLUtils.qualifyUrl(ApiRoutes.ExtractorsController.delete(inputId, extractor.id).url);\n\n const promise = fetch('DELETE', url);\n\n promise\n .then(() => {\n UserNotification.success(`Extractor \"${extractor.title}\" deleted successfully`);\n\n if (this.extractors) {\n ExtractorsActions.list.triggerPromise(inputId);\n }\n })\n .catch((error) => {\n UserNotification.error(`Deleting extractor failed: ${error}`,\n `Could not delete extractor ${extractor.title}`);\n });\n\n ExtractorsActions.delete.promise(promise);\n },\n\n order(inputId, orderedExtractors) {\n const url = URLUtils.qualifyUrl(ApiRoutes.ExtractorsController.order(inputId).url);\n const orderedExtractorsMap = {};\n\n orderedExtractors.forEach((extractor, idx) => {\n orderedExtractorsMap[idx] = extractor.id;\n });\n\n const promise = fetch('POST', url, { order: orderedExtractorsMap });\n\n promise.then(() => {\n UserNotification.success('Extractor positions updated successfully');\n\n if (this.extractors) {\n ExtractorsActions.list.triggerPromise(inputId);\n }\n });\n\n promise.catch((error) => {\n UserNotification.error(`Changing extractor positions failed: ${error}`,\n 'Could not update extractor positions');\n });\n\n ExtractorsActions.order.promise(promise);\n },\n\n import(inputId, extractors) {\n let successfulImports = 0;\n let failedImports = 0;\n const promises = [];\n\n extractors.forEach((extractor) => {\n const promise = this._silentExtractorCreate(inputId, extractor);\n\n promise\n .then(() => { successfulImports += 1; })\n .catch(() => { failedImports += 1; });\n\n promises.push(promise);\n });\n\n Promise.allSettled(promises).then(() => {\n if (failedImports === 0) {\n UserNotification.success(`Import results: ${successfulImports} extractor(s) imported.`,\n 'Import operation successful');\n } else {\n UserNotification.warning(`Import results: ${successfulImports} extractor(s) imported, ${failedImports} error(s).`,\n 'Import operation completed');\n }\n });\n },\n }),\n);\n"],"names":["ExtractorsStore","extractorsExportObject","extractor","copy","key","Version","formattedJSON","inputId","useParams","input","InputsStore","ExtractorsActions","getExtractorDTO","conditionValue","promise","response","type","field","extractorId","url","calledFromMethod","error","orderedExtractors","orderedExtractorsMap","idx","extractors","successfulImports","failedImports","promises"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy