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

web-interface.assets.b6fe2bb5-8214.22bfa523beedae5cfef8.js.map Maven / Gradle / Ivy

{"version":3,"file":"b6fe2bb5-8214.22bfa523beedae5cfef8.js","mappings":"2MAoDA,QAhCyB,CACvBA,qBADuB,SACFC,GACnB,IAAQC,EAAYD,EAAZC,QAER,OAAOC,KAAKC,cAAcF,EAAQG,IAAKJ,EAAeK,MAAOJ,EAASA,EAASD,EAAeM,iBAAkBN,EAAeO,mBAGjIC,oBAPuB,SAOHC,GAClB,IAAQR,EAAYQ,EAAZR,QAER,OAAOC,KAAKC,cAAcF,EAAQS,GAAID,EAAcJ,MAAOJ,EAASA,EAAQU,OAAQF,EAAcH,iBAAkBG,EAAcF,mBAGpIJ,cAbuB,SAaTO,EAAIL,EAAOJ,EAASU,EAAQC,EAAiBC,GACzD,IAAMC,EAAiBC,EAAAA,EAAAA,aAAiCJ,GAExD,MAAO,CACLD,GAAIA,EACJM,UAAWC,GAAAA,CAAOhB,EAAQe,WAAWE,OACrCC,gBAAiBL,EACjBM,iBAAkBN,EAClBH,OAAQA,EACRN,MAAOA,EACPgB,eAAgBV,EAAOW,gBACvBC,gBAAiBZ,EAAOa,iBACxBC,WAAYxB,EAAQyB,QACpBpB,iBAAkBM,EAClBL,iBAAkBM,M,8kECFxB,IAkBMc,EAAa,SAACtB,EAAeuB,GACjC,SAA8BC,EAAAA,EAAAA,YAA9B,GAAO5B,EAAP,KAAgB6B,EAAhB,KACA,KAA4BD,EAAAA,EAAAA,UAAuCE,EAAAA,OAAnE,GAAOC,EAAP,KAAeC,EAAf,KAqBA,OAnBAC,EAAAA,EAAAA,YAAU,WACR,IAAMC,EAAS,e,EAAA,G,EAAA,yBAAG,uHACOC,EAAAA,EAAAA,YAA4B/B,EAAOuB,GAD1C,UACVS,EADU,OAEhBP,EAAWO,GAFK,KAIZA,EAASd,iBAJG,sCAIsBe,EAAAA,EAAAA,GAAYD,EAAS1B,OAAOW,iBAJlD,qEA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XC,gBAJuB,WAKrB,MAAO,IAGTP,YARuB,SAQXnF,EAAOuB,GACjB,IAAQoE,EAAQC,EAAAA,EAAAA,mBAAAA,OAAoC5F,EAAM6F,OAAQtE,EAAUsE,QAApEF,IACFG,GAAUC,EAAAA,EAAAA,IAAM,MAAOC,EAAAA,GAAoBL,IAC9CjC,MACC,SAACuC,GAAD,OAAcC,EAAAA,EAAAA,oBAAqCD,MACnD,SAACE,GACCC,EAAAA,EAAAA,MAAA,0DAA0ED,GACxE,yCAIRpE,EAAgBoD,YAAYW,QAAQA,IAGtCT,WAtBuB,SAsBZrF,EAAOqG,GAChB,IAAQV,EAAQC,EAAAA,EAAAA,mBAAAA,QAAqC5F,EAAOsG,mBAAmBC,EAAAA,EAAAA,UAAsBF,KAA7FV,IACFG,GAAUC,EAAAA,EAAAA,IAAM,MAAOC,EAAAA,GAAoBL,IAC9CjC,MACC,SAACuC,GAAD,OAAcA,EAASO,UACvB,SAACC,GACCL,EAAAA,EAAAA,MAAA,kDAAkEK,GAChE,kCAIR1E,EAAgBsD,WAAWS,QAAQA,IAGrCR,eApCuB,SAoCR1F,EAAS8G,EAAeC,EAAOC,GAC5C,IAAQjB,EAAQC,EAAAA,EAAAA,mBAAAA,QAARD,IACFkB,EAAU,CACdjH,QAASA,EACTkH,eAAgBJ,EAChBC,MAAOA,EACPI,cAAeH,GAGXd,GAAUC,EAAAA,EAAAA,IAAM,OAAQC,EAAAA,GAAoBL,GAAMkB,GACrDnD,MACC,SAACuC,GAAD,OAAcC,EAAAA,EAAAA,oBAAqCD,MACnD,SAACQ,GACKA,EAAMO,YAA0C,MAA5BP,EAAMO,WAAWC,OACvCb,EAAAA,EAAAA,MAAuB,iHAC2B,8BAKpDA,EAAAA,EAAAA,MAAA,kDAAkEK,GAChE,iCAIR1E,EAAgBuD,eAAeQ,QAAQA","sources":["webpack://graylog-web-interface/./src/logic/message/MessageFormatter.js","webpack://graylog-web-interface/./src/pages/ShowMessagePage.tsx","webpack://graylog-web-interface/./src/stores/messages/MessagesStore.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 moment from 'moment';\n\nimport MessageFieldsFilter from 'logic/message/MessageFieldsFilter';\n\nconst MessageFormatter = {\n  formatMessageSummary(messageSummary) {\n    const { message } = messageSummary;\n\n    return this.formatMessage(message._id, messageSummary.index, message, message, messageSummary.highlight_ranges, messageSummary.decoration_stats);\n  },\n\n  formatResultMessage(resultMessage) {\n    const { message } = resultMessage;\n\n    return this.formatMessage(message.id, resultMessage.index, message, message.fields, resultMessage.highlight_ranges, resultMessage.decoration_stats);\n  },\n\n  formatMessage(id, index, message, fields, highlightRanges, decorationStats) {\n    const filteredFields = MessageFieldsFilter.filterFields(fields);\n\n    return {\n      id: id,\n      timestamp: moment(message.timestamp).unix(),\n      filtered_fields: filteredFields,\n      formatted_fields: filteredFields,\n      fields: fields,\n      index: index,\n      source_node_id: fields.gl2_source_node,\n      source_input_id: fields.gl2_source_input,\n      stream_ids: message.streams,\n      highlight_ranges: highlightRanges,\n      decoration_stats: decorationStats,\n    };\n  },\n};\n\nexport default MessageFormatter;\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, { useEffect, useMemo, useState } from 'react';\nimport * as Immutable from 'immutable';\n\nimport DocumentTitle from 'components/common/DocumentTitle';\nimport Spinner from 'components/common/Spinner';\nimport { Col, Row } from 'components/bootstrap';\nimport InteractiveContext from 'views/components/contexts/InteractiveContext';\nimport MessageDetail from 'views/components/messagelist/MessageDetail';\nimport withParams from 'routing/withParams';\nimport type { Stream } from 'views/stores/StreamsStore';\nimport type { Input } from 'components/messageloaders/Types';\nimport useFieldTypes from 'views/logic/fieldtypes/useFieldTypes';\nimport type { Message } from 'views/components/messagelist/Types';\nimport FieldTypesContext from 'views/components/contexts/FieldTypesContext';\nimport WindowDimensionsContextProvider from 'contexts/WindowDimensionsContextProvider';\nimport StreamsStore from 'stores/streams/StreamsStore';\nimport { InputsActions } from 'stores/inputs/InputsStore';\nimport { MessagesActions } from 'stores/messages/MessagesStore';\nimport { NodesActions } from 'stores/nodes/NodesStore';\nimport { isLocalNode } from 'views/hooks/useIsLocalNode';\n\ntype Props = {\n  params: {\n    index: string | undefined | null,\n    messageId: string | undefined | null,\n  },\n};\n\nconst useStreams = () => {\n  const [streams, setStreams] = useState>();\n  const [allStreams, setAllStreams] = useState>();\n\n  useEffect(() => {\n    StreamsStore.listStreams().then((newStreams) => {\n      if (newStreams) {\n        const streamsMap = newStreams.reduce((prev, stream) => ({ ...prev, [stream.id]: stream }), {});\n\n        setStreams(Immutable.Map(streamsMap));\n        setAllStreams(Immutable.List(newStreams));\n      }\n    });\n  }, [setStreams, setAllStreams]);\n\n  return { streams, allStreams };\n};\n\nconst useMessage = (index: string, messageId: string) => {\n  const [message, setMessage] = useState();\n  const [inputs, setInputs] = useState>(Immutable.Map());\n\n  useEffect(() => {\n    const fetchData = async () => {\n      const _message = await MessagesActions.loadMessage(index, messageId);\n      setMessage(_message);\n\n      if (_message.source_input_id && await isLocalNode(_message.fields.gl2_source_node)) {\n        const input = await InputsActions.get(_message.source_input_id);\n\n        if (input) {\n          const newInputs = Immutable.Map({ [input.id]: input });\n\n          setInputs(newInputs);\n        }\n      }\n    };\n\n    fetchData();\n  }, [index, messageId, setMessage, setInputs]);\n\n  return { message, inputs };\n};\n\ntype FieldTypesProviderProps = {\n  children: React.ReactNode,\n  streams: Array,\n  timestamp: string,\n};\n\nconst FieldTypesProvider = ({ streams, timestamp, children }: FieldTypesProviderProps) => {\n  const { data: fieldTypes } = useFieldTypes(streams, { type: 'absolute', from: timestamp, to: timestamp });\n  const fieldTypesList = Immutable.List(fieldTypes);\n  const types = { all: fieldTypesList, queryFields: Immutable.Map({ query: fieldTypesList }) };\n\n  return (\n    \n      {children}\n    \n  );\n};\n\ntype MessageFields = {\n  streams: Array,\n  timestamp: string,\n};\n\nconst ShowMessagePage = ({ params: { index, messageId } }: Props) => {\n  if (!index || !messageId) {\n    throw new Error('index and messageId need to be specified!');\n  }\n\n  const { streams, allStreams } = useStreams();\n  const { message, inputs } = useMessage(index, messageId);\n\n  useEffect(() => { NodesActions.list(); }, []);\n\n  const isLoaded = useMemo(() => (message !== undefined\n    && streams !== undefined\n    && inputs !== undefined\n    && allStreams !== undefined), [message, streams, inputs, allStreams]);\n\n  if (isLoaded) {\n    const { streams: messageStreams, timestamp } = message.fields as MessageFields;\n    const fieldTypesStreams = messageStreams.filter((streamId) => streams.has(streamId));\n\n    return (\n      \n        \n          \n            \n              \n                \n                  \n                \n              \n            \n          \n        \n      \n    );\n  }\n\n  return ;\n};\n\nShowMessagePage.propTypes = {\n  params: PropTypes.exact({\n    index: PropTypes.string.isRequired,\n    messageId: PropTypes.string.isRequired,\n  }).isRequired,\n};\n\nexport default withParams(ShowMessagePage);\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 fetch from 'logic/rest/FetchProvider';\nimport MessageFormatter from 'logic/message/MessageFormatter';\nimport ApiRoutes from 'routing/ApiRoutes';\nimport * as URLUtils from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport StringUtils from 'util/StringUtils';\nimport { singletonStore, singletonActions } from 'logic/singleton';\n\nexport const MessagesActions = singletonActions(\n  'core.Messages',\n  () => Reflux.createActions({\n    loadMessage: { asyncResult: true },\n    fieldTerms: { asyncResult: true },\n    loadRawMessage: { asyncResult: true },\n  }),\n);\n\nexport const MessagesStore = singletonStore(\n  'core.Messages',\n  () => Reflux.createStore({\n    listenables: [MessagesActions],\n    sourceUrl: '',\n\n    getInitialState() {\n      return {};\n    },\n\n    loadMessage(index, messageId) {\n      const { url } = ApiRoutes.MessagesController.single(index.trim(), messageId.trim());\n      const promise = fetch('GET', URLUtils.qualifyUrl(url))\n        .then(\n          (response) => MessageFormatter.formatResultMessage(response),\n          (errorThrown) => {\n            UserNotification.error(`Loading message information failed with status: ${errorThrown}`,\n              'Could not load message information');\n          },\n        );\n\n      MessagesActions.loadMessage.promise(promise);\n    },\n\n    fieldTerms(index, string) {\n      const { url } = ApiRoutes.MessagesController.analyze(index, encodeURIComponent(StringUtils.stringify(string)));\n      const promise = fetch('GET', URLUtils.qualifyUrl(url))\n        .then(\n          (response) => response.tokens,\n          (error) => {\n            UserNotification.error(`Loading field terms failed with status: ${error}`,\n              'Could not load field terms.');\n          },\n        );\n\n      MessagesActions.fieldTerms.promise(promise);\n    },\n\n    loadRawMessage(message, remoteAddress, codec, codecConfiguration) {\n      const { url } = ApiRoutes.MessagesController.parse();\n      const payload = {\n        message: message,\n        remote_address: remoteAddress,\n        codec: codec,\n        configuration: codecConfiguration,\n      };\n\n      const promise = fetch('POST', URLUtils.qualifyUrl(url), payload)\n        .then(\n          (response) => MessageFormatter.formatResultMessage(response),\n          (error) => {\n            if (error.additional && error.additional.status === 400) {\n              UserNotification.error('Please ensure the selected codec and its configuration are right. '\n              + 'Check your server logs for more information.', 'Could not load raw message');\n\n              return;\n            }\n\n            UserNotification.error(`Loading raw message failed with status: ${error}`,\n              'Could not load raw message');\n          },\n        );\n\n      MessagesActions.loadRawMessage.promise(promise);\n    },\n  }),\n);\n"],"names":["formatMessageSummary","messageSummary","message","this","formatMessage","_id","index","highlight_ranges","decoration_stats","formatResultMessage","resultMessage","id","fields","highlightRanges","decorationStats","filteredFields","MessageFieldsFilter","timestamp","moment","unix","filtered_fields","formatted_fields","source_node_id","gl2_source_node","source_input_id","gl2_source_input","stream_ids","streams","useMessage","messageId","useState","setMessage","Immutable","inputs","setInputs","useEffect","fetchData","MessagesActions","_message","isLocalNode","InputsActions","input","newInputs","FieldTypesProvider","children","fieldTypes","useFieldTypes","type","from","to","data","fieldTypesList","types","all","queryFields","query","value","ShowMessagePage","params","Error","setStreams","allStreams","setAllStreams","StreamsStore","then","newStreams","streamsMap","reduce","prev","stream","useStreams","NodesActions","useMemo","undefined","messageStreams","fieldTypesStreams","filter","streamId","has","title","className","md","disableSurroundingSearch","propTypes","PropTypes","isRequired","withParams","singletonActions","Reflux","loadMessage","asyncResult","fieldTerms","loadRawMessage","singletonStore","listenables","sourceUrl","getInitialState","url","ApiRoutes","trim","promise","fetch","URLUtils","response","MessageFormatter","errorThrown","UserNotification","string","encodeURIComponent","StringUtils","tokens","error","remoteAddress","codec","codecConfiguration","payload","remote_address","configuration","additional","status"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy