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

web-interface.assets.325e2d4b-7738.af5d820a997f01eb3da1.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
{"version":3,"file":"325e2d4b-7738.af5d820a997f01eb3da1.js","mappings":"iZAuBA,MAAMA,UAAyCC,EAAAA,UAK7CC,SACE,MAAM,WAAEC,EAAa,CAAC,GAAMC,KAAKC,MAC3BC,EAAmBC,OAAOC,KAAKL,EAAWM,QAEhD,OAAgC,IAA5BH,EAAiBI,OACZ,KAIP,gBAAC,KAAD,KACE,gBAAC,KAAD,CAAKC,GAAI,IACP,gBAAC,KAAD,CAAOC,QAAQ,SAASC,UAAWC,EAAAA,EAAAA,mBACjC,mDACA,qGACA,0BACGR,EAAiBS,KAAKC,GACdb,EAAWM,OAAOO,GAAOD,KAAKE,IACnC,MAAMC,EAA4B,WAAVF,EAAqBC,EAAME,QAAQ,SAAU,aAAeF,EAEpF,OAAO,sBAAIG,IAAM,GAAEJ,KAASE,KAAmBA,EAA/C,SAQf,E,EAhCGlB,E,EAAAA,Y,EACe,CACjBG,WAAYkB,IAAAA,OAAAA,Y,6FAiChB,U,0KC/CIC,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKnB,QAAe,KAAW,WAAiB,gBAAiBM,E,wHCWnE,MAAMC,UAA+B5B,EAAAA,UAYnC6B,YAAYzB,GACV0B,MAAM1B,GADW,yBAYF,KACf,MAAM,eAAE2B,GAAmB5B,KAAK6B,MAE3BD,GACH5B,KAAK8B,SAAS,CAAEF,gBAAgB,GACjC,IAjBgB,wBAoBFG,GAEb,gCACE,sBAAItB,UAAWC,EAAAA,EAAAA,OAAf,WACA,0BACE,mCACA,0BAAKqB,EAAgBC,OAAS,kBAC9B,yCACA,0BAAKD,EAAgBE,aAAe,w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AAKF,GAAI,IACP,gBAAC,IAAD,CAAwBwB,gBAAiBA,EACjBY,YAAaA,EACbkB,cAAeA,OApC3C,gBAAC,KAAD,CAAe7B,MAAM,yBACnB,4BACE,gBAAC,KAAD,CAAYA,MAAM,yBAChB,gBAAC,KAAD,CAASkG,KAAK,kCAOxB,C,qFCzEEC,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOrE,GAAI,uFAAwF,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,iGAAiG,MAAQ,GAAG,SAAW,sCAAsC,eAAiB,CAAC,wFAAwF,WAAa,MAEhbmE,EAAwBG,OAAS,CAChC,aAAgB,wBAEjB,S","sources":["webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionValidationSummary.jsx","webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css?c2b0","webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionSummary.jsx","webpack://graylog-web-interface/./src/logic/alerts/EventDefinitionPriorityEnum.js","webpack://graylog-web-interface/./src/pages/ViewEventDefinitionPage.tsx","webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css"],"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/bootstrap';\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","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./EventDefinitionSummary.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!./EventDefinitionSummary.css\";\n export default content && content.locals ? content.locals : undefined;\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 PropTypes from 'prop-types';\nimport lodash from 'lodash';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\nimport moment from 'moment';\n\nimport {} from 'moment-duration-format';\nimport { defaultCompare as naturalSort } from 'logic/DefaultCompare';\nimport { Alert, Col, Row } from 'components/bootstrap';\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 */\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","/*\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 } from 'react';\nimport { useParams } from 'react-router-dom';\n\nimport { useStore } from 'stores/connect';\nimport { LinkContainer } from 'components/common/router';\nimport { ButtonToolbar, Col, Row, Button } from 'components/bootstrap';\nimport Routes from 'routing/Routes';\nimport DocsHelper from 'util/DocsHelper';\nimport { DocumentTitle, IfPermitted, PageHeader, Spinner } from 'components/common';\nimport useCurrentUser from 'hooks/useCurrentUser';\nimport { isPermitted } from 'util/PermissionsMixin';\nimport history from 'util/History';\nimport EventDefinitionSummary from 'components/event-definitions/event-definition-form/EventDefinitionSummary';\nimport { EventDefinitionsActions } from 'stores/event-definitions/EventDefinitionsStore';\nimport { EventNotificationsActions, EventNotificationsStore } from 'stores/event-notifications/EventNotificationsStore';\nimport EventsPageNavigation from 'components/events/EventsPageNavigation';\n\nconst ViewEventDefinitionPage = () => {\n const params = useParams<{definitionId?: string}>();\n const currentUser = useCurrentUser();\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 return (\n \n \n \n \n \n \n \n \n \n )}\n documentationLink={{\n title: 'Alerts documentation',\n path: DocsHelper.PAGES.ALERTS,\n }}>\n \n Event Definitions allow you to create Events from different Conditions and alert on them.\n \n \n\n \n \n \n \n \n \n );\n};\n\nexport default ViewEventDefinitionPage;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.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, \".xZzz7avfOImN5wyTQXue 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\": \"xZzz7avfOImN5wyTQXue\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["EventDefinitionValidationSummary","React","render","validation","this","props","fieldsWithErrors","Object","keys","errors","length","md","bsStyle","className","commonStyles","map","field","error","effectiveError","replace","key","PropTypes","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","undefined","EventDefinitionSummary","constructor","super","showValidation","state","setState","eventDefinition","title","description","lodash","EventDefinitionPriorityEnum","priority","name","type","PluginStore","find","edt","config","currentUser","conditionPlugin","getPlugin","component","summaryComponent","displayName","fieldName","providers","provider","fieldProviderPlugin","fieldNames","fields","join","sort","naturalSort","renderField","renderFieldList","definitionNotification","notifications","notification","n","id","notification_id","content","notificationPlugin","notificationSettings","formattedDuration","moment","grace_period_ms","format","trim","formattedGracePeriod","formattedBacklogSize","backlog_size","definitionNotifications","effectiveDefinitionNotifications","filter","isPermitted","permissions","notificationsWithMissingPermissions","nObj","includes","warning","renderNotificationSettings","renderNotification","componentDidUpdate","styles","renderDetails","mdOffset","renderCondition","renderFields","field_spec","key_spec","renderNotifications","notification_settings","LOW","NORMAL","HIGH","properties","params","useParams","useCurrentUser","setEventDefinition","useState","all","useStore","EventNotificationsStore","useEffect","definitionId","EventDefinitionsActions","then","response","eventDefinitionResp","event_definition","_is_scheduled","context","scheduler","is_scheduled","status","history","Routes","EventNotificationsActions","actions","to","documentationLink","path","DocsHelper","text","___CSS_LOADER_EXPORT___","push","module","locals"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy