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

web-interface.assets.b6fe2bb5-1076.3bc0763dbd1fbc49738b.js.map Maven / Gradle / Ivy

{"version":3,"file":"b6fe2bb5-1076.3bc0763dbd1fbc49738b.js","mappings":"muDAmBMA,EAAAA,SAAAA,I,4cACQ,W,kCAEe,G,gCAEF,G,qBAEX,G,6BAEO,SAACC,EAAMC,GAC1B,GAAIA,EACF,OAAOA,EAAgBC,QAAO,SAACC,GAC7B,OAAOC,OAAOD,EAAeE,MAAQD,OAAOJ,MAC3C,M,qBAMM,SAACM,GAGZ,OAFmB,EAAKC,MAAhBC,OAEMC,MAAK,SAACC,GAAD,OAAWA,EAAML,KAAOC,Q,2BAG1B,SAACK,GAClB,GAAIP,OAAOO,EAAWX,QAAUI,OAAO,EAAKQ,aAAc,CACxD,IAAMF,EAAQ,EAAKG,WAAWF,EAAWG,OAEzC,OAAIJ,EACF,UAAUA,EAAMK,MAAhB,aAA0BL,EAAMM,KAAhC,aAAyCN,EAAML,GAA/C,KAGF,2BAA2BM,EAAWG,MAAtC,KAGF,OAAIV,OAAOO,EAAWX,QAAUI,OAAO,EAAKa,0BACtCN,EAAWG,MACNH,EAAWG,MAGb,EAAKI,UAGP,Q,2BAGU,SAACP,GAClB,OAAIA,EAAWQ,MACNR,EAAWQ,MAGhBf,OAAOO,EAAWX,QAAUI,OAAO,EAAKQ,aACnC,kBAGF,EAAKM,a,qCAGd,WACE,MAAwCE,KAAKb,MAArCI,EAAR,EAAQA,WAAYV,EAApB,EAAoBA,gBACdE,EAAiBiB,KAAKC,mBAAmBV,EAAWX,KAAMC,GAC1DqB,EAAYX,EAAWY,SAAW,OAAS,KAC3CC,EAAYrB,EAAiBA,EAAesB,UAAY,KAE9D,OAAIrB,OAAOO,EAAWX,QAAUI,OAAOgB,KAAKM,wBAExC,mDAKF,4BACE,0BAAKN,KAAKO,iBAAiBhB,IAD7B,IAC+C,sCAAcW,GAAmBE,EADhF,IAC0F,0BAAKJ,KAAKQ,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cDuG,KAAKxH,KAAKyH,YAAYC,KAAK1H,QAEhC2H,OA5BuB,SA4BhBR,EAAkBzB,EAAsB0B,GAC7C,IAKMC,EAAMJ,EAAAA,GAAoBK,EAAAA,EAAAA,yBAAAA,OAA0CH,EAAUzB,GAAc2B,MAElGL,EAAAA,EAAAA,IAAM,SAAUK,GACbG,KAAKJ,GARa,SAACnG,GACpBkE,EAAAA,EAAAA,MAAA,mDAAmElE,GACjE,mCAODuG,KAAKxH,KAAKyH,YAAYC,KAAK1H,QAEhC4H,OAxCuB,SAwChBT,EAAkBxB,EAAkByB,GACzC,IAKMC,EAAMJ,EAAAA,GAAoBK,EAAAA,EAAAA,yBAAAA,OAA0CH,GAAUE,MAEpFL,EAAAA,EAAAA,IAAM,OAAQK,EAAK1B,GAChB6B,KAAKJ,GARa,SAACnG,GACpBkE,EAAAA,EAAAA,MAAA,mDAAmElE,GACjE,mCAODuG,KAAKxH,KAAKyH,YAAYC,KAAK1H,QAEhCkC,SApDuB,SAoDdkF,GACPpH,KAAK8G,UAAUe,KAAKT,IAEtBK,YAvDuB,WAwDrBzH,KAAK8G,UAAUgB,SAAQ,SAACV,GAAD,OAAcA,QAEvCW,WA1DuB,SA0DZX,GACTY,IAAAA,KAAYhI,KAAK8G,UAAWM","sources":["webpack://graylog-web-interface/./src/components/streamrules/HumanReadableStreamRule.jsx","webpack://graylog-web-interface/./src/components/streamrules/StreamRuleForm.tsx","webpack://graylog-web-interface/./src/components/streamrules/StreamRule.jsx","webpack://graylog-web-interface/./src/components/streamrules/StreamRuleList.jsx","webpack://graylog-web-interface/./src/components/support/SmallSupportLink.tsx","webpack://graylog-web-interface/./src/stores/streams/StreamRulesStore.ts"],"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\nclass HumanReadableStreamRule extends React.Component {\n  EMPTY_TAG = '';\n\n  FIELD_PRESENCE_RULE_TYPE = 5;\n\n  ALWAYS_MATCH_RULE_TYPE = 7;\n\n  MATCH_INPUT = 8;\n\n  _getTypeForInteger = (type, streamRuleTypes) => {\n    if (streamRuleTypes) {\n      return streamRuleTypes.filter((streamRuleType) => {\n        return String(streamRuleType.id) === String(type);\n      })[0];\n    }\n\n    return undefined;\n  };\n\n  _findInput = (inputId) => {\n    const { inputs } = this.props;\n\n    return inputs.find((input) => input.id === inputId);\n  };\n\n  _formatRuleValue = (streamRule) => {\n    if (String(streamRule.type) === String(this.MATCH_INPUT)) {\n      const input = this._findInput(streamRule.value);\n\n      if (input) {\n        return `${input.title} (${input.name}: ${input.id})`;\n      }\n\n      return `: ${streamRule.value})`;\n    }\n\n    if (String(streamRule.type) !== String(this.FIELD_PRESENCE_RULE_TYPE)) {\n      if (streamRule.value) {\n        return streamRule.value;\n      }\n\n      return this.EMPTY_TAG;\n    }\n\n    return null;\n  };\n\n  _formatRuleField = (streamRule) => {\n    if (streamRule.field) {\n      return streamRule.field;\n    }\n\n    if (String(streamRule.type) === String(this.MATCH_INPUT)) {\n      return 'gl_source_input';\n    }\n\n    return this.EMPTY_TAG;\n  };\n\n  render() {\n    const { streamRule, streamRuleTypes } = this.props;\n    const streamRuleType = this._getTypeForInteger(streamRule.type, streamRuleTypes);\n    const negation = (streamRule.inverted ? 'not ' : null);\n    const longDesc = (streamRuleType ? streamRuleType.long_desc : null);\n\n    if (String(streamRule.type) === String(this.ALWAYS_MATCH_RULE_TYPE)) {\n      return (\n        Rule always matches\n      );\n    }\n\n    return (\n      \n        {this._formatRuleField(streamRule)} must {negation}{longDesc} {this._formatRuleValue(streamRule)}\n      \n    );\n  }\n}\n\nHumanReadableStreamRule.propTypes = {\n  streamRule: PropTypes.object.isRequired,\n  streamRuleTypes: PropTypes.array.isRequired,\n  inputs: PropTypes.array,\n};\n\nHumanReadableStreamRule.defaultProps = {\n  inputs: [],\n};\n\nexport default HumanReadableStreamRule;\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 { Icon, TypeAheadFieldInput } from 'components/common';\nimport { Col, Well, BootstrapModalForm, Input } from 'components/bootstrap';\nimport { DocumentationLink } from 'components/support';\nimport HumanReadableStreamRule from 'components/streamrules//HumanReadableStreamRule';\nimport connect from 'stores/connect';\nimport DocsHelper from 'util/DocsHelper';\nimport Version from 'util/Version';\nimport * as FormsUtils from 'util/FormsUtils';\nimport type { Store } from 'stores/StoreTypes';\nimport { InputsActions, InputsStore } from 'stores/inputs/InputsStore';\n\ntype StreamRule = {\n  type: number,\n  field: string,\n  value: string,\n  id?: string,\n  inverted: boolean,\n  description: string,\n};\n\ntype StreamRuleType = {\n  id: number,\n  short_desc: string,\n  long_desc: string,\n  name: string,\n};\n\ntype Props = {\n  onSubmit: (streamRuleId: string | undefined | null, currentStreamRule: StreamRule) => void,\n  streamRule: StreamRule,\n  streamRuleTypes: Array,\n  title: string,\n  inputs: Array,\n  onClose: () => void,\n};\n\ntype State = {\n  streamRule: StreamRule,\n  error: string,\n};\n\nclass StreamRuleForm extends React.Component {\n  static defaultProps = {\n    // eslint-disable-next-line react/default-props-match-prop-types\n    streamRule: { field: '', type: 1, value: '', inverted: false, description: '' },\n    // eslint-disable-next-line react/default-props-match-prop-types\n    inputs: [],\n    onClose: () => {},\n  };\n\n  static propTypes = {\n    onSubmit: PropTypes.func.isRequired,\n    streamRuleTypes: PropTypes.array.isRequired,\n    title: PropTypes.string.isRequired,\n    onClose: PropTypes.func,\n  };\n\n  FIELD_PRESENCE_RULE_TYPE = 5;\n\n  ALWAYS_MATCH_RULE_TYPE = 7;\n\n  MATCH_INPUT = 8;\n\n  PLACEHOLDER_INPUT = 0;\n\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      streamRule: props.streamRule,\n      error: '',\n    };\n  }\n\n  componentDidMount() {\n    InputsActions.list();\n  }\n\n  _validateMatchInput = () => {\n    const { streamRule: { value } } = this.state;\n\n    if (String(value) === String(this.PLACEHOLDER_INPUT)) {\n      this.setState({ error: 'Please choose an input' });\n\n      return false;\n    }\n\n    this.setState({ error: '' });\n\n    return true;\n  };\n\n  _onSubmit = () => {\n    const { streamRule: currentStreamRule } = this.state;\n    const { type } = currentStreamRule;\n    const { streamRule, onSubmit } = this.props;\n    const { onClose } = this.props;\n\n    if (type === this.ALWAYS_MATCH_RULE_TYPE) {\n      currentStreamRule.field = '';\n      this.setState({ streamRule: currentStreamRule });\n    }\n\n    if (type === this.FIELD_PRESENCE_RULE_TYPE || type === this.ALWAYS_MATCH_RULE_TYPE) {\n      currentStreamRule.value = '';\n      this.setState({ streamRule: currentStreamRule });\n    }\n\n    if (String(type) === String(this.MATCH_INPUT)) {\n      if (!this._validateMatchInput()) {\n        return;\n      }\n    }\n\n    onSubmit(streamRule.id, currentStreamRule);\n    onClose();\n  };\n\n  _formatStreamRuleType = (streamRuleType) => (\n    \n  );\n\n  handleChange = (event) => {\n    const { streamRule } = this.state;\n    const updatedStreamRule = { ...streamRule };\n\n    updatedStreamRule[event.target.name] = FormsUtils.getValueFromInput(event.target);\n\n    if (event.target.name === 'type' && String(updatedStreamRule.type) === String(this.MATCH_INPUT)) {\n      updatedStreamRule.value = String(this.PLACEHOLDER_INPUT);\n    }\n\n    this.setState({ streamRule: updatedStreamRule });\n  };\n\n  _formatInputOptions = (input) => (\n    \n  );\n\n  valueBox = () => {\n    const { streamRule: { value, type }, error } = this.state;\n    const { inputs } = this.props;\n\n    switch (String(type)) {\n      case String(this.FIELD_PRESENCE_RULE_TYPE):\n      case String(this.ALWAYS_MATCH_RULE_TYPE):\n        return '';\n\n      case String(this.MATCH_INPUT): {\n        const bsStyle = error && error.length > 0 ? 'error' : undefined;\n\n        return (\n          \n            \n            {inputs.map(this._formatInputOptions)}\n          \n        );\n      }\n\n      default:\n        return ;\n    }\n  };\n\n  fieldBox = () => {\n    const { streamRule: { field, type } } = this.state;\n\n    switch (String(type)) {\n      case String(this.ALWAYS_MATCH_RULE_TYPE):\n      case String(this.MATCH_INPUT):\n        return '';\n      default:\n        return ;\n    }\n  };\n\n  render() {\n    const { streamRule } = this.state;\n    const { type, inverted, description } = streamRule;\n    const { streamRuleTypes: ruleTypes, title, onClose, inputs } = this.props;\n\n    const streamRuleTypes = ruleTypes.map(this._formatStreamRuleType);\n    const fieldBox = this.fieldBox();\n    const valueBox = this.valueBox();\n\n    return (\n      \n        
\n \n {fieldBox}\n \n {streamRuleTypes}\n \n {valueBox}\n \n\n \n\n

\n Result:\n {' '}\n \n

\n \n \n \n The server will try to convert to strings or numbers based on the matcher type as well as it can.\n\n

\n  \n Take a look at the matcher code on GitHub\n \n

\n Regular expressions use Java syntax. } />\n
\n \n
\n
\n );\n }\n}\n\ntype InputsStoreState = {\n inputs: Array;\n};\n\nexport default connect(StreamRuleForm,\n { inputs: InputsStore as Store },\n ({ inputs }) => ({ inputs: inputs.inputs }));\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, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash';\nimport styled from 'styled-components';\n\nimport { useStore } from 'stores/connect';\nimport { Icon } from 'components/common';\nimport { Button, ListGroupItem } from 'components/bootstrap';\nimport { isPermitted } from 'util/PermissionsMixin';\nimport StreamRuleForm from 'components/streamrules/StreamRuleForm';\nimport HumanReadableStreamRule from 'components/streamrules/HumanReadableStreamRule';\nimport UserNotification from 'util/UserNotification';\nimport { InputsActions, InputsStore } from 'stores/inputs/InputsStore';\nimport { StreamRulesStore } from 'stores/streams/StreamRulesStore';\n\nconst ActionButtonsWrap = styled.span`\n margin-right: 6px;\n`;\n\nconst StreamRule = ({ matchData, permissions, stream, streamRule, streamRuleTypes, onSubmit, onDelete }) => {\n const [showStreamRuleForm, setShowStreamRuleForm] = useState(false);\n const { inputs } = useStore(InputsStore);\n\n useEffect(() => {\n InputsActions.list();\n }, []);\n\n const _onEdit = (event) => {\n event.preventDefault();\n setShowStreamRuleForm(true);\n };\n\n const _onDelete = (event) => {\n event.preventDefault();\n\n /* TODO: Replace with custom confirmation dialog */\n // eslint-disable-next-line no-alert\n if (window.confirm('Do you really want to delete this stream rule?')) {\n StreamRulesStore.remove(stream.id, streamRule.id, () => {\n if (onDelete) {\n onDelete(streamRule.id);\n }\n\n UserNotification.success('Stream rule has been successfully deleted.', 'Success');\n });\n }\n };\n\n const _onSubmit = (streamRuleId, data) => {\n StreamRulesStore.update(stream.id, streamRuleId, data, () => {\n if (onSubmit) {\n onSubmit(streamRuleId, data);\n }\n\n UserNotification.success('Stream rule has been successfully updated.', 'Success');\n });\n };\n\n const _formatActionItems = () => {\n return (\n \n \n \n \n );\n };\n\n const matchDataStyle = () => (matchData.rules[streamRule.id] ? 'success' : 'danger');\n const actionItems = isPermitted(permissions, [`streams:edit:${stream.id}`]) ? _formatActionItems() : null;\n const description = streamRule.description ? {' '}({streamRule.description}) : null;\n const listGroupStyle = !isEmpty(matchData) ? matchDataStyle() : null;\n\n return (\n \n {actionItems}\n \n {showStreamRuleForm && (\n setShowStreamRuleForm(false)}\n streamRuleTypes={streamRuleTypes}\n title=\"Edit Stream Rule\"\n onSubmit={_onSubmit} />\n )}\n {description}\n \n );\n};\n\nStreamRule.propTypes = {\n matchData: PropTypes.shape({\n matches: PropTypes.bool,\n rules: PropTypes.object,\n }),\n onDelete: PropTypes.func,\n onSubmit: PropTypes.func,\n permissions: PropTypes.array.isRequired,\n stream: PropTypes.object.isRequired,\n streamRule: PropTypes.object.isRequired,\n streamRuleTypes: PropTypes.array.isRequired,\n};\n\nStreamRule.defaultProps = {\n matchData: {},\n onSubmit: () => {},\n onDelete: () => {},\n};\n\nexport default StreamRule;\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 StreamRule from 'components/streamrules/StreamRule';\nimport { Spinner } from 'components/common';\nimport { ListGroup, ListGroupItem } from 'components/bootstrap';\n\nclass StreamRuleList extends React.Component {\n static propTypes = {\n matchData: PropTypes.shape({\n matches: PropTypes.bool,\n rules: PropTypes.object,\n }),\n onSubmit: PropTypes.func,\n onDelete: PropTypes.func,\n permissions: PropTypes.array.isRequired,\n stream: PropTypes.object.isRequired,\n streamRuleTypes: PropTypes.array.isRequired,\n };\n\n static defaultProps = {\n matchData: {},\n onSubmit: () => {},\n onDelete: () => {},\n };\n\n _formatStreamRules = (streamRules) => {\n if (streamRules && streamRules.length > 0) {\n const {\n matchData,\n onDelete,\n onSubmit,\n permissions,\n stream,\n streamRuleTypes,\n } = this.props;\n\n return streamRules.map((streamRule) => (\n \n ));\n }\n\n return No rules defined.;\n };\n\n render() {\n const { stream } = this.props;\n\n if (stream) {\n const streamRules = this._formatStreamRules(stream.rules);\n\n return (\n \n {streamRules}\n \n );\n }\n\n return ;\n }\n}\n\nexport default StreamRuleList;\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 * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Icon } from 'components/common';\n\ntype Props = {\n children: React.ReactNode,\n className?: string,\n};\n\nconst Description = styled.div`\n display: inline-flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst IconStack = styled.div(({ theme }) => css`\n position: relative;\n min-width: 2.5em;\n \n .fa-stack-1x {\n color: ${theme.colors.global.textAlt};\n }\n \n .fa-stack-2x {\n color: ${theme.colors.global.textDefault};\n }\n`);\n\nconst Content = styled.p`\n font-weight: bold;\n margin: 0;\n`;\n\nconst SmallSupportLink = ({ children, className }: Props) => {\n return (\n \n \n \n \n \n\n \n {children}\n \n \n );\n};\n\nSmallSupportLink.propTypes = {\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n};\n\nSmallSupportLink.defaultProps = {\n className: undefined,\n};\n\nexport default SmallSupportLink;\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 lodash from 'lodash';\n\nimport fetch from 'logic/rest/FetchProvider';\nimport ApiRoutes from 'routing/ApiRoutes';\nimport * as URLUtils from 'util/URLUtils';\nimport UserNotification from 'util/UserNotification';\nimport { singletonStore } from 'logic/singleton';\n\ntype StreamRule = {\n field: string,\n type: number,\n value: string,\n inverted: boolean,\n description: string,\n};\n\ntype Callback = {\n (): void,\n};\n\n// eslint-disable-next-line import/prefer-default-export\nexport const StreamRulesStore = singletonStore(\n 'core.StreamRules',\n () => Reflux.createStore({\n callbacks: [],\n\n types() {\n const url = '/streams/null/rules/types';\n const promise = fetch('GET', URLUtils.qualifyUrl(url));\n\n return promise;\n },\n update(streamId: string, streamRuleId: string, data: StreamRule, callback: (() => void)) {\n const failCallback = (error) => {\n UserNotification.error(`Updating Stream Rule failed with status: ${error}`,\n 'Could not update Stream Rule');\n };\n\n const url = URLUtils.qualifyUrl(ApiRoutes.StreamRulesApiController.update(streamId, streamRuleId).url);\n const request = {\n field: data.field,\n type: data.type,\n value: data.value,\n inverted: data.inverted,\n description: data.description,\n };\n\n fetch('PUT', url, request)\n .then(callback, failCallback)\n .then(this._emitChange.bind(this));\n },\n remove(streamId: string, streamRuleId: string, callback: (() => void)) {\n const failCallback = (error) => {\n UserNotification.error(`Deleting Stream Rule failed with status: ${error}`,\n 'Could not delete Stream Rule');\n };\n\n const url = URLUtils.qualifyUrl(ApiRoutes.StreamRulesApiController.delete(streamId, streamRuleId).url);\n\n fetch('DELETE', url)\n .then(callback, failCallback)\n .then(this._emitChange.bind(this));\n },\n create(streamId: string, data: StreamRule, callback: (() => void)) {\n const failCallback = (error) => {\n UserNotification.error(`Creating Stream Rule failed with status: ${error}`,\n 'Could not create Stream Rule');\n };\n\n const url = URLUtils.qualifyUrl(ApiRoutes.StreamRulesApiController.create(streamId).url);\n\n fetch('POST', url, data)\n .then(callback, failCallback)\n .then(this._emitChange.bind(this));\n },\n onChange(callback: Callback) {\n this.callbacks.push(callback);\n },\n _emitChange() {\n this.callbacks.forEach((callback) => callback());\n },\n unregister(callback: Callback) {\n lodash.pull(this.callbacks, callback);\n },\n }),\n);\n"],"names":["HumanReadableStreamRule","type","streamRuleTypes","filter","streamRuleType","String","id","inputId","props","inputs","find","input","streamRule","MATCH_INPUT","_findInput","value","title","name","FIELD_PRESENCE_RULE_TYPE","EMPTY_TAG","field","this","_getTypeForInteger","negation","inverted","longDesc","long_desc","ALWAYS_MATCH_RULE_TYPE","_formatRuleField","_formatRuleValue","React","propTypes","PropTypes","defaultProps","StreamRuleForm","state","PLACEHOLDER_INPUT","setState","error","currentStreamRule","onSubmit","onClose","_validateMatchInput","key","short_desc","event","updatedStreamRule","target","FormsUtils","bsStyle","length","undefined","help","required","label","onChange","handleChange","map","_formatInputOptions","defaultValue","autoFocus","InputsActions","description","ruleTypes","_formatStreamRuleType","fieldBox","valueBox","show","onCancel","onModalClose","onSubmitForm","_onSubmit","submitButtonText","formProps","md","checked","bsSize","className","href","Version","rel","page","DocsHelper","text","connect","InputsStore","ActionButtonsWrap","styled","StreamRule","matchData","permissions","stream","onDelete","useState","showStreamRuleForm","setShowStreamRuleForm","useStore","useEffect","_onEdit","preventDefault","_onDelete","window","confirm","StreamRulesStore","UserNotification","actionItems","isPermitted","onClick","listGroupStyle","isEmpty","rules","streamRuleId","data","matches","StreamRuleList","streamRules","_formatStreamRules","componentClass","Description","IconStack","theme","css","colors","global","textAlt","textDefault","Content","SmallSupportLink","children","singletonStore","Reflux","callbacks","types","fetch","URLUtils","update","streamId","callback","url","ApiRoutes","request","then","_emitChange","bind","remove","create","push","forEach","unregister","lodash"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy