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AAoB,IAAC,EACtB,gBAAC,MAAW,MAAO,SAASA,EAAgB,KAAK,qBACrC,QACE,gBAAC,gBAAa,KACX4C,GACD,gBAAC,KAAW,CAAC,YAAa,yBAAyBF,EAAO,YAAY,IACpE,gBAAC,IAAa,CAAC,GAAI,KAAO,OAAO,YAAY,KAAKA,EAAO,YAAY,GACnE,gBAAC,SAAM,CAAC,QAAQ,WAAU,uBAAqB,CACjD,CACF,EAEC,CAACD,EAAwB,GAC1B,gBAAC,KAAW,CAAC,YAAY,2BACvB,gBAAC,SAAM,CAAC,QAAS,IAAMM,EAAc,EAAI,EAAG,QAAQ,WAAU,4BAE9D,CACF,CAEF,EAEF,kBAAmB,CACjB,MAAO,uBACP,KAAM,IAAW,MAAM,MACzB,GACV,gBAAC,YAAK,2FAEN,CACF,EAEA,gBAAC,MAAG,CAAC,UAAU,WACb,gBAAC,MAAG,CAAC,GAAI,IACP,gBAAC,KAAuB,gBAAA/C,EACA,YAAAE,EACA,cAAAD,CAAA,CAA8B,CACxD,CACF,CACF,EACC6C,GACD,gBAAC,MAAc,MAAM,wBACN,KAAI,GACJ,UAAW,IAAMO,EAAqB,EACtC,SAAU,IAAMN,EAAc,EAAK,GAC/C,8CAA8C/C,EAAgB,KAAK,IACtE,CAEF,CAEJ,C","sources":["webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css","webpack://graylog-web-interface/./src/components/event-definitions/constants.ts","webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionValidationSummary.tsx","webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionSummary.css?9f94","webpack://graylog-web-interface/./src/components/event-definitions/event-definition-form/EventDefinitionSummary.tsx","webpack://graylog-web-interface/./src/logic/alerts/EventDefinitionPriorityEnum.js","webpack://graylog-web-interface/./src/pages/ViewEventDefinitionPage.tsx"],"sourcesContent":["// 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","/*\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 type { Sort } from 'stores/PaginationTypes';\n\nexport const SYSTEM_EVENT_DEFINITION_TYPE = 'system-notifications-v1';\n\nexport const ENTITY_TABLE_ID = 'event_definitions';\nexport const DEFAULT_LAYOUT = {\n pageSize: 20,\n sort: { attributeId: 'title', direction: 'asc' } as Sort,\n displayedColumns: ['title', 'description', 'priority', 'scheduling', 'status', 'matched_at'],\n columnsOrder: ['title', 'description', 'priority', 'matched_at', 'status', 'scheduling'],\n};\n\nexport const ADDITIONAL_ATTRIBUTES = [\n { id: 'scheduling', title: 'Scheduling', sortable: false },\n { id: 'matched_at', title: 'Last Matched', sortable: true },\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 PropTypes from 'prop-types';\n\nimport { Alert, Col, Row } from 'components/bootstrap';\n\nimport commonStyles from '../common/commonStyles.css';\n\ntype Props = {\n validation: {\n errors: {\n [name: string]: any\n }\n },\n}\n\nconst EventDefinitionValidationSummary = ({ validation }: 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 Please correct the following errors before saving this Event Definition:
\n \n {fieldsWithErrors.map((field) => 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\nEventDefinitionValidationSummary.propTypes = {\n validation: PropTypes.object,\n};\n\nEventDefinitionValidationSummary.defaultProps = {\n validation: {\n errors: [],\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[4].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[4].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 * as React from 'react';\nimport { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport upperFirst from 'lodash/upperFirst';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\nimport moment from 'moment';\n\nimport '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';\nimport type User from 'logic/users/User';\n\nimport EventDefinitionValidationSummary from './EventDefinitionValidationSummary';\nimport styles from './EventDefinitionSummary.css';\n\nimport type { EventDefinition } from '../event-definitions-types';\nimport commonStyles from '../common/commonStyles.css';\nimport { SYSTEM_EVENT_DEFINITION_TYPE } from '../constants';\n\n// Import built-in plugins\nimport 'components/event-definitions/event-definition-types';\nimport 'components/event-notifications/event-notification-types';\n\ntype Props = {\n eventDefinition: Omit,\n notifications: Array,\n validation: {\n errors: {\n title?: string,\n }\n },\n currentUser: User,\n}\n\nconst EventDefinitionSummary = ({ eventDefinition, notifications, validation, currentUser }: Props) => {\n const [showValidation, setShowValidation] = useState(false);\n\n useEffect(() => {\n const flipShowValidation = () => {\n if (!showValidation) {\n setShowValidation(true);\n }\n };\n\n flipShowValidation();\n }, [showValidation, setShowValidation]);\n\n const renderDetails = () => (\n <>\n Details
\n \n - Title
\n - {eventDefinition.title || 'No title given'}
\n - Description
\n - {eventDefinition.description || 'No description given'}
\n - Priority
\n - {upperFirst(EventDefinitionPriorityEnum.properties[eventDefinition.priority].name)}
\n
\n >\n );\n\n const getPlugin = (name, type) => {\n if (type === undefined) {\n return {};\n }\n\n return PluginStore.exports(name).find((edt) => edt.type === type) || {};\n };\n\n const renderCondition = (config) => {\n const conditionPlugin = getPlugin('eventDefinitionTypes', config.type);\n const component = (conditionPlugin.summaryComponent\n ? React.createElement(conditionPlugin.summaryComponent, {\n config,\n 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 const renderField = (fieldName, config, keys) => {\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 = getPlugin('fieldValueProviders', provider.type);\n\n return (fieldProviderPlugin.summaryComponent\n ? React.createElement(fieldProviderPlugin.summaryComponent, {\n fieldName,\n config,\n keys: keys,\n key: fieldName,\n currentUser,\n })\n : Provider plugin {provider.type} does not provide a summary.
\n );\n };\n\n const renderFieldList = (fieldNames, fields, keys) => (\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) => renderField(fieldName, fields[fieldName], keys))}\n >\n );\n\n const 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 : renderFieldList(fieldNames, fields, keys)}\n >\n );\n };\n\n const renderNotification = (definitionNotification) => {\n const notification = notifications.find((n) => n.id === definitionNotification.notification_id);\n\n let content;\n\n if (notification) {\n const notificationPlugin = 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 const 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 const renderNotifications = (definitionNotifications, notificationSettings) => {\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 {renderNotificationSettings(notificationSettings)}\n {definitionNotifications.map(renderNotification)}\n >\n )}\n >\n );\n };\n\n const isSystemEventDefinition = eventDefinition.config.type === SYSTEM_EVENT_DEFINITION_TYPE;\n\n return (\n \n \n Event Summary
\n {showValidation && }\n \n \n {renderDetails()}\n \n\n {!isSystemEventDefinition && (\n \n {renderCondition(eventDefinition.config)}\n \n )}\n
\n \n {!isSystemEventDefinition && (\n \n {renderFields(eventDefinition.field_spec, eventDefinition.key_spec)}\n \n )}\n \n {renderNotifications(eventDefinition.notifications, eventDefinition.notification_settings)}\n \n
\n \n
\n );\n};\n\nEventDefinitionSummary.propTypes = {\n eventDefinition: PropTypes.object.isRequired,\n notifications: PropTypes.array.isRequired,\n validation: PropTypes.object,\n currentUser: PropTypes.object.isRequired,\n};\n\nEventDefinitionSummary.defaultProps = {\n validation: undefined,\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 { useNavigate, 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, ConfirmDialog } from 'components/common';\nimport useCurrentUser from 'hooks/useCurrentUser';\nimport { isPermitted } from 'util/PermissionsMixin';\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';\nimport useHistory from 'routing/useHistory';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport type { EventDefinition } from 'components/event-definitions/event-definitions-types';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\n\nconst ViewEventDefinitionPage = () => {\n const params = useParams<{ definitionId?: string }>();\n const currentUser = useCurrentUser();\n const [eventDefinition, setEventDefinition] = useState();\n const [isMutable, setIsMutable] = useState(true);\n const [showDialog, setShowDialog] = useState(false);\n const { all: notifications } = useStore(EventNotificationsStore);\n const history = useHistory();\n const sendTelemetry = useSendTelemetry();\n const navigate = useNavigate();\n\n const isSystemEventDefinition = (): boolean => eventDefinition?.config?.type === 'system-notifications-v1';\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 setIsMutable(response.is_mutable);\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, history, params]);\n\n const handleDuplicateEvent = () => {\n sendTelemetry(TELEMETRY_EVENT_TYPE.EVENTDEFINITION_DUPLICATED, {\n app_pathname: 'event-definition',\n });\n\n EventDefinitionsActions.copy(eventDefinition).then((duplicatedEvent) => {\n navigate(Routes.ALERTS.DEFINITIONS.edit(duplicatedEvent.id));\n });\n };\n\n if (!eventDefinition || !notifications) {\n return (\n \n \n \n \n \n \n \n );\n }\n\n return (\n <>\n \n \n \n {isMutable && (\n \n \n \n \n \n )}\n {!isSystemEventDefinition() && (\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 {showDialog && (\n handleDuplicateEvent()}\n onCancel={() => setShowDialog(false)}>\n {`Are you sure you want to create a copy of \"${eventDefinition.title}\"?`}\n \n )}\n >\n );\n};\n\nexport default ViewEventDefinitionPage;\n"],"names":["___CSS_LOADER_EXPORT___","module","SYSTEM_EVENT_DEFINITION_TYPE","ENTITY_TABLE_ID","DEFAULT_LAYOUT","ADDITIONAL_ATTRIBUTES","EventDefinitionValidationSummary","validation","fieldsWithErrors","commonStyles","field","error","effectiveError","options","update","eventDefinition","notifications","currentUser","showValidation","setShowValidation","renderDetails","EventDefinitionPriorityEnum","getPlugin","name","type","edt","renderCondition","config","conditionPlugin","component","renderField","fieldName","keys","provider","fieldProviderPlugin","renderFieldList","fieldNames","fields","renderFields","renderNotification","definitionNotification","notification","n","content","notificationPlugin","renderNotificationSettings","notificationSettings","formattedDuration","formattedGracePeriod","formattedBacklogSize","renderNotifications","definitionNotifications","effectiveDefinitionNotifications","notificationsWithMissingPermissions","nObj","warning","isSystemEventDefinition","params","setEventDefinition","isMutable","setIsMutable","showDialog","setShowDialog","history","sendTelemetry","navigate","response","eventDefinitionResp","handleDuplicateEvent","duplicatedEvent"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy