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

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

There is a newer version: 6.0.1
Show newest version
{"version":3,"sources":["webpack:///./src/components/event-definitions/event-definition-form/EventDefinitionValidationSummary.jsx","webpack:///./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css?f0ca","webpack:///./src/components/event-definitions/event-definition-form/EventDefinitionSummary.jsx","webpack:///./src/pages/ViewEventDefinitionPage.tsx","webpack:///./src/logic/alerts/EventDefinitionPriorityEnum.js","webpack:///./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css"],"names":["EventDefinitionValidationSummary","this","props","validation","fieldsWithErrors","Object","keys","errors","length","md","bsStyle","className","commonStyles","validationSummary","map","field","error","effectiveError","replace","key","React","Component","PropTypes","object","isRequired","options","locals","EventDefinitionSummary","state","showValidation","setState","eventDefinition","title","description","lodash","upperFirst","EventDefinitionPriorityEnum","properties","priority","name","type","undefined","PluginStore","exports","find","edt","config","currentUser","conditionPlugin","getPlugin","component","summaryComponent","createElement","displayName","fieldName","providers","provider","fieldProviderPlugin","fieldNames","fields","join","sort","naturalSort","renderField","renderFieldList","definitionNotification","content","notification","notifications","n","id","notification_id","notificationPlugin","Fragment","notificationSettings","formattedDuration","moment","duration","grace_period_ms","format","trim","formattedGracePeriod","formattedBacklogSize","backlog_size","definitionNotifications","effectiveDefinitionNotifications","filter","isPermitted","permissions","notificationsWithMissingPermissions","nObj","includes","warning","renderNotificationSettings","renderNotification","styles","eventSummary","renderDetails","mdOffset","renderCondition","renderFields","field_spec","key_spec","renderNotifications","notification_settings","array","EventDefinitionsActions","CombinedProvider","get","EventNotificationsStore","EventNotificationsActions","withParams","params","useContext","CurrentUserContext","useState","setEventDefinition","useStore","all","useEffect","definitionId","then","response","eventDefinitionResp","event_definition","_is_scheduled","context","scheduler","is_scheduled","status","history","push","Routes","ALERTS","DEFINITIONS","LIST","listAll","page","DocsHelper","PAGES","text","to","NOTIFICATIONS","LO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EAAG,CAAE5G,KAAM,UACX6G,EAAG,CAAE7G,KAAM,W,sCCvBf,6CAGI8G,EAHJ,MAG8B,GAA4B,KAE1DA,EAAwBlB,KAAK,CAACmB,EAAOC,EAAI,0FAA2F,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iGAAiG,MAAQ,GAAG,SAAW,sCAAsC,eAAiB,CAAC,wFAAwF,WAAa,MAEnbF,EAAwB3H,OAAS,CAChC,aAAgB,2BAEF","file":"6e61897c-55.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 React from 'react';\nimport PropTypes from 'prop-types';\n\nimport { Alert, Col, Row } from 'components/graylog';\n\nimport commonStyles from '../common/commonStyles.css';\n\nclass EventDefinitionValidationSummary extends React.Component {\n  static propTypes = {\n    validation: PropTypes.object.isRequired,\n  };\n\n  render() {\n    const { validation = {} } = this.props;\n    const fieldsWithErrors = Object.keys(validation.errors);\n\n    if (fieldsWithErrors.length === 0) {\n      return null;\n    }\n\n    return (\n      \n        \n          \n            

We found some errors!

\n

Please correct the following errors before saving this Event Definition:

\n
    \n {fieldsWithErrors.map((field) => {\n return validation.errors[field].map((error) => {\n const effectiveError = (field === 'config' ? error.replace('config', 'condition') : error);\n\n return
  • {effectiveError}
  • ;\n });\n })}\n
\n
\n \n
\n );\n }\n}\n\nexport default EventDefinitionValidationSummary;\n","import api from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../node_modules/css-loader/dist/cjs.js??ref--10-1!./EventDefinitionSummary.css\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/*\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 PropTypes from 'prop-types';\nimport lodash from 'lodash';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\nimport moment from 'moment';\nimport {} from 'moment-duration-format';\nimport naturalSort from 'javascript-natural-sort';\n\nimport { Alert, Col, Row } from 'components/graylog';\nimport { isPermitted } from 'util/PermissionsMixin';\nimport EventDefinitionPriorityEnum from 'logic/alerts/EventDefinitionPriorityEnum';\n\n// Import built-in plugins\nimport {} from 'components/event-definitions/event-definition-types';\nimport {} from 'components/event-notifications/event-notification-types';\n\nimport EventDefinitionValidationSummary from './EventDefinitionValidationSummary';\nimport styles from './EventDefinitionSummary.css';\n\nimport commonStyles from '../common/commonStyles.css';\n\nclass EventDefinitionSummary extends React.Component {\n static propTypes = {\n eventDefinition: PropTypes.object.isRequired,\n notifications: PropTypes.array.isRequired,\n validation: PropTypes.object,\n currentUser: PropTypes.object.isRequired,\n };\n\n static defaultProps = {\n validation: undefined,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n showValidation: false,\n };\n }\n\n componentDidUpdate() {\n this.showValidation();\n }\n\n showValidation = () => {\n const { showValidation } = this.state;\n\n if (!showValidation) {\n this.setState({ showValidation: true });\n }\n };\n\n renderDetails = (eventDefinition) => {\n return (\n <>\n

Details

\n
\n
Title
\n
{eventDefinition.title || 'No title given'}
\n
Description
\n
{eventDefinition.description || 'No description given'}
\n
Priority
\n
{lodash.upperFirst(EventDefinitionPriorityEnum.properties[eventDefinition.priority].name)}
\n
\n \n );\n };\n\n getPlugin = (name, type) => {\n if (type === undefined) {\n return {};\n }\n\n return PluginStore.exports(name).find((edt) => edt.type === type) || {};\n };\n\n renderCondition = (config) => {\n const { currentUser } = this.props;\n const conditionPlugin = this.getPlugin('eventDefinitionTypes', config.type);\n const component = (conditionPlugin.summaryComponent\n ? React.createElement(conditionPlugin.summaryComponent, {\n config: config,\n currentUser: currentUser,\n })\n :

Condition plugin {config.type} does not provide a summary.

\n );\n\n return (\n <>\n

{conditionPlugin.displayName || config.type}

\n {component}\n \n );\n };\n\n renderField = (fieldName, config, keys) => {\n const { currentUser } = this.props;\n\n if (!config.providers || config.providers.length === 0) {\n return No field value provider configured.;\n }\n\n const provider = config.providers[0] || {};\n const fieldProviderPlugin = this.getPlugin('fieldValueProviders', provider.type);\n\n return (fieldProviderPlugin.summaryComponent\n ? React.createElement(fieldProviderPlugin.summaryComponent, {\n fieldName: fieldName,\n config: config,\n keys: keys,\n key: fieldName,\n currentUser: currentUser,\n })\n :

Provider plugin {provider.type} does not provide a summary.

\n );\n };\n\n renderFieldList = (fieldNames, fields, keys) => {\n return (\n <>\n
\n
Keys
\n
{keys.length > 0 ? keys.join(', ') : 'No Keys configured for Events based on this Definition.'}
\n
\n {fieldNames.sort(naturalSort).map((fieldName) => this.renderField(fieldName, fields[fieldName], keys))}\n \n );\n };\n\n renderFields = (fields, keys) => {\n const fieldNames = Object.keys(fields);\n\n return (\n <>\n

Fields

\n {fieldNames.length === 0\n ?

No Fields configured for Events based on this Definition.

\n : this.renderFieldList(fieldNames, fields, keys)}\n \n );\n };\n\n renderNotification = (definitionNotification) => {\n const { notifications } = this.props;\n const notification = notifications.find((n) => n.id === definitionNotification.notification_id);\n\n let content;\n\n if (notification) {\n const notificationPlugin = this.getPlugin('eventNotificationTypes', notification.config.type);\n\n content = (notificationPlugin.summaryComponent\n ? React.createElement(notificationPlugin.summaryComponent, {\n type: notificationPlugin.displayName,\n notification: notification,\n definitionNotification: definitionNotification,\n })\n :

Notification plugin {notification.config.type} does not provide a summary.

\n );\n } else {\n content = (\n

\n Could not find information for Notification {definitionNotification.notification_id}.\n

\n );\n }\n\n return (\n \n {content}\n \n );\n };\n\n renderNotificationSettings = (notificationSettings) => {\n const formattedDuration = moment.duration(notificationSettings.grace_period_ms)\n .format('d [days] h [hours] m [minutes] s [seconds]', { trim: 'all' });\n\n const formattedGracePeriod = (notificationSettings.grace_period_ms\n ? `Grace Period is set to ${formattedDuration}`\n : 'Grace Period is disabled');\n\n const formattedBacklogSize = (notificationSettings.backlog_size\n ? `Notifications will include ${notificationSettings.backlog_size} messages`\n : 'Notifications will not include any messages.');\n\n return (\n <>\n

Settings

\n
\n
{formattedGracePeriod}
\n
{formattedBacklogSize}
\n
\n \n );\n };\n\n renderNotifications = (definitionNotifications, notificationSettings) => {\n const { currentUser } = this.props;\n\n const effectiveDefinitionNotifications = definitionNotifications\n .filter((n) => isPermitted(currentUser.permissions, `eventnotifications:read:${n.notification_id}`));\n const notificationsWithMissingPermissions = definitionNotifications\n .filter((n) => !effectiveDefinitionNotifications.map((nObj) => nObj.notification_id).includes(n.notification_id));\n const warning = notificationsWithMissingPermissions.length > 0\n ? (\n \n Missing Notifications Permissions for:
\n {notificationsWithMissingPermissions.map((n) => n.notification_id).join(', ')}\n
\n )\n : null;\n\n return (\n <>\n

Notifications

\n

\n {warning}\n

\n {effectiveDefinitionNotifications.length === 0 && notificationsWithMissingPermissions.length <= 0\n ?

This Event is not configured to trigger any Notifications.

\n : (\n <>\n {this.renderNotificationSettings(notificationSettings)}\n {definitionNotifications.map(this.renderNotification)}\n \n )}\n \n );\n };\n\n render() {\n const { eventDefinition, validation } = this.props;\n const { showValidation } = this.state;\n\n return (\n \n \n

Event Summary

\n {showValidation && }\n \n \n {this.renderDetails(eventDefinition)}\n \n \n {this.renderCondition(eventDefinition.config)}\n \n \n \n \n {this.renderFields(eventDefinition.field_spec, eventDefinition.key_spec)}\n \n \n {this.renderNotifications(eventDefinition.notifications, eventDefinition.notification_settings)}\n \n \n \n
\n );\n }\n}\n\nexport default EventDefinitionSummary;\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 * as React from 'react';\nimport { useState, useEffect, useContext } from 'react';\n\nimport { useStore } from 'stores/connect';\nimport withParams from 'routing/withParams';\nimport { LinkContainer } from 'components/graylog/router';\nimport { ButtonToolbar, Col, Row, Button } from 'components/graylog';\nimport CombinedProvider from 'injection/CombinedProvider';\nimport Routes from 'routing/Routes';\nimport DocsHelper from 'util/DocsHelper';\nimport { DocumentTitle, PageHeader, Spinner } from 'components/common';\nimport CurrentUserContext from 'contexts/CurrentUserContext';\nimport DocumentationLink from 'components/support/DocumentationLink';\nimport { isPermitted } from 'util/PermissionsMixin';\nimport history from 'util/History';\nimport EventDefinitionSummary from 'components/event-definitions/event-definition-form/EventDefinitionSummary';\n\nconst { EventDefinitionsActions } = CombinedProvider.get('EventDefinitions');\nconst { EventNotificationsStore, EventNotificationsActions } = CombinedProvider.get('EventNotifications');\n\ntype Props = {\n params: {\n definitionId: string,\n },\n};\n\nconst ViewEventDefinitionPage = ({ params }: Props) => {\n const currentUser = useContext(CurrentUserContext);\n const [eventDefinition, setEventDefinition] = useState<{ title: string } | undefined>();\n const { all: notifications } = useStore(EventNotificationsStore);\n\n useEffect(() => {\n if (currentUser && isPermitted(currentUser.permissions, `eventdefinitions:read:${params.definitionId}`)) {\n EventDefinitionsActions.get(params.definitionId)\n .then(\n (response) => {\n const eventDefinitionResp = response.event_definition;\n\n // Inject an internal \"_is_scheduled\" field to indicate if the event definition should be scheduled in the\n // backend. This field will be removed in the event definitions store before sending an event definition\n // back to the server.\n eventDefinitionResp.config._is_scheduled = response.context.scheduler.is_scheduled;\n setEventDefinition(eventDefinitionResp);\n },\n (error) => {\n if (error.status === 404) {\n history.push(Routes.ALERTS.DEFINITIONS.LIST);\n }\n },\n );\n\n EventNotificationsActions.listAll();\n }\n }, [currentUser, params]);\n\n if (!eventDefinition || !notifications) {\n return (\n \n \n \n \n <>\n \n \n \n );\n }\n\n return (\n \n \n \n \n Event Definitions allow you to create Events from different Conditions and alert on them.\n \n\n \n Graylog's new Alerting system let you define more flexible and powerful rules. Learn more in the{' '}\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default withParams(ViewEventDefinitionPage);\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 */\nconst EventDefinitionPriorityEnum = {\n LOW: 1,\n NORMAL: 2,\n HIGH: 3,\n properties: {\n 1: { name: 'low' },\n 2: { name: 'normal' },\n 3: { name: 'high' },\n },\n};\n\nexport default EventDefinitionPriorityEnum;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"._2q2dz5xrzDdZeqNxSb3VmY dl dl {\\n padding-left: 10px;\\n margin-bottom: 5px;\\n}\\n\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css\"],\"names\":[],\"mappings\":\"AAAA;IACI,kBAAkB;IAClB,kBAAkB;AACtB\",\"sourcesContent\":[\":local(.eventSummary) dl dl {\\n padding-left: 10px;\\n margin-bottom: 5px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"eventSummary\": \"_2q2dz5xrzDdZeqNxSb3VmY\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy