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

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

There is a newer version: 6.0.1
Show newest version
"use strict";(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["325e2d4b-7738"],{XmWOcQPs:(e,t,n)=>{n.d(t,{Z:()=>R});var i,r,l,o=n("Z7aTuO5B"),a=n("ii0bleBb"),s=n.n(a),c=n("nHcjWeCO"),m=n.n(c),d=n("AztyBNMT"),u=n("9oVghaOd"),f=n.n(u),p=(n("gtXNkEXl"),n("6n4dw8v3")),E=n("F9olzlTR"),g=n("EUJYvlA3"),h=n("WlYEmUoB"),v=(n("nRMrOfDS"),n("BXP2KjIr"),n("4kW3fUUU"));class y extends o.Component{render(){const{validation:e={}}=this.props,t=Object.keys(e.errors);return 0===t.length?null:o.createElement(E.X2,null,o.createElement(E.JX,{md:12},o.createElement(E.bZ,{bsStyle:"danger",className:v.Z.validationSummary},o.createElement("h4",null,"We found some errors!"),o.createElement("p",null,"Please correct the following errors before saving this Event Definition:"),o.createElement("ul",null,t.map((t=>e.errors[t].map((e=>{const n="config"===t?e.replace("config","condition"):e;return o.createElement("li",{key:`${t}-${n}`},n)}))))))))}}i=y,r="propTypes",l={validation:s().object.isRequired},r in i?Object.defineProperty(i,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):i[r]=l;const N=y;var b=n("dFpwyWHg"),S=n.n(b),w=n("C2ikvoS0"),A=n.n(w),Z=n("1IntWRSu"),k=n.n(Z),D=n("8nGWeFnd"),P=n.n(D),F=n("TeAcaicX"),T=n.n(F),_=n("eE3+5goe"),C=n.n(_),O=n("R6vKwq+5"),X={};X.styleTagTransform=C(),X.setAttributes=P(),X.insert=k().bind(null,"head"),X.domAPI=A(),X.insertStyleElement=T();S()(O.Z,X);const I=O.Z&&O.Z.locals?O.Z.locals:void 0;function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class B extends o.Component{constructor(e){super(e),U(this,"showValidation",(()=>{const{showValidation:e}=this.state;e||this.setState({showValidation:!0})})),U(this,"renderDetails",(e=>o.createElement(o.Fragment,null,o.createElement("h3",{className:v.Z.title},"Details"),o.createElement("dl",null,o.createElement("dt",null,"Title"),o.createElement("dd",null,e.title||"No title given"),o.createElement("dt",null,"Description"),o.createElement("dd",null,e.description||"No description given"),o.createElement("dt",null,"Priority"),o.createElement("dd",null,m().upperFirst(h.Z.properties[e.priority].name)))))),U(this,"getPlugin",((e,t)=>void 0===t?{}:d.PluginStore.exports(e).find((e=>e.type===t))||{})),U(this,"renderCondition",(e=>{const{currentUser:t}=this.props,n=this.getPlugin("eventDefinitionTypes",e.type),i=n.summaryComponent?o.createElement(n.summaryComponent,{config:e,currentUser:t}):o.createElement("p",null,"Condition plugin ",o.createElement("em",null,e.type)," does not provide a summary.");return o.createElement(o.Fragment,null,o.createElement("h3",{className:v.Z.title},n.displayName||e.type),i)})),U(this,"renderField",((e,t,n)=>{const{currentUser:i}=this.props;if(!t.providers||0===t.providers.length)return o.createElement("span",{key:e},"No field value provider configured.");const r=t.providers[0]||{},l=this.getPlugin("fieldValueProviders",r.type);return l.summaryComponent?o.createElement(l.summaryComponent,{fieldName:e,config:t,keys:n,key:e,currentUser:i}):o.createElement("p",{key:e},"Provider plugin ",o.createElement("em",null,r.type)," does not provide a summary.")})),U(this,"renderFieldList",((e,t,n)=>o.createElement(o.Fragment,null,o.createElement("dl",null,o.createElement("dt",null,"Keys"),o.createElement("dd",null,n.length>0?n.join(", "):"No Keys configured for Events based on this Definition.")),e.sort(p.S).map((e=>this.renderField(e,t[e],n)))))),U(this,"renderFields",((e,t)=>{const n=Object.keys(e);return o.createElement(o.Fragment,null,o.createElement("h3",{className:v.Z.title},"Fields"),0===n.length?o.createElement("p",null,"No Fields configured for Events based on this Definition."):this.renderFieldList(n,e,t))})),U(this,"renderNotification",(e=>{const{notifications:t}=this.props,n=t.find((t=>t.id===e.notification_id));let i;if(n){const t=this.getPlugin("eventNotificationTypes",n.config.type);i=t.summaryComponent?o.createElement(t.summaryComponent,{type:t.displayName,notification:n,definitionNotification:e}):o.createElement("p",null,"Notification plugin ",o.createElement("em",null,n.config.type)," does not provide a summary.")}else i=o.createElement("p",null,"Could not find information for Notification ",o.createElement("em",null,e.notification_id),".");return o.createElement(o.Fragment,{key:e.notification_id},i)})),U(this,"renderNotificationSettings",(e=>{const t=f().duration(e.grace_period_ms).format("d [days] h [hours] m [minutes] s [seconds]",{trim:"all"}),n=e.grace_period_ms?`Grace Period is set to ${t}`:"Grace Period is disabled",i=e.backlog_size?`Notifications will include ${e.backlog_size} messages`:"Notifications will not include any messages.";return o.createElement(o.Fragment,null,o.createElement("h4",null,"Settings"),o.createElement("dl",null,o.createElement("dd",null,n),o.createElement("dd",null,i)))})),U(this,"renderNotifications",((e,t)=>{const{currentUser:n}=this.props,i=e.filter((e=>(0,g.rq)(n.permissions,`eventnotifications:read:${e.notification_id}`))),r=e.filter((e=>!i.map((e=>e.notification_id)).includes(e.notification_id))),l=r.length>0?o.createElement(E.bZ,{bsStyle:"warning"},"Missing Notifications Permissions for:",o.createElement("br",null),r.map((e=>e.notification_id)).join(", ")):null;return o.createElement(o.Fragment,null,o.createElement("h3",{className:v.Z.title},"Notifications"),o.createElement("p",null,l),0===i.length&&r.length<=0?o.createElement("p",null,"This Event is not configured to trigger any Notifications."):o.createElement(o.Fragment,null,this.renderNotificationSettings(t),e.map(this.renderNotification)))})),this.state={showValidation:!1}}componentDidUpdate(){this.showValidation()}render(){const{eventDefinition:e,validation:t}=this.props,{showValidation:n}=this.state;return o.createElement(E.X2,{className:I.eventSummary},o.createElement(E.JX,{md:12},o.createElement("h2",{className:v.Z.title},"Event Summary"),n&&o.createElement(N,{validation:t}),o.createElement(E.X2,null,o.createElement(E.JX,{md:5},this.renderDetails(e)),o.createElement(E.JX,{md:5,mdOffset:1},this.renderCondition(e.config))),o.createElement(E.X2,null,o.createElement(E.JX,{md:5},this.renderFields(e.field_spec,e.key_spec)),o.createElement(E.JX,{md:5,mdOffset:1},this.renderNotifications(e.notifications,e.notification_settings)))))}}U(B,"propTypes",{eventDefinition:s().object.isRequired,notifications:s().array.isRequired,validation:s().object,currentUser:s().object.isRequired}),U(B,"defaultProps",{validation:void 0});const R=B},WlYEmUoB:(e,t,n)=>{n.d(t,{Z:()=>i});const i={LOW:1,NORMAL:2,HIGH:3,properties:{1:{name:"low"},2:{name:"normal"},3:{name:"high"}}}},mG6q1NUl:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var i=n("Z7aTuO5B"),r=n("2BBGznGN"),l=n("b/6pmtOr"),o=n("EeAwn/0x"),a=n("F9olzlTR"),s=n("DeVaSktS"),c=n("4Js8dUPg"),m=n("0zTRKSqx"),d=n("j7/yTk5n"),u=n("EUJYvlA3"),f=n("BSHS2nUH"),p=n("XmWOcQPs"),E=n("vxGQ9flp"),g=n("5GvVt6f3"),h=n("GdY2o7iN");const v=()=>{const e=(0,r.useParams)(),t=(0,d.Z)(),[n,v]=(0,i.useState)(),{all:y}=(0,l.o)(g.O);return(0,i.useEffect)((()=>{t&&(0,u.rq)(t.permissions,`eventdefinitions:read:${e.definitionId}`)&&(E.y.get(e.definitionId).then((e=>{const t=e.event_definition;t.config._is_scheduled=e.context.scheduler.is_scheduled,v(t)}),(e=>{404===e.status&&f.Z.push(s.ZP.ALERTS.DEFINITIONS.LIST)})),g.e.listAll())}),[t,e]),n&&y?i.createElement(m.$4,{title:`View "${n.title}" Event Definition`},i.createElement(h.Z,null),i.createElement(m.mr,{title:`View "${n.title}" Event Definition`,actions:i.createElement(a.Si,null,i.createElement(m.AE,{permissions:`eventdefinitions:edit:${e.definitionId}`},i.createElement(o.J,{to:s.ZP.ALERTS.DEFINITIONS.edit(e.definitionId)},i.createElement(a.zx,{bsStyle:"success"},"Edit Event Definition")))),documentationLink:{title:"Alerts documentation",path:c.Z.PAGES.ALERTS}},i.createElement("span",null,"Event Definitions allow you to create Events from different Conditions and alert on them.")),i.createElement(a.X2,{className:"content"},i.createElement(a.JX,{md:12},i.createElement(p.Z,{eventDefinition:n,currentUser:t,notifications:y})))):i.createElement(m.$4,{title:"View Event Definition"},i.createElement("span",null,i.createElement(m.mr,{title:"View Event Definition"},i.createElement(m.$j,{text:"Loading Event Definition..."}))))}},"R6vKwq+5":(e,t,n)=>{n.d(t,{Z:()=>a});var i=n("pmX897Fv"),r=n.n(i),l=n("DjJvgDaP"),o=n.n(l)()(r());o.push([e.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:""}]),o.locals={eventSummary:"xZzz7avfOImN5wyTQXue"};const a=o}}]);
//# sourceMappingURL=325e2d4b-7738.af5d820a997f01eb3da1.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy