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

web-interface.assets.bb8c8232-5069.e183cee7d2da85bb663a.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-5069"],{SfPIQIJE:(D,v,t)=>{"use strict";t.d(v,{A:()=>O});var e=t("Z7aTuO5B"),f=t("J6y4/h8P"),o=t("rIl5IEuP"),h=t("ty2gyrHp"),E=t("IOI9nV80"),p=t("NV1/EHMi");const I=(0,f.default)(o.ButtonToolbar)`
  margin-bottom: 10px;
`,_=(0,f.default)(o.Button)(({theme:T})=>(0,f.css)`
  font-family: ${T.fonts.family.navigation};
  font-size: ${T.fonts.size.navigation};
  color: ${T.colors.variant.darker.default};
  
  &:hover,
  &:focus {
    background: inherit;
    text-decoration: none;
  }

  &:hover {
    color: inherit;
    ${(0,p.WS)(T)}
  }

  &.active {
    color: ${T.colors.global.textDefault};

    ${(0,p.at)(T)}

    &:hover,
    &:focus {
      ${(0,p.at)(T)}
    }
`);_.displayName="Button";const O=({items:T})=>e.createElement(I,null,T.map(({path:y,title:L,permissions:N,exactPathMatch:d})=>y?e.createElement(E.Wj,{permissions:N!=null?N:[],key:y},e.createElement(h.m,{to:y,relativeActive:!d},e.createElement(_,{bsStyle:"link"},e.createElement(p.Ay,null,L)))):null))},f0XVFT4u:(D,v,t)=>{"use strict";t.d(v,{A:()=>A});var e=t("Z7aTuO5B"),f=t("ii0bleBb"),o=t.n(f),h=t("ty2gyrHp"),E=t("rIl5IEuP"),p=t("IOI9nV80"),I=t("d4kzUuQm");const _=({notificationId:O})=>e.createElement(E.ButtonToolbar,null,e.createElement(p.Wj,{permissions:`eventnotifications:read:${O}`},e.createElement(h.m,{to:I.Ay.ALERTS.NOTIFICATIONS.show(O)},e.createElement(E.Button,{bsStyle:"success"},"View Details"))),e.createElement(p.Wj,{permissions:`eventnotifications:edit:${O}`},e.createElement(h.m,{to:I.Ay.ALERTS.NOTIFICATIONS.edit(O)},e.createElement(E.Button,{bsStyle:"success"},"Edit Notification"))));_.propTypes={notificationId:o().string.isRequired};const A=_},"42lc8BRs":(D,v,t)=>{"use strict";t.d(v,{A:()=>J});var e=t("Z7aTuO5B"),f=t("ii0bleBb"),o=t.n(f),h=t("VZ0CjfW1"),E=t.n(h),p=t("IW7priiX"),I=t.n(p),_=t("IOI9nV80"),A=t("d4kzUuQm"),O=t("J7MaobQD"),T=t("N6x7vnl1"),y=t("/yh+QgO6"),L=t.n(y),N=t("QL8i6bcz"),d=t("rIl5IEuP"),F=t("S6FuRS7B"),K=t("BqxuktKK"),b=t("MdYBRjRJ"),B=t("v4GbOr/o"),W=t("HCsT5Gmk"),x=Object.defineProperty,C=(l,a,n)=>a in l?x(l,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[a]=n,i=(l,a,n)=>(C(l,typeof a!="symbol"?a+"":a,n),n);const P=l=>l===void 0?{}:N.d.exports("eventNotificationTypes").find(a=>a.type===l)||{},M=()=>N.d.exports("eventNotificationTypes").map(l=>({label:l.displayName,value:l.type}));class R extends e.Component{constructor(a){super(a),i(this,"setIsSubmitEnabled",n=>{this.setState({isSubmitEnabled:n})}),i(this,"handleSubmit",n=>{const{notification:s,onSubmit:r,sendTelemetry:c,action:m,location:u}=this.props;c(m==="create"?B.g.NOTIFICATIONS.CREATE_CLICKED:B.g.NOTIFICATIONS.EDIT_CLICKED,{app_pathname:(0,b.i)(u.pathname),app_section:"event-notification",app_action_value:`${m}-button`}),n.preventDefault(),r(s)}),i(this,"handleChange",n=>{const{name:s}=n.target,{onChange:r}=this.props;r(s,(0,F.yG)(n.target))}),i(this,"handleConfigChange",n=>{const{onChange:s}=this.props;s("config",n)}),i(this,"handleTypeChange",n=>{const{sendTelemetry:s,location:r}=this.props;s(B.g.EVENTDEFINITION_NOTIFICATIONS.NOTIFICATION_TYPE_SELECTED,{app_pathname:(0,b.i)(r.pathname),app_section:"event-definition-notifications",app_action_value:"notification-type-select",notification_type:n});const m=P(n).defaultConfig||{};this.handleConfigChange({...m,type:n})}),i(this,"handleTestTrigger",()=>{const{notification:n,onTest:s,sendTelemetry:r,location:c}=this.props;r(B.g.NOTIFICATIONS.EXECUTE_TEST_CLICKED,{app_pathname:(0,b.i)(c.pathname),app_section:"event-notification",app_action_value:"execute-test-button"}),s(n)}),this.state={isSubmitEnabled:!0}}render(){const{action:a,embedded:n,formId:s,notification:r,onCancel:c,validation:m,testResult:u}=this.props,{isSubmitEnabled:S}=this.state,g=P(r.config.type),G=g.formComponent?e.createElement(g.formComponent,{config:r.config,onChange:this.handleConfigChange,validation:m,setIsSubmitEnabled:this.setIsSubmitEnabled}):null,Y=u.isLoading?e.createElement(_.y$,{text:"Testing..."}):"Execute Test Notification";return e.createElement(d.Row,null,e.createElement(d.Col,{lg:8},e.createElement("form",{onSubmit:this.handleSubmit,id:s},e.createElement(d.Input,{id:"notification-title",name:"title",label:"Title",type:"text",bsStyle:m.errors.title?"error":null,help:L()(m,"errors.title[0]","Title to identify this Notification."),value:r.title,onChange:this.handleChange,required:!0,autoFocus:!0}),e.createElement(d.Input,{id:"notification-description",name:"description",label:e.createElement("span",null,"Description ",e.createElement("small",{className:"text-muted"},"(Optional)")),type:"textarea",help:"Longer description for this Notification.",value:r.description,onChange:this.handleChange,rows:2}),e.createElement(d.FormGroup,{controlId:"notification-type",validationState:m.errors.config?"error":null},e.createElement(d.ControlLabel,null,"Notification Type"),e.createElement(_.l6,{id:"notification-type",options:M(),value:r.config.type,onChange:this.handleTypeChange,clearable:!1,required:!0}),e.createElement(d.HelpBlock,null,L()(m,"errors.config[0]","Choose the type of Notification to create."))),G,G&&e.createElement(d.FormGroup,null,e.createElement(d.ControlLabel,null,"Test Notification ",e.createElement("small",{className:"text-muted"},"(Optional)")),e.createElement(d.FormControl.Static,null,e.createElement(d.Button,{bsStyle:"info",bsSize:"small",disabled:u.isLoading,onClick:this.handleTestTrigger},Y)),u.message&&e.createElement(d.Alert,{bsStyle:u.error?"danger":"success",title:u.error?"Error: ":"Success: "},u.message),e.createElement(d.HelpBlock,null,"Execute this Notification with a test Alert.")),!n&&e.createElement(_.hP,{disabledSubmit:!S,submitButtonText:`${a==="create"?"Create":"Update"} notification`,onCancel:c}))))}}i(R,"propTypes",{action:o().oneOf(["create","edit"]),notification:o().object.isRequired,validation:o().object.isRequired,testResult:o().shape({isLoading:o().bool,error:o().bool,message:o().string}).isRequired,formId:o().string,embedded:o().bool.isRequired,onChange:o().func.isRequired,onCancel:o().func.isRequired,onSubmit:o().func.isRequired,onTest:o().func.isRequired,sendTelemetry:o().func.isRequired,location:o().object.isRequired}),i(R,"defaultProps",{action:"edit",formId:void 0});const z=(0,W.A)((0,K.A)(R));var H=Object.defineProperty,X=(l,a,n)=>a in l?H(l,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[a]=n,U=(l,a,n)=>(X(l,typeof a!="symbol"?a+"":a,n),n);const Q={errors:{}},V={isLoading:!1},$=class j extends e.Component{constructor(a){super(a),U(this,"handleChange",(n,s)=>{const{notification:r}=this.state,c=I()(r);c[n]=s,this.setState({notification:c,isDirty:!0,testResult:V})}),U(this,"handleCancel",()=>{const{history:n}=this.props;n.push(A.Ay.ALERTS.NOTIFICATIONS.LIST)}),U(this,"handleSubmit",()=>{const{action:n,embedded:s,onSubmit:r,history:c}=this.props,{notification:m}=this.state;this.setState({isDirty:!1});let u;n==="create"?(u=O.M.create(m),u.then(()=>{s||c.push(A.Ay.ALERTS.NOTIFICATIONS.LIST)},S=>{const{body:g}=S.additional;S.status===400&&g&&g.failed&&(this.setState({validation:g}),j.scrollToFirstError())})):(u=O.M.update(m.id,m),u.then(()=>{s||c.push(A.Ay.ALERTS.NOTIFICATIONS.LIST)},S=>{const{body:g}=S.additional;S.status===400&&g&&g.failed&&(this.setState({validation:g}),j.scrollToFirstError())})),r(u)}),U(this,"handleTest",()=>{const{notification:n}=this.state;this.setState({testResult:{isLoading:!0},validation:Q});const s=E()(V);this.testPromise=O.M.test(n),this.testPromise.then(r=>(s.error=!1,s.message="Notification was executed successfully.",r),r=>{s.error=!0;const{body:c}=r.additional;r.status===400&&c&&c.failed?(s.message="Validation failed, please correct any errors in the form before continuing.",this.setState({validation:c})):s.message=r.responseMessage||"Unknown error, please check your Graylog server logs."}).finally(()=>{this.setState({testResult:s}),this.testPromise=void 0})}),this.state={notification:a.notification,validation:Q,testResult:V,isDirty:!1}}static scrollToFirstError(){document.getElementsByClassName("has-error")[0]!==void 0&&document.getElementsByClassName("has-error")[0].scrollIntoView(!0)}componentWillUnmount(){this.testPromise&&this.testPromise.cancel()}render(){const{action:a,embedded:n,formId:s}=this.props,{notification:r,validation:c,testResult:m,isDirty:u}=this.state;return e.createElement(e.Fragment,null,!n&&u&&e.createElement(_.Oj,{question:"Do you really want to abandon this page and lose your changes? This action cannot be undone."}),e.createElement(z,{action:a,notification:r,validation:c,testResult:m,formId:s,embedded:n,onChange:this.handleChange,onCancel:this.handleCancel,onSubmit:this.handleSubmit,onTest:this.handleTest}))}};U($,"propTypes",{action:o().oneOf(["create","edit"]),notification:o().object,embedded:o().bool,formId:o().string,onSubmit:o().func,history:o().object.isRequired}),U($,"defaultProps",{action:"edit",notification:{title:"",description:"",config:{}},embedded:!1,formId:void 0,onSubmit:()=>{}});let Z=$;const J=(0,T.A)(Z)},jvpdvVQ7:(D,v,t)=>{"use strict";t.d(v,{A:()=>I});var e=t("Z7aTuO5B"),f=t("SfPIQIJE"),o=t("d4kzUuQm"),h=t("rIl5IEuP");const E=[{title:"Alerts & Events",path:o.Ay.ALERTS.LIST,exactPathMatch:!0},{title:"Event Definitions",path:o.Ay.ALERTS.DEFINITIONS.LIST},{title:"Notifications",path:o.Ay.ALERTS.NOTIFICATIONS.LIST}],I=()=>e.createElement(h.Row,null,e.createElement(f.A,{items:E}))},"G3GhAzW+":(D,v,t)=>{"use strict";t.r(v),t.d(v,{default:()=>x});var e=t("Z7aTuO5B"),f=t("ii0bleBb"),o=t.n(f),h=t("rIl5IEuP"),E=t("IOI9nV80"),p=t("d4kzUuQm"),I=t("E+CaPsQD"),_=t("8fnsnG21"),A=t("yGRmSjYM"),O=t("42lc8BRs"),T=t("f0XVFT4u"),y=t("c9JM82dZ"),L=t("J1ga+jW6"),N=t("J7MaobQD"),d=t("jvpdvVQ7"),F=t("N6x7vnl1"),K=Object.defineProperty,b=(C,i,P)=>i in C?K(C,i,{enumerable:!0,configurable:!0,writable:!0,value:P}):C[i]=P,B=(C,i,P)=>(b(C,typeof i!="symbol"?i+"":i,P),P);class W extends e.Component{constructor(i){super(i),this.state={notification:void 0}}componentDidMount(){const{params:i,currentUser:P}=this.props;(0,A.Nn)(P.permissions,`eventnotifications:edit:${i.notificationId}`)&&N.M.get(i.notificationId).then(M=>this.setState({notification:M}),M=>{if(M.status===404){const{history:R}=this.props;R.push(p.Ay.ALERTS.NOTIFICATIONS.LIST)}})}render(){const{notification:i}=this.state,{params:P,currentUser:M,history:R}=this.props;return(0,A.Nn)(M.permissions,`eventnotifications:edit:${P.notificationId}`)||R.push(p.Ay.NOTFOUND),i?e.createElement(E.Qc,{title:`Edit "${i.title}" Notification`},e.createElement(d.A,null),e.createElement(E.zY,{title:`Edit "${i.title}" Notification`,actions:e.createElement(T.A,{notificationId:i.id}),documentationLink:{title:"Alerts documentation",path:I.A.PAGES.ALERTS}},e.createElement("span",null,"Notifications alert you of any configured Event when they occur. Graylog can send Notifications directly to you or to other systems you use for that purpose.")),e.createElement(h.Row,{className:"content"},e.createElement(h.Col,{md:12},e.createElement(O.A,{action:"edit",notification:i})))):e.createElement(E.Qc,{title:"Edit Notification"},e.createElement("span",null,e.createElement(E.zY,{title:"Edit Notification"},e.createElement(E.y$,{text:"Loading Notification information..."}))))}}B(W,"propTypes",{params:o().object.isRequired,currentUser:o().object.isRequired,history:o().object.isRequired});const x=(0,_.A)((0,F.A)((0,y.A)(W)),{currentUser:L.y},({currentUser:C})=>({currentUser:C.currentUser}))},c9JM82dZ:(D,v,t)=>{"use strict";t.d(v,{A:()=>h});var e=t("Z7aTuO5B"),f=t("yAXMqwrl");const h=E=>p=>{const I=(0,f.useParams)();return e.createElement(E,{...p,params:I})}},VZ0CjfW1:(D,v,t)=>{var e=t("8U3oBBH1"),f=4;function o(h){return e(h,f)}D.exports=o}}]);})();

//# sourceMappingURL=bb8c8232-5069.e183cee7d2da85bb663a.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy