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

web-interface.assets.325e2d4b-9221.0e1028c9fe67ce6b36ee.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
{"version":3,"file":"325e2d4b-9221.0e1028c9fe67ce6b36ee.js","mappings":"kcAuBA,MAAMA,UAAyBC,EAAAA,UAAgB,sDAKhCC,IACXA,EAAMC,iBAEN,IACE,MAAMC,EAAmBC,KAAKC,MAAMC,KAAKC,gBAAgBC,aACnD,WAAEC,GAAeN,EAEvBO,EAAAA,EAAAA,OAAyBJ,KAAKK,MAAMC,MAAMC,GAAIJ,EAI/C,CAHC,MAAOK,GACPC,EAAAA,EAAAA,MAAwB,yEAAwED,IAC9F,8BACH,IAhB0C,CAmB7CE,SACE,OACE,gBAAC,KAAD,CAAKC,UAAU,WACb,gBAAC,KAAD,CAAKC,GAAI,IACP,gBAAC,KAAD,KACE,gBAAC,KAAD,CAAKA,GAAI,IACP,+CAGJ,gBAAC,KAAD,KACE,gBAAC,KAAD,CAAKA,GAAI,IACP,wBAAMC,SAAUb,KAAKc,WACnB,gBAAC,KAAD,CAAOC,KAAK,WAAWC,IAAMf,IAAsBD,KAAKC,gBAAkBA,CAAvB,EAA2CM,GAAG,4BAA4BU,KAAM,KACnI,gBAAC,KAAD,CAAQF,KAAK,SAASG,QAAQ,WAA9B,+BAOb,E,EAvCGzB,EAAAA,YACe,CACjBa,MAAOa,IAAAA,OAAAA,aAwCX,U,oCCvCA,MAAMC,EAAuBC,IAAiB,CAC5CC,YAAa,uBAEbC,UAAW,CACTC,OAAQL,IAAAA,OAAAA,YAGVM,OAAQ,CAACC,IAAAA,QAAeC,EAAAA,IAExBC,oBACE,MAAM,OAAEJ,GAAWxB,KAAKK,MAExBwB,EAAAA,EAAAA,IAAAA,eAAiCL,EAAOM,SAASC,MAAMzB,GAAUN,KAAKgC,SAAS,CAAE1B,MAAOA,KACzF,EAED2B,aACE,OAAQjC,KAAKkC,MAAM5B,KACpB,EAEDI,SACE,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D,EAAkBE,SAAQ,CAAClC,EAAWmC,KACpCF,EAAqBE,GAAOnC,EAAU5C,EAAtC,IAGF,MAAM6D,GAAUC,EAAAA,EAAAA,IAAM,OAAQS,EAAK,CAAE9B,MAAOoC,IAE5ChB,EAAQrC,MAAK,KACXtB,EAAAA,EAAAA,QAAyB,4CAErBT,KAAKG,YACPC,EAAkBqC,KAAKwC,eAAenD,EACvC,IAGHsC,EAAQc,OAAO1E,IACbC,EAAAA,EAAAA,MAAwB,wCAAuCD,IAC7D,uCADF,IAIFJ,EAAkB4C,MAAMoB,QAAQA,EACjC,EAEDnB,OAAOnB,EAAS3B,GACd,IAAIoF,EAAoB,EACpBC,EAAgB,EACpB,MAAMC,EAAW,GAEjBtF,EAAWkF,SAASlC,IAClB,MAAMiB,EAAUpE,KAAK6E,uBAAuB/C,EAASqB,GAErDiB,EACGrC,MAAK,KAAQwD,GAAqB,CAArB,IACbL,OAAM,KAAQM,GAAiB,CAAjB,IAEjBC,EAASC,KAAKtB,EAAd,IAGFuB,IAAAA,OAAeF,GAAU1D,MAAK,KACN,IAAlByD,EACF/E,EAAAA,EAAAA,QAA0B,mBAAkB8E,2BAC1C,+BAEF9E,EAAAA,EAAAA,QAA0B,mBAAkB8E,4BAA4CC,cACtF,6BACH,GAEJ,K","sources":["webpack://graylog-web-interface/./src/components/extractors/ImportExtractors.jsx","webpack://graylog-web-interface/./src/pages/ImportExtractorsPage.jsx","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';\n\nimport { Row, Col, Button, Input } from 'components/bootstrap';\nimport UserNotification from 'util/UserNotification';\nimport { ExtractorsActions } from 'stores/extractors/ExtractorsStore';\n\nclass ImportExtractors extends React.Component {\n  static propTypes = {\n    input: PropTypes.object.isRequired,\n  };\n\n  _onSubmit = (event) => {\n    event.preventDefault();\n\n    try {\n      const parsedExtractors = JSON.parse(this.extractorsInput.getValue());\n      const { extractors } = parsedExtractors;\n\n      ExtractorsActions.import(this.props.input.id, extractors);\n    } catch (error) {\n      UserNotification.error(`There was an error while parsing extractors. Are they in JSON format? ${error}`,\n        'Could not import extractors');\n    }\n  };\n\n  render() {\n    return (\n      \n        \n          \n            \n              

Extractors JSON

\n \n
\n \n \n
\n { this.extractorsInput = extractorsInput; }} id=\"extractor-export-textarea\" rows={30} />\n \n
\n \n
\n \n
\n );\n }\n}\n\nexport default ImportExtractors;\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 createReactClass from 'create-react-class';\nimport Reflux from 'reflux';\n\nimport { DocumentTitle, PageHeader, Spinner } from 'components/common';\nimport ImportExtractors from 'components/extractors/ImportExtractors';\nimport withParams from 'routing/withParams';\nimport { InputsActions, InputsStore } from 'stores/inputs/InputsStore';\n\nconst ImportExtractorsPage = createReactClass({\n displayName: 'ImportExtractorsPage',\n\n propTypes: {\n params: PropTypes.object.isRequired,\n },\n\n mixins: [Reflux.connect(InputsStore)],\n\n componentDidMount() {\n const { params } = this.props;\n\n InputsActions.get.triggerPromise(params.inputId).then((input) => this.setState({ input: input }));\n },\n\n _isLoading() {\n return !this.state.input;\n },\n\n render() {\n if (this._isLoading()) {\n return ;\n }\n\n const { input } = this.state;\n\n return (\n \n
\n Import extractors to {input.title}}>\n \n Exported extractors can be imported to an input. All you need is the JSON export of extractors from any\n other Graylog setup or from{' '}\n \n the Graylog Marketplace\n .\n \n \n \n
\n
\n );\n },\n});\n\nexport default withParams(ImportExtractorsPage);\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';\nimport Promise from 'bluebird';\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.settle(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":["ImportExtractors","React","event","preventDefault","parsedExtractors","JSON","parse","this","extractorsInput","getValue","extractors","ExtractorsActions","props","input","id","error","UserNotification","render","className","md","onSubmit","_onSubmit","type","ref","rows","bsStyle","PropTypes","ImportExtractorsPage","createReactClass","displayName","propTypes","params","mixins","Reflux","InputsStore","componentDidMount","InputsActions","inputId","then","setState","_isLoading","state","title","href","rel","target","withParams","singletonActions","list","asyncResult","get","create","save","update","delete","order","import","getExtractorDTO","extractor","conditionValue","condition_type","condition_value","cursor_strategy","source_field","target_field","extractor_type","extractor_config","converters","ExtractorsStore","singletonStore","listenables","sourceUrl","undefined","init","trigger","promise","fetch","URLUtils","response","new","field","ExtractorUtils","Error","extractorId","_silentExtractorCreate","url","ApiRoutes","calledFromMethod","triggerPromise","catch","orderedExtractors","orderedExtractorsMap","forEach","idx","successfulImports","failedImports","promises","push","Promise"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy