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

web-interface.assets.d5f85445-108.a49ba8ace624afae35ed.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.6
Show newest version
{"version":3,"sources":["webpack:///./src/components/streams/MatchingTypeSwitcher.jsx","webpack:///./src/components/streamrules/StreamRulesEditor.jsx","webpack:///./src/pages/StreamEditPage.jsx"],"names":["StreamsStore","StoreProvider","getStore","StreamRuleConnector","styled","div","MatchingTypeSwitcher","handleTypeChange","newValue","window","confirm","update","props","stream","id","matching_type","response","onChange","UserNotification","success","type","label","checked","this","handleTypeChangeToAnd","handleTypeChangeToOr","React","Component","PropTypes","object","isRequired","func","StreamRulesStore","StreamAlertHeader","Panel","Heading","matchColor","matches","MatchIcon","empty","color","marginRight","StyledSpinner","Spinner","StreamRulesEditor","message","setState","undefined","streamId","testMatch","fields","resultData","matchData","state","types","then","streamRuleTypes","get","onMessageLoaded","streamRuleId","data","create","event","preventDefault","newStreamRuleForm","open","name","loadData","unregister","currentUser","messageId","index","styles","_getListClassName","className","md","LoaderTabs","bsStyle","onClick","_onAddStreamRule","StreamRuleForm","ref","title","onSubmit","_onStreamRuleFormSubmit","_explainMatchResult","StreamRuleList","permissions","to","Routes","STREAMS","string","CurrentUserStore","StreamEditPage","createReactClass","displayName","propTypes","params","location","mixins","Reflux","connect","componentDidMount","_isLoading","render","content","query","message_id","is_default"],"mappings":"22CASA,IAAMA,EAAeC,IAAcC,SAAS,WAEtCC,EAAsBC,UAAOC,IAAV,gGAAGD,CAAH,uLAuBnBE,E,60BAMoB,WACtB,EAAKC,iBAAiB,U,+BAGD,WACrB,EAAKA,iBAAiB,S,2BAGL,SAACC,GACdC,OAAOC,QAAQ,iIACjBV,EAAaW,OAAO,EAAKC,MAAMC,OAAOC,GAAI,CAAEC,cAAeP,IAAY,SAACQ,GAItE,OAHA,EAAKJ,MAAMK,WACXC,IAAiBC,QAAjB,2DAA0F,QAAbX,EAAqB,MAAQ,MAA1G,sBACE,WACKQ,Q,g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IAAIE,EACF,kBAAC,EAAD,CAAmBpC,YAAa9C,KAAK8B,MAAMgB,YACxBrB,SAAUzB,KAAKX,MAAMqF,OAAOjD,SAC5BsB,UAAW/C,KAAKX,MAAMsF,SAASQ,MAAMC,WACrCpC,MAAOhD,KAAKX,MAAMsF,SAASQ,MAAMnC,QAatD,OAXIhD,KAAK8B,MAAMxC,OAAO+F,aACpBH,EACE,yBAAK/B,UAAU,eACb,yBAAKA,UAAU,aACb,kBAAC,IAAD,CAAOG,QAAQ,UAAf,2CAQN,kBAAC,IAAD,CAAeK,MAAK,0BAAqB3D,KAAK8B,MAAMxC,OAAOqE,QACzD,6BACE,kBAAC,IAAD,CAAYA,MAAO,kDAA8B3D,KAAK8B,MAAMxC,OAAOqE,MAAhD,MACjB,uIACyG,IADzG,0EAMDuB,OAOIZ","file":"d5f85445-108.a49ba8ace624afae35ed.js","sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport styled from 'styled-components';\n\nimport { Input } from 'components/bootstrap';\n\nimport StoreProvider from 'injection/StoreProvider';\nimport UserNotification from 'util/UserNotification';\n\nconst StreamsStore = StoreProvider.getStore('Streams');\n\nconst StreamRuleConnector = styled.div`\n  margin-top: 10px;\n  margin-bottom: 13px;\n\n  label {\n    font-size: 12px;\n  }\n\n  .form-group {\n    margin-bottom: 5px;\n  }\n\n  .radio {\n    margin-top: 0;\n    margin-bottom: 0;\n  }\n\n  input[type=radio] {\n    margin-top: 2px;\n    margin-bottom: 2px;\n  }\n`;\n\nclass MatchingTypeSwitcher extends React.Component {\n  static propTypes = {\n    stream: PropTypes.object.isRequired,\n    onChange: PropTypes.func.isRequired,\n  };\n\n  handleTypeChangeToAnd = () => {\n    this.handleTypeChange('AND');\n  }\n\n  handleTypeChangeToOr = () => {\n    this.handleTypeChange('OR');\n  }\n\n  handleTypeChange = (newValue) => {\n    if (window.confirm('You are about to change how rules are applied to this stream, do you want to continue? Changes will take effect immediately.')) {\n      StreamsStore.update(this.props.stream.id, { matching_type: newValue }, (response) => {\n        this.props.onChange();\n        UserNotification.success(`Messages will now be routed into the stream when ${newValue === 'AND' ? 'all' : 'any'} rules are matched`,\n          'Success');\n        return response;\n      });\n    }\n  }\n\n  render() {\n    return (\n      \n        
\n \n \n
\n
\n );\n }\n}\n\nexport default MatchingTypeSwitcher;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport { LinkContainer } from 'react-router-bootstrap';\nimport styled from 'styled-components';\n\nimport Routes from 'routing/Routes';\n\nimport { Button, Col, Panel, Row } from 'components/graylog';\nimport { Icon } from 'components/common';\nimport LoaderTabs from 'components/messageloaders/LoaderTabs';\nimport MatchingTypeSwitcher from 'components/streams/MatchingTypeSwitcher';\nimport StreamRuleList from 'components/streamrules/StreamRuleList';\nimport StreamRuleForm from 'components/streamrules/StreamRuleForm';\nimport Spinner from 'components/common/Spinner';\n\nimport StoreProvider from 'injection/StoreProvider';\n\nconst StreamsStore = StoreProvider.getStore('Streams');\nconst StreamRulesStore = StoreProvider.getStore('StreamRules');\n\nconst StreamAlertHeader = styled(Panel.Heading)`\n font-weight: bold;\n`;\n\nconst matchColor = (matches) => (matches ? '#00AE42' : '#AD0707');\n\nconst MatchIcon = styled(({ empty, matches, ...props }) => )(\n ({ empty, matches }) => ({\n color: empty ? '#0063BE' : matchColor(matches),\n marginRight: '3px',\n }),\n);\n\nconst StyledSpinner = styled(Spinner)`\n margin-left: 10px;\n`;\n\nclass StreamRulesEditor extends React.Component {\n static propTypes = {\n currentUser: PropTypes.object.isRequired,\n streamId: PropTypes.string.isRequired,\n messageId: PropTypes.string,\n index: PropTypes.string,\n }\n\n static defaultProps = {\n messageId: '',\n index: '',\n }\n\n state = {};\n\n componentDidMount() {\n this.loadData();\n StreamsStore.onChange(this.loadData);\n StreamRulesStore.onChange(this.loadData);\n }\n\n componentWillUnmount() {\n StreamsStore.unregister(this.loadData);\n StreamRulesStore.unregister(this.loadData);\n }\n\n onMessageLoaded = (message) => {\n this.setState({ message: message });\n if (message !== undefined) {\n const { streamId } = this.props;\n\n StreamsStore.testMatch(streamId, { message: message.fields }, (resultData) => {\n this.setState({ matchData: resultData });\n });\n } else {\n this.setState({ matchData: undefined });\n }\n };\n\n loadData = () => {\n const { streamId } = this.props;\n const { message } = this.state;\n\n StreamRulesStore.types().then((types) => {\n this.setState({ streamRuleTypes: types });\n });\n\n StreamsStore.get(streamId, (stream) => {\n this.setState({ stream: stream });\n });\n\n if (message) {\n this.onMessageLoaded(message);\n }\n };\n\n _onStreamRuleFormSubmit = (streamRuleId, data) => {\n const { streamId } = this.props;\n StreamRulesStore.create(streamId, data, () => {});\n };\n\n _onAddStreamRule = (event) => {\n event.preventDefault();\n this.newStreamRuleForm.open();\n };\n\n _getListClassName = (matchData) => {\n return (matchData.matches ? 'success' : 'danger');\n };\n\n _explainMatchResult = () => {\n const { matchData } = this.state;\n\n if (matchData) {\n if (matchData.matches) {\n return (\n <>\n This message would be routed to this stream!\n \n );\n }\n return (\n <>\n This message would not be routed to this stream.\n \n );\n }\n\n return (\n <>\n Please load a message in Step 1 above to check if it would match against these rules.\n \n );\n };\n\n render() {\n const { matchData, stream, streamRuleTypes } = this.state;\n const { currentUser, messageId, index } = this.props;\n const styles = (matchData ? this._getListClassName(matchData) : 'info');\n\n if (stream && streamRuleTypes) {\n return (\n \n \n

1. Load a message to test rules

\n\n
\n \n
\n\n
\n\n
\n \n { this.newStreamRuleForm = newStreamRuleForm; }}\n title=\"New Stream Rule\"\n streamRuleTypes={streamRuleTypes}\n onSubmit={this._onStreamRuleFormSubmit} />\n
\n\n

2. Manage stream rules

\n\n \n \n {this._explainMatchResult()}\n \n \n\n

\n \n \n \n

\n \n
\n );\n }\n\n return (\n \n \n \n );\n }\n}\n\nexport default StreamRulesEditor;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport createReactClass from 'create-react-class';\nimport Reflux from 'reflux';\nimport { Alert } from 'components/graylog';\n\nimport StreamRulesEditor from 'components/streamrules/StreamRulesEditor';\nimport { DocumentTitle, PageHeader, Spinner } from 'components/common';\n\nimport StoreProvider from 'injection/StoreProvider';\n\nconst CurrentUserStore = StoreProvider.getStore('CurrentUser');\nconst StreamsStore = StoreProvider.getStore('Streams');\n\nconst StreamEditPage = createReactClass({\n displayName: 'StreamEditPage',\n\n propTypes: {\n params: PropTypes.object.isRequired,\n location: PropTypes.object.isRequired,\n },\n\n mixins: [Reflux.connect(CurrentUserStore)],\n\n componentDidMount() {\n StreamsStore.get(this.props.params.streamId, (stream) => {\n this.setState({ stream });\n });\n },\n\n _isLoading() {\n return !this.state.currentUser || !this.state.stream;\n },\n\n render() {\n if (this._isLoading()) {\n return ;\n }\n\n let content = (\n \n );\n if (this.state.stream.is_default) {\n content = (\n
\n
\n \n The default stream cannot be edited.\n \n
\n
\n );\n }\n return (\n \n
\n Rules of Stream »{this.state.stream.title}»}>\n \n This screen is dedicated to an easy and comfortable creation and manipulation of stream rules. You can{' '}\n see the effect configured stream rules have on message matching here.\n \n \n\n {content}\n
\n
\n );\n },\n});\n\nexport default StreamEditPage;\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy