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

web-interface.assets.6e61897c-24.472622149827c1587209.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
{"version":3,"sources":["webpack:///./src/components/outputs/EditOutputButton.jsx","webpack:///./src/components/outputs/Output.jsx","webpack:///./src/components/outputs/OutputList.jsx","webpack:///./src/components/outputs/CreateOutputDropdown.jsx","webpack:///./src/components/outputs/AssignOutputDropdown.jsx","webpack:///./src/components/outputs/OutputsComponent.jsx"],"names":["EditOutputButton","props","getTypeDefinition","output","type","definition","setState","typeDefinition","requested_configuration","configurationForm","open","data","onUpdate","state","undefined","handleClick","bind","this","disabled","ref","form","key","id","configFields","title","typeName","helpBlock","submitAction","_handleSubmit","values","configuration","titleValue","bsStyle","onClick","React","Component","PropTypes","object","isRequired","bool","func","NodeRow","styled","div","theme","css","colors","gray","fonts","size","small","family","monospace","NodeRowInfo","Output","removeOutputFromStream","streamId","removeOutputGlobally","types","_typeNotAvailable","alert","configurationWell","contentPack","content_pack","name","deleteFromStreamButton","permissions","_onDeleteFromStream","className","md","_onDeleteGlobally","string","OutputList","output1","output2","naturalSort","toLowerCase","onRemove","onTerminate","outputs","length","sort","_sortByTitle","map","_formatOutput","array","CreateOutputDropdown","evt","PLACEHOLDER","value","outputType","target","loadData","outputTypes","$","_formatOutputType","defaultValue","onChange","_onTypeChange","_openModal","onSubmit","AssignOutputDropdown","selectedOutput","outputList","_handleUpdate","_handleClick","OutputsStore","StoreProvider","getStore","StreamsStore","OutputsComponent","createReactClass","displayName","mixins","PermissionsMixin","componentDidMount","callback","resp","_fetchAssignableOutputs","loadForStreamId","load","loadAvailableTypes","getInitialState","_handleCreateOutput","save","result","addOutput","response","streamOutputIds","assignableOutputs","filter","indexOf","localeCompare","_handleAssignOutput","outputId","_removeOutputGlobally","window","confirm","remove","UserNotification","success","_removeOutputFromStream","removeOutput","_handleOutputUpdate","deltas","update","render","createOutputDropdown","isPermitted","loadAvailable","assignOutputDropdown","Spinner"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AAC,GAAD,CAAsBA,SAAUA,EACVuB,QAAS9D,KAAKJ,MAAMoH,kBACpB7B,SAAUnF,KAAKoH,sBACnC,KAEN,OACE,yBAAKjE,UAAU,WACb,kBAAC,IAAD,CAAKA,UAAU,WACb,kBAAC,IAAD,CAAKC,GAAI,GACN8E,GAEH,kBAAC,IAAD,CAAK9E,GAAI,GACNiF,IAIL,kBAAC,EAAD,CAAY9F,SAAUA,EACVuB,QAAS9D,KAAKJ,MAAMkE,QACpBb,YAAaA,EACbhE,kBAAmBwG,GAAa2C,cAChC3F,MAAOzC,KAAKJ,MAAM6C,MAClBmB,SAAU5D,KAAK4H,wBACf/D,YAAa7D,KAAKsH,sBAClB3H,SAAUK,KAAK8H,uBAKjC,OAAO,kBAACQ,EAAA,EAAD,SAGIzC","file":"6e61897c-24.472622149827c1587209.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 { Button } from 'components/graylog';\nimport { ConfigurationForm } from 'components/configurationforms';\n\nclass EditOutputButton extends React.Component {\n  static propTypes = {\n    output: PropTypes.object.isRequired,\n    disabled: PropTypes.bool,\n    getTypeDefinition: PropTypes.func.isRequired,\n    onUpdate: PropTypes.func,\n  };\n\n  static defaultProps = {\n    disabled: false,\n    onUpdate: () => {},\n  }\n\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      typeDefinition: undefined,\n    };\n\n    this.handleClick = this.handleClick.bind(null, props.output);\n  }\n\n  handleClick = () => {\n    const { getTypeDefinition, output } = this.props;\n\n    getTypeDefinition(output.type, (definition) => {\n      this.setState({ typeDefinition: definition.requested_configuration });\n      this.configurationForm.open();\n    });\n  };\n\n  _handleSubmit = (data) => {\n    const { onUpdate, output } = this.props;\n\n    onUpdate(output, data);\n  };\n\n  render() {\n    const { typeDefinition } = this.state;\n    const { disabled, output } = this.props;\n    let configurationForm;\n\n    if (typeDefinition) {\n      configurationForm = (\n         { this.configurationForm = form; }}\n                           key={`configuration-form-output-${output.id}`}\n                           configFields={typeDefinition}\n                           title={`Editing Output ${output.title}`}\n                           typeName={output.type}\n                           helpBlock=\"Select a name of your new output that describes it.\"\n                           submitAction={this._handleSubmit}\n                           values={output.configuration}\n                           titleValue={output.title} />\n      );\n    }\n\n    return (\n      \n        \n        {configurationForm}\n      \n    );\n  }\n}\n\nexport default EditOutputButton;\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 styled, { css } from 'styled-components';\n\nimport { Alert, Col, Row, Button } from 'components/graylog';\nimport EditOutputButton from 'components/outputs/EditOutputButton';\nimport { ConfigurationWell } from 'components/configurationforms';\nimport { IfPermitted, Spinner, Icon } from 'components/common';\n\nconst NodeRow = styled.div(({ theme }) => css`\n  border-bottom: 1px solid ${theme.colors.gray[80]};\n  padding-bottom: 8px;\n  margin-bottom: 8px;\n  margin-top: 0;\n\n  .hostname {\n    font-size: ${theme.fonts.size.small};\n  }\n\n  .well {\n    margin-bottom: 0;\n    margin-top: 3px;\n    font-family: ${theme.fonts.family.monospace};\n    font-size: ${theme.fonts.size.small};\n  }\n\n  .xtrc-converters {\n    margin-top: 10px;\n  }\n\n  .xtrc-config li {\n    margin-left: 10px;\n  }\n\n  .xtrc-converters li {\n    margin-left: 10px;\n  }\n\n  .xtrc-converter-config li {\n    margin-left: 20px;\n  }\n\n  .dropdown-menu a.selected {\n    font-weight: bold;\n  }\n`);\n\nconst NodeRowInfo = styled.div`\n  position: relative;\n  top: 2px;\n\n  form {\n    display: inline;\n  }\n\n  .text {\n    position: relative;\n    top: 3px;\n  }\n`;\n\nclass Output extends React.Component {\n  static propTypes = {\n    streamId: PropTypes.string,\n    output: PropTypes.object.isRequired,\n    types: PropTypes.object.isRequired,\n    getTypeDefinition: PropTypes.func.isRequired,\n    onUpdate: PropTypes.func,\n    removeOutputFromStream: PropTypes.func.isRequired,\n    removeOutputGlobally: PropTypes.func.isRequired,\n  };\n\n  static defaultProps = {\n    streamId: '',\n    onUpdate: () => {},\n  }\n\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      typeDefinition: undefined,\n    };\n  }\n\n  componentDidMount() {\n    const { getTypeDefinition, output } = this.props;\n\n    if (!this._typeNotAvailable()) {\n      getTypeDefinition(output.type, (typeDefinition) => {\n        this.setState({ typeDefinition });\n      });\n    }\n  }\n\n  _onDeleteFromStream = () => {\n    const { removeOutputFromStream, output, streamId } = this.props;\n\n    removeOutputFromStream(output.id, streamId);\n  };\n\n  _onDeleteGlobally = () => {\n    const { removeOutputGlobally, output } = this.props;\n\n    removeOutputGlobally(output.id);\n  };\n\n  _typeNotAvailable = () => {\n    const { types, output } = this.props;\n\n    return (types[output.type] === undefined);\n  };\n\n  render() {\n    const { typeDefinition } = this.state;\n    const { onUpdate, getTypeDefinition } = this.props;\n\n    if (!this._typeNotAvailable() && !typeDefinition) {\n      return ;\n    }\n\n    const { output } = this.props;\n    const contentPack = (output.content_pack\n      ?  : null);\n\n    let alert;\n    let configurationWell;\n\n    if (this._typeNotAvailable()) {\n      alert = (\n        \n          The plugin required for this output is not loaded. Editing it is not possible. Please load the plugin or\n          delete the output.\n        \n      );\n    } else {\n      configurationWell = (\n        \n      );\n    }\n\n    const { streamId } = this.props;\n    let deleteFromStreamButton;\n\n    if (streamId !== null && streamId !== undefined) {\n      deleteFromStreamButton = (\n        \n          {' '}\n          \n        \n      );\n    } else {\n      deleteFromStreamButton = '';\n    }\n\n    return (\n      \n        \n          \n            \n              

\n {output.title} {contentPack}\n ID: {output.id}\n

\n Type: {output.type}\n \n \n \n \n \n \n {deleteFromStreamButton}\n \n {' '}\n \n \n \n \n
\n \n \n {alert}\n {configurationWell}\n \n \n \n
\n );\n }\n}\n\nexport default Output;\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 naturalSort from 'javascript-natural-sort';\n\nimport { Alert, Col, Row } from 'components/graylog';\nimport { Spinner } from 'components/common';\nimport Output from 'components/outputs/Output';\n\nclass OutputList extends React.Component {\n static propTypes = {\n streamId: PropTypes.string,\n outputs: PropTypes.array,\n onRemove: PropTypes.func.isRequired,\n onTerminate: PropTypes.func.isRequired,\n onUpdate: PropTypes.func.isRequired,\n getTypeDefinition: PropTypes.func.isRequired,\n types: PropTypes.object.isRequired,\n };\n\n _sortByTitle = (output1, output2) => {\n return naturalSort(output1.title.toLowerCase(), output2.title.toLowerCase());\n };\n\n _formatOutput = (output) => {\n return (\n \n );\n };\n\n render() {\n if (!this.props.outputs) {\n return ;\n }\n\n if (this.props.outputs.length === 0) {\n return (\n \n \n No outputs configured.\n \n \n );\n }\n\n const outputs = this.props.outputs.sort(this._sortByTitle).map(this._formatOutput);\n\n return
{outputs}
;\n }\n}\n\nexport default OutputList;\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 from 'react';\nimport $ from 'jquery';\n\nimport { Button } from 'components/graylog';\nimport { ConfigurationForm } from 'components/configurationforms';\n\nclass CreateOutputDropdown extends React.Component {\n PLACEHOLDER = 'placeholder';\n\n componentDidMount() {\n this.loadData();\n }\n\n loadData = () => {\n };\n\n render() {\n const outputTypes = $.map(this.props.types, this._formatOutputType);\n\n return (\n
\n
\n \n  \n \n
\n\n { this.configurationForm = configurationForm; }}\n key=\"configuration-form-output\"\n configFields={this.state.typeDefinition}\n title=\"Create new Output\"\n helpBlock=\"Select a name of your new output that describes it.\"\n typeName={this.state.typeName}\n submitAction={this.props.onSubmit} />\n
\n );\n }\n\n _openModal = (evt) => {\n if (this.state.typeName !== this.PLACEHOLDER && this.state.typeName !== '') {\n this.configurationForm.open();\n }\n };\n\n _formatOutputType = (type, typeName) => {\n return ();\n };\n\n _onTypeChange = (evt) => {\n const outputType = evt.target.value;\n\n this.setState({ typeName: evt.target.value });\n\n this.props.getTypeDefinition(outputType, (definition) => {\n this.setState({ typeDefinition: definition.requested_configuration });\n });\n };\n\n state = {\n typeDefinition: [],\n typeName: this.PLACEHOLDER,\n };\n}\n\nexport default CreateOutputDropdown;\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';\n\nimport { Button } from 'components/graylog';\n\nclass AssignOutputDropdown extends React.Component {\n PLACEHOLDER = 'placeholder';\n\n static propTypes = {\n outputs: PropTypes.array.isRequired,\n onSubmit: PropTypes.func.isRequired,\n };\n\n state = {\n selectedOutput: this.PLACEHOLDER,\n };\n\n _formatOutput = (output) => {\n return ;\n };\n\n _handleUpdate = (evt) => {\n this.setState({ selectedOutput: evt.target.value });\n };\n\n _handleClick = () => {\n const { onSubmit } = this.props;\n const { selectedOutput } = this.state;\n\n onSubmit(selectedOutput);\n this.setState({ selectedOutput: this.PLACEHOLDER });\n };\n\n render() {\n const { outputs } = this.props;\n const { selectedOutput } = this.state;\n const outputList = (outputs.length > 0\n ? outputs.map(this._formatOutput)\n : );\n\n return (\n
\n
\n \n  \n \n
\n
\n );\n }\n}\n\nexport default AssignOutputDropdown;\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 from 'react';\nimport createReactClass from 'create-react-class';\n\nimport { Row, Col } from 'components/graylog';\nimport StoreProvider from 'injection/StoreProvider';\nimport UserNotification from 'util/UserNotification';\nimport PermissionsMixin from 'util/PermissionsMixin';\nimport Spinner from 'components/common/Spinner';\n\nimport OutputList from './OutputList';\nimport CreateOutputDropdown from './CreateOutputDropdown';\nimport AssignOutputDropdown from './AssignOutputDropdown';\n\nconst OutputsStore = StoreProvider.getStore('Outputs');\nconst StreamsStore = StoreProvider.getStore('Streams');\n\nconst OutputsComponent = createReactClass({\n displayName: 'OutputsComponent',\n mixins: [PermissionsMixin],\n\n componentDidMount() {\n this.loadData();\n },\n\n loadData() {\n const callback = (resp) => {\n this.setState({\n outputs: resp.outputs,\n });\n\n if (this.props.streamId) {\n this._fetchAssignableOutputs(resp.outputs);\n }\n };\n\n if (this.props.streamId) {\n OutputsStore.loadForStreamId(this.props.streamId, callback);\n } else {\n OutputsStore.load(callback);\n }\n\n OutputsStore.loadAvailableTypes((resp) => {\n this.setState({ types: resp.types });\n });\n },\n\n getInitialState() {\n return {\n };\n },\n\n _handleUpdate() {\n this.loadData();\n },\n\n _handleCreateOutput(data) {\n OutputsStore.save(data, (result) => {\n this.setState({ typeName: 'placeholder' });\n\n if (this.props.streamId) {\n StreamsStore.addOutput(this.props.streamId, result.id, (response) => {\n this._handleUpdate();\n\n return response;\n });\n } else {\n this._handleUpdate();\n }\n\n return result;\n });\n },\n\n _fetchAssignableOutputs(outputs) {\n OutputsStore.load((resp) => {\n const streamOutputIds = outputs.map((output) => { return output.id; });\n const assignableOutputs = resp.outputs\n .filter((output) => { return streamOutputIds.indexOf(output.id) === -1; })\n .sort((output1, output2) => { return output1.title.localeCompare(output2.title); });\n\n this.setState({ assignableOutputs: assignableOutputs });\n });\n },\n\n _handleAssignOutput(outputId) {\n StreamsStore.addOutput(this.props.streamId, outputId, (response) => {\n this._handleUpdate();\n\n return response;\n });\n },\n\n _removeOutputGlobally(outputId) {\n if (window.confirm('Do you really want to terminate this output?')) {\n OutputsStore.remove(outputId, (response) => {\n UserNotification.success('Output was terminated.', 'Success');\n this._handleUpdate();\n\n return response;\n });\n }\n },\n\n _removeOutputFromStream(outputId, streamId) {\n if (window.confirm('Do you really want to remove this output from the stream?')) {\n StreamsStore.removeOutput(streamId, outputId, (response) => {\n UserNotification.success('Output was removed from stream.', 'Success');\n this._handleUpdate();\n\n return response;\n });\n }\n },\n\n _handleOutputUpdate(output, deltas) {\n OutputsStore.update(output, deltas, () => {\n this._handleUpdate();\n });\n },\n\n render() {\n if (this.state.outputs && this.state.types && (!this.props.streamId || this.state.assignableOutputs)) {\n const { permissions } = this.props;\n const { streamId } = this.props;\n const createOutputDropdown = (this.isPermitted(permissions, ['outputs:create'])\n ? (\n \n ) : null);\n const assignOutputDropdown = (streamId\n ? (\n \n ) : null);\n\n return (\n
\n \n \n {createOutputDropdown}\n \n \n {assignOutputDropdown}\n \n \n\n \n
\n );\n }\n\n return ;\n },\n});\nexport default OutputsComponent;\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy