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

ber-security.graylog.graylog-plugin-correlation-count.6.0.0.source-code.bf9ab447-422.74c73d7e5a61d66bcbd1.js.map Maven / Gradle / Ivy

There is a newer version: 5.1.3
Show newest version
{"version":3,"file":"bf9ab447-422.74c73d7e5a61d66bcbd1.js","mappings":"8WAkBA,IAAIA,EAAmB,GAEhB,MAAMC,UAA+B,IAAI,QAAQ,+BAA+B,EAAE,kBAAmB,CAC1G,aAAc,CACZ,MAAM,EAKN,MAAMC,EAAgB,KAAK,oBAAoB,CAC7C,oBAAqB,QACrB,eAAgB,WAChB,mBAAoBF,EACpB,QARe,yBASf,oBAPuB,mBAQzB,EAAG,YAAY,EAEf,KAAK,OAAS,CACZ,MAAO,CACL,CACE,MAAO,UACP,MAAO,WACT,EACA,CACE,MAAO,UACP,MAAO,SACP,KAAM,SACR,EACA,CACE,MAAO,SACP,MAAO,oCACT,EACA,CACE,MAAO,SACP,MAAO,oCACT,EACA,CACE,MAAO,mBACP,MAAO,iEACT,EACA,CACE,MAAO,mBACP,MAAO,oEACT,EACA,CACE,MAAO,4BACP,MAAO,mBACT,EACA,CACE,MAAO,yBACP,MAAO,IACT,EACA,CACE,MAAOE,EACP,MAAO,6BACT,EACA,CACE,MAAO,OACP,MAAO,MACT,CACF,EACA,QAAS,CACP,CACE,MAAO,UACP,MAAO,SACP,KAAM,OACR,EAAG,CACD,aAAc,SAChB,CACF,CACF,CACF,CACF,CAEe,MAAMC,UAA0B,IAAI,QAAQ,eAAe,EAAE,IAAK,CAC/E,YAAYC,EAAM,CAChB,MAAMA,CAAI,EAEVJ,EAAmBI,EACnB,KAAK,eAAiBH,CACxB,CACF,C,sLC3DA,MAAMI,EAAsB,UAAO,IAAoB,CAAC,CAAE,WAAAC,EAAY,MAAAC,CAAM,OAAM;AAAA;AAAA;AAAA,eAGnED,EAAa,QAAU,MAAM;AAAA;AAAA;AAAA,IAGxCC,EAAM,WAAW,SAAS;AAAA;AAAA;AAAA;AAA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MAAO,IACP,YAAa,EACf,EA4LF,QAAeA,C,gCCxWf,IAAI,OAAO,oBAAqB,CAAC,UAAW,UAAW,SAAU,aAAa,EAAG,CAACmC,EAASC,IAAY,CAErGA,EAAQ,QAAU,GAElBA,EAAQ,SAAW,cAEPD,EAAQ,YAAY,EAC5B,gBAAgBC,EAAQ,QAASA,EAAQ,QAAQ,CACvD,CAAC,EAEA,UAAY,CACX,IAAI,QAAQ,CAAC,mBAAmB,EAAIC,GAAM,CACyBC,IAC/DA,EAAO,QAAUD,EAErB,CAAC,CACH,EAAE,C","sources":["webpack://CorrelationCount/../graylog2-server/graylog2-web-interface/src/components/rules/mode-pipeline.js","webpack://CorrelationCount/../graylog2-server/graylog2-web-interface/src/components/common/SourceCodeEditor.tsx","webpack://CorrelationCount/../graylog2-server/graylog2-web-interface/src/components/common/ace/theme-graylog.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 */\n/* global ace */\n\nlet builtinFunctions = '';\n\nexport class PipelineHighlightRules extends ace.require('ace/mode/text_highlight_rules').TextHighlightRules {\n  constructor() {\n    super();\n    const keywords = 'let|when|then|rule|end';\n\n    const builtinConstants = 'and|or|not|during';\n\n    const keywordMapper = this.createKeywordMapper({\n      'variable.language': 'stage',\n      'support.type': '$message',\n      'support.function': builtinFunctions,\n      keyword: keywords,\n      'constant.language': builtinConstants,\n    }, 'identifier');\n\n    this.$rules = {\n      start: [\n        {\n          token: 'comment',\n          regex: '\\\\/\\\\/.*$',\n        },\n        {\n          token: 'comment', // multi line comment\n          regex: '\\\\/\\\\*',\n          next: 'comment',\n        },\n        {\n          token: 'string', // single line\n          regex: '[\"](?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?[\"]',\n        },\n        {\n          token: 'string', // single line\n          regex: \"['](?:(?:\\\\\\\\.)|(?:[^'\\\\\\\\]))*?[']\",\n        },\n        {\n          token: 'constant.numeric', // hex\n          regex: /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\\b/,\n        },\n        {\n          token: 'constant.numeric', // float\n          regex: /[+-]?\\d[\\d_]*(?:(?:\\.[\\d_]*)?(?:[eE][+-]?[\\d_]+)?)?[LlSsDdFfYy]?\\b/,\n        },\n        {\n          token: 'constant.language.boolean',\n          regex: '(?:true|false)\\\\b',\n        },\n        {\n          token: 'language.support.class',\n          regex: '&&',\n        },\n        {\n          token: keywordMapper,\n          regex: '[a-zA-Z_$][a-zA-Z0-9_$]*\\\\b',\n        },\n        {\n          token: 'text',\n          regex: '\\\\s+',\n        },\n      ],\n      comment: [\n        {\n          token: 'comment', // closing comment\n          regex: '\\\\*\\\\/',\n          next: 'start',\n        }, {\n          defaultToken: 'comment',\n        },\n      ],\n    };\n  }\n}\n\nexport default class PipelineRulesMode extends ace.require('ace/mode/text').Mode {\n  constructor(args) {\n    super(args);\n\n    builtinFunctions = args;\n    this.HighlightRules = PipelineHighlightRules;\n  }\n}\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 isFinite from 'lodash/isFinite';\nimport PropTypes from 'prop-types';\nimport { Resizable } from 'react-resizable';\nimport AceEditor from 'react-ace';\nimport styled, { css } from 'styled-components';\nimport type { IAnnotation } from 'react-ace';\n\nimport { qualifyUrl } from 'util/URLUtils';\nimport ApiRoutes from 'routing/ApiRoutes';\nimport fetch from 'logic/rest/FetchProvider';\nimport OverlayTrigger from 'components/common/OverlayTrigger';\nimport { Button, ButtonGroup, ButtonToolbar } from 'components/bootstrap';\nimport PipelineRulesMode from 'components/rules/mode-pipeline';\n\nimport ClipboardButton from './ClipboardButton';\nimport Icon from './Icon';\n\nimport './webpack-resolver';\nimport './ace/theme-graylog';\n\ntype ContainerProps = {\n  $resizable: boolean\n}\nconst SourceCodeContainer = styled.div(({ $resizable, theme }) => css`\n  .react-resizable-handle {\n    z-index: 100; /* Ensure resize handle is over text editor */\n    display: ${$resizable ? 'block' : 'none'};\n  }\n\n  ${theme.components.aceEditor}\n  .ace-graylog {\n    .ace_marker-layer {\n      .ace_active-line {\n        background: ${theme.colors.variant.lightest.default};\n      }\n    }\n    .ace_gutter-active-line {\n      background-color: ${theme.colors.variant.lightest.default};\n    }\n    .ace_gutter {\n      background: ${theme.colors.variant.lighter.default};\n    }\n    .ace_cursor {\n      border-color: ${theme.colors.global.textDefault};\n    }\n  }\n`);\n\nconst Toolbar = styled.div(({ theme }) => css`\n  background: ${theme.colors.global.contentBackground};\n  border: 1px solid ${theme.colors.gray[80]};\n  border-bottom: 0;\n  border-radius: 5px 5px 0 0;\n\n  .btn-link {\n    color: ${theme.colors.variant.dark.info};\n\n    &:hover {\n      color: ${theme.colors.variant.darkest.info};\n      background-color: ${theme.colors.variant.lightest.info};\n    }\n\n    &.disabled,\n    &[disabled] {\n      color: ${theme.colors.variant.light.default};\n\n      &:hover {\n        color: ${theme.colors.variant.light.default};\n      }\n    }\n  }\n\n  & + ${SourceCodeContainer} {\n    /* Do not add border radius if code editor comes after toolbar */\n    .ace_editor {\n      border-radius: 0 0 5px 5px;\n    }\n  }\n`);\n\nconst availableModes = ['json', 'lua', 'markdown', 'text', 'yaml', 'pipeline'] as const;\n\n/**\n * Component that renders a source code editor input. This is what powers the pipeline rules and collector\n * editors.\n *\n * **Note:** The component needs to be used in a [controlled way](https://reactjs.org/docs/forms.html#controlled-components).\n * Letting the component handle its own internal state may lead to weird errors while typing.\n */\ntype Props = {\n  annotations: Array,\n  focus?: boolean,\n  fontSize?: number,\n  height?: number,\n  width?: number,\n  id: string,\n  innerRef?: React.MutableRefObject,\n  mode: typeof availableModes[number],\n  onLoad: () => void,\n  onChange: () => void,\n  onBlur: () => void,\n  readOnly?: boolean,\n  resizable?: boolean,\n  toolbar?: boolean,\n  value?: string,\n  wrapEnabled?: boolean,\n}\n\ntype State = {\n  height?: number,\n  width?: number,\n  selectedText?: string,\n}\n\nclass SourceCodeEditor extends React.Component {\n  static propTypes = {\n    /**\n     * Annotations to show in the editor's gutter. The format should be:\n     * `[{ row: 0, column: 2, type: 'error', text: 'Some error.'}]`\n     * The type value must be one of `error`, `warning`, or `info`.\n     */\n    annotations: PropTypes.array,\n    /** Specifies if the source code editor should have the input focus or not. */\n    focus: PropTypes.bool,\n    /** Specifies the font size in pixels to use in the text editor. */\n    fontSize: PropTypes.number,\n    /** Editor height in pixels. */\n    height: PropTypes.number,\n    /** Specifies a unique ID for the source code editor. */\n    id: PropTypes.string.isRequired,\n    /** Provides a ref associated to AceEditor component */\n    innerRef: PropTypes.oneOfType([\n      PropTypes.func,\n      PropTypes.shape({ current: PropTypes.any }),\n    ]),\n    /** Specifies the mode to use in the editor. This is used for highlighting and auto-completion. */\n    mode: PropTypes.oneOf(availableModes),\n    /** Function called on editor load. The first argument is the instance of the editor. */\n    onLoad: PropTypes.func,\n    /** Function called when the value of the text changes. It receives the new value and an event as arguments. */\n    onChange: PropTypes.func,\n    /** Function called when the editor loses focus. */\n    onBlur: PropTypes.func,\n    /** Specifies if the editor should be in read-only mode. */\n    readOnly: PropTypes.bool,\n    /** Specifies if the editor should be resizable by the user. */\n    resizable: PropTypes.bool,\n    /** Specifies if the editor should also include a toolbar. */\n    toolbar: PropTypes.bool,\n    /** Text to use in the editor. */\n    value: PropTypes.string,\n    /** Editor width in pixels. Use `Infinity` to indicate the editor should use 100% of its container's width. */\n    width: PropTypes.number,\n    /** Specifies if the editor should wrap text or use horizontal scrolling. */\n    wrapEnabled: PropTypes.bool,\n  };\n\n  static defaultProps = {\n    annotations: [],\n    focus: false,\n    fontSize: 13,\n    height: 200,\n    innerRef: undefined,\n    mode: 'text',\n    onChange: () => {},\n    onBlur: () => {},\n    onLoad: () => {},\n    readOnly: false,\n    resizable: true,\n    toolbar: true,\n    value: undefined,\n    width: Infinity,\n    wrapEnabled: false,\n  };\n\n  private reactAce: AceEditor;\n\n  private readonly overlayContainerRef: React.RefObject;\n\n  constructor(props) {\n    super(props);\n\n    this.state = {\n      height: props.height,\n      width: props.width,\n      selectedText: '',\n    };\n\n    this.overlayContainerRef = React.createRef();\n  }\n\n  componentDidMount() {\n    const { mode } = this.props;\n\n    if (mode === 'pipeline') {\n      const url = qualifyUrl(ApiRoutes.RulesController.functions().url);\n\n      fetch('GET', url).then((response) => {\n        if (!Array.isArray(response)) return '';\n\n        const functions = response.map((res) => res.name).join('|');\n        const pipelineRulesMode = new PipelineRulesMode(functions);\n\n        this.reactAce.editor.getSession().setMode(pipelineRulesMode);\n\n        return functions;\n      });\n    }\n  }\n\n  componentDidUpdate(prevProps) {\n    const { height, width } = this.props;\n\n    if (height !== prevProps.height || width !== prevProps.width) {\n      this.reloadEditor();\n    }\n  }\n\n  handleResize = (_event: React.ChangeEvent, { size }) => {\n    const { height, width } = size;\n\n    this.setState({ height: height, width: width }, this.reloadEditor);\n  };\n\n  reloadEditor = () => {\n    const { resizable } = this.props;\n\n    if (resizable) {\n      this.reactAce.editor.resize();\n    }\n  };\n\n  isCopyDisabled = () => this.props.readOnly || this.state.selectedText === '';\n\n  isPasteDisabled = () => this.props.readOnly;\n\n  isRedoDisabled = () => this.props.readOnly || !this.reactAce || !this.reactAce.editor.getSession().getUndoManager().hasRedo();\n\n  isUndoDisabled = () => this.props.readOnly || !this.reactAce || !this.reactAce.editor.getSession().getUndoManager().hasUndo();\n\n  handleRedo = () => {\n    this.reactAce.editor.redo();\n    this.focusEditor();\n  };\n\n  handleUndo = () => {\n    this.reactAce.editor.undo();\n    this.focusEditor();\n  };\n\n  handleSelectionChange = (selection) => {\n    const { toolbar, readOnly } = this.props;\n\n    if (!this.reactAce || !toolbar || readOnly) {\n      return;\n    }\n\n    const selectedText = this.reactAce.editor.getSession().getTextRange(selection.getRange());\n\n    this.setState({ selectedText: selectedText });\n  };\n\n  focusEditor = () => {\n    this.reactAce.editor.focus();\n  };\n\n  render() {\n    const { height, width, selectedText } = this.state;\n    const {\n      resizable,\n      toolbar,\n      annotations,\n      focus,\n      fontSize,\n      mode,\n      id,\n      innerRef,\n      onLoad,\n      onChange,\n      onBlur,\n      readOnly,\n      value,\n      wrapEnabled,\n    } = this.props;\n    const validCssWidth = isFinite(width) ? width : '100%';\n    const overlay = <>Press Ctrl+V (⌘V in macOS) or select Edit → Paste to paste from clipboard.;\n\n    return (\n      
\n {toolbar\n && (\n \n \n \n }\n bsStyle=\"link\"\n bsSize=\"sm\"\n onSuccess={this.focusEditor}\n text={selectedText}\n buttonTitle=\"Copy (Ctrl+C / ⌘C)\"\n disabled={this.isCopyDisabled()} />\n \n \n \n \n \n \n \n \n \n \n )}\n \n \n {\n this.reactAce = c;\n if (innerRef) { innerRef.current = c; }\n }}\n annotations={annotations}\n // Convert Windows line breaks to Unix. See issue #7889\n // @ts-expect-error\n setOptions={{ newLineMode: 'unix' }}\n focus={focus}\n fontSize={fontSize}\n mode={mode}\n theme=\"graylog\"\n name={id}\n height=\"100%\"\n onLoad={onLoad}\n onChange={onChange}\n onBlur={onBlur}\n onSelectionChange={this.handleSelectionChange}\n readOnly={readOnly}\n value={value}\n width=\"100%\"\n wrapEnabled={wrapEnabled} />\n \n \n
\n );\n }\n}\n\nexport default SourceCodeEditor;\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 */\n/* global ace */\n\nace.define('ace/theme/graylog', ['require', 'exports', 'module', 'ace/lib/dom'], (require, exports) => {\n // CSS found in `components/common/SourceCodeEditor.jsx`\n exports.cssText = ''; // eslint-disable-line no-param-reassign\n\n exports.cssClass = 'ace-graylog'; // eslint-disable-line no-param-reassign\n\n const dom = require('../lib/dom');\n dom.importCssString(exports.cssText, exports.cssClass);\n});\n\n(function () { // eslint-disable-line func-names\n ace.require(['ace/theme/graylog'], (m) => {\n if (typeof module === 'object' && typeof exports === 'object' && module) {\n module.exports = m;\n }\n });\n}());\n"],"names":["builtinFunctions","PipelineHighlightRules","keywordMapper","PipelineRulesMode","args","SourceCodeContainer","$resizable","theme","Toolbar","availableModes","SourceCodeEditor","props","_event","size","height","width","resizable","selection","toolbar","readOnly","selectedText","mode","url","ApiRoutes","response","functions","res","pipelineRulesMode","prevProps","annotations","focus","fontSize","id","innerRef","onLoad","onChange","onBlur","value","wrapEnabled","validCssWidth","overlay","ClipboardButton","Icon","OverlayTrigger","c","require","exports","m","module"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy