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

web-interface.assets.325e2d4b-9046.64a02bdbf48d850d060f.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-9046"],{pLLmkYy5:(e,t,n)=>{n.d(t,{Z:()=>d});var a=n("Z7aTuO5B"),i=n("J6y4/h8P"),s=n("F9olzlTR"),l=n("EeAwn/0x"),r=n("0zTRKSqx"),o=n("XR6lEGGZ");const c=(0,i.default)(s.Si).withConfig({displayName:"PageNavigation__Container",componentId:"sc-1if5i40-0"})(["margin-bottom:10px;"]),u=(0,i.default)(s.zx).withConfig({displayName:"PageNavigation__StyledButton",componentId:"sc-1if5i40-1"})((e=>{let{theme:t}=e;return(0,i.css)(["font-family:",";font-size:",";&&&&{color:",";:hover,:focus{text-decoration:none;}:hover{","}&.active{color:",";"," :hover,:focus{","}}}"],t.fonts.family.navigation,t.fonts.size.navigation,t.colors.variant.darker.default,(0,o.RF)(t),t.colors.global.textDefault,(0,o.A7)(t),(0,o.A7)(t))}));u.displayName="Button";const d=e=>{let{items:t}=e;return a.createElement(c,null,t.map((e=>{let{path:t,title:n,permissions:i,exactPathMatch:s}=e;return t?a.createElement(r.AE,{permissions:null!=i?i:[],key:t},a.createElement(l.J,{to:t,relativeActive:!s},a.createElement(u,{bsStyle:"link"},a.createElement(o.ZP,null,n)))):null})))}},BXP2KjIr:(e,t,n)=>{var a=n("AztyBNMT"),i=n("Z7aTuO5B"),s=n("ii0bleBb"),l=n.n(s),r=n("nHcjWeCO"),o=n.n(r),c=n("0zTRKSqx"),u=n("Mx+G+HdB"),d=n.n(u),m=n("F95zaCK8"),p=n("EUJYvlA3"),g=n("j7/yTk5n"),h=n("NxQnyiWl");function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=(0,i.useRef)();return i.createElement(h.Z,f({ref:t,async:!0},e))};y.propTypes=h.Z.propTypes;const v=y,b={page:1,perPage:50,query:"",total:0},E=e=>{let{value:t,onChange:n}=e;const a=(0,g.Z)(),[s,l]=(0,i.useState)(),[r,o]=(0,i.useState)(!1),[u,h]=(0,i.useState)(!1),f=(0,i.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b;if((0,p.rq)(a.permissions,"users:list"))return o(!0),m.Z.loadUsersPaginated(e).then((e=>(o(!1),e)))}),[a.permissions]),y=d()((()=>{const{pagination:e,pagination:{total:t},list:n}=s;t>n.count()&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";f({...e,page:e.page+1,query:t}).then((e=>{l((t=>{const n=t.list.concat(e.list),a={...t.pagination,...e.pagination};return{...t,list:n,pagination:a}}))}))}(e)}),400);(0,i.useEffect)((()=>{s||f().then(l)}),[]);const E=d()(((e,t)=>{"input-change"===t.action?(h(!0),f({...b,query:e}).then((e=>{h(!0),l(e)}))):"menu-close"===t.action&&f().then(l)}),400);if(!s)return i.createElement("p",null,i.createElement(c.$j,{text:"Loading User select..."}));const{list:C,pagination:{total:_}}=s;return i.createElement(v,{id:"user-select-list",value:t,placeholder:"Select user(s)...",options:(S=C.toArray(),S.map((e=>({label:`${e.username} (${e.fullName})`,value:e.username})))),onInputChange:E,loadOptions:r||u?()=>{}:y,multi:!0,total:_,onChange:n});var S};E.propTypes={};const C=E;var _=n("F9olzlTR"),S=n("YyiN4DLW"),w=n("ImMZ0iJQ");function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class A extends i.Component{constructor(){super(...arguments),T(this,"propagateChange",((e,t)=>{const{config:n,onChange:a}=this.props,i=o().cloneDeep(n);i[e]=t,a(i)})),T(this,"handleChange",(e=>{const{name:t}=e.target;this.propagateChange(t,(0,S.n6)(e.target))})),T(this,"handleTimeZoneChange",(e=>{this.propagateChange("time_zone",e)})),T(this,"handleBodyTemplateChange",(e=>{this.propagateChange("body_template",e)})),T(this,"handleHtmlBodyTemplateChange",(e=>{this.propagateChange("html_body_template",e)})),T(this,"handleRecipientsChange",(e=>t=>this.propagateChange(e,""===t?[]:t.split(","))))}render(){const{config:e,validation:t}=this.props;return i.createElement(i.Fragment,null,i.createElement(_.II,{id:"notification-subject",name:"subject",label:"Subject",type:"text",bsStyle:t.errors.subject?"error":null,help:o().get(t,"errors.subject[0]","The subject that should be used for the email notification."),value:e.subject||"",onChange:this.handleChange,required:!0}),i.createElement(w.Z,null,i.createElement(_.II,{id:"notification-sender",name:"sender",label:i.createElement(_.J$,null,"Sender ",i.createElement("small",{className:"text-muted"},"(Optional)")),type:"text",bsStyle:t.errors.sender?"error":null,help:o().get(t,"errors.sender[0]","The email address that should be used as the notification sender. Leave it empty to use the default sender address."),value:e.sender||"",onChange:this.handleChange})),i.createElement(c.AE,{permissions:"users:list"},i.createElement(_.cw,{controlId:"notification-user-recipients",validationState:t.errors.recipients?"error":null},i.createElement(_.J$,null,"User recipient(s) ",i.createElement("small",{className:"text-muted"},"(Optional)")),i.createElement(C,{id:"notification-user-recipients",value:Array.isArray(e.user_recipients)?e.user_recipients.join(","):"",onChange:this.handleRecipientsChange("user_recipients")}),i.createElement(_.Qb,null,o().get(t,"errors.recipients[0]","Select Graylog users that will receive this Notification.")))),i.createElement(_.cw,{controlId:"notification-email-recipients",validationState:t.errors.recipients?"error":null},i.createElement(_.J$,null,"Email recipient(s) ",i.createElement("small",{className:"text-muted"},"(Optional)")),i.createElement(c.NU,{id:"notification-email-recipients",value:Array.isArray(e.email_recipients)?e.email_recipients.join(","):"",addLabelText:'Add email "{label}"?',placeholder:"Type email address",options:[],onChange:this.handleRecipientsChange("email_recipients"),allowCreate:!0}),i.createElement(_.Qb,null,o().get(t,"errors.recipients[0]","Add email addresses that will receive this Notification."))),i.createElement(_.II,{id:"notification-time-zone",help:"Time zone used for timestamps in the email body.",label:i.createElement(i.Fragment,null,"Time zone for date/time values ",i.createElement("small",{className:"text-muted"},"(Optional)"))},i.createElement(c.Cc,{className:"timezone-select",name:"time_zone",value:e.time_zone,onChange:this.handleTimeZoneChange})),i.createElement(_.cw,{controlId:"notification-body-template",validationState:t.errors.body?"error":null},i.createElement(_.J$,null,"Body Template"),i.createElement(c.KB,{id:"notification-body-template",mode:"text",theme:"light",value:e.body_template||"",onChange:this.handleBodyTemplateChange}),i.createElement(_.Qb,null,o().get(t,"errors.body[0]","The template that will be used to generate the email body."))),i.createElement(_.cw,{controlId:"notification-body-template",validationState:t.errors.body?"error":null},i.createElement(_.J$,null,"HTML Body Template"),i.createElement(c.KB,{id:"notification-html-body-template",mode:"text",theme:"light",value:e.html_body_template||"",onChange:this.handleHtmlBodyTemplateChange}),i.createElement(_.Qb,null,o().get(t,"errors.body[0]","The template that will be used to generate the email HTML body."))))}}T(A,"propTypes",{config:l().object.isRequired,validation:l().object.isRequired,onChange:l().func.isRequired}),T(A,"defaultConfig",{sender:"",subject:"Graylog event notification: ${event_definition_title}",body_template:"--- [Event Definition] ---------------------------\nTitle:       ${event_definition_title}\nDescription: ${event_definition_description}\nType:        ${event_definition_type}\n--- [Event] --------------------------------------\nTimestamp:            ${event.timestamp}\nMessage:              ${event.message}\nSource:               ${event.source}\nKey:                  ${event.key}\nPriority:             ${event.priority}\nAlert:                ${event.alert}\nTimestamp Processing: ${event.timestamp}\nTimerange Start:      ${event.timerange_start}\nTimerange End:        ${event.timerange_end}\nFields:\n${foreach event.fields field}  ${field.key}: ${field.value}\n${end}\n${if backlog}\n--- [Backlog] ------------------------------------\nLast messages accounting for this alert:\n${foreach backlog message}\n${message}\n${end}\n${end}\n",html_body_template:'\n\n\n\n\n
Event Definition
Title${event_definition_title}
Description${event_definition_description}
Type${event_definition_type}
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n
Event
Timestamp${event.timestamp}
Message${event.message}
Source${event.source}
Key${event.key}
Priority${event.priority}
Alert${event.alert}
Timestamp Processing${event.timestamp}
Timerange Start${event.timerange_start}
Timerange End${event.timerange_end}
Source Streams${event.source_streams}
Fields
    ${foreach event.fields field}
  • ${field.key}:${field.value}
  • ${end}
    \n${if backlog}\n
    \n\n${foreach backlog message}\n\n${end}\n
    Backlog (Last messages accounting for this alert)
    ${message}
    \n${end}\n',user_recipients:[],email_recipients:[],time_zone:"UTC"});const N=A,P=e=>i.createElement(N,e);P.propTypes={config:l().object.isRequired,validation:l().object.isRequired,onChange:l().func.isRequired};const k=P;var R=n("dFpwyWHg"),Z=n.n(R),U=n("C2ikvoS0"),I=n.n(U),j=n("1IntWRSu"),O=n.n(j),x=n("8nGWeFnd"),q=n.n(x),L=n("TeAcaicX"),D=n.n(L),B=n("eE3+5goe"),z=n.n(B),F=n("ZddqZk1Z"),J={};J.styleTagTransform=z(),J.setAttributes=q(),J.insert=O().bind(null,"head"),J.domAPI=I(),J.insertStyleElement=D();Z()(F.Z,J);const M=F.Z&&F.Z.locals?F.Z.locals:void 0;function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class G extends i.Component{constructor(){super(...arguments),X(this,"state",{displayDetails:!1}),X(this,"toggleDisplayDetails",(()=>{const{displayDetails:e}=this.state;this.setState({displayDetails:!e})}))}render(){const{type:e,notification:t,definitionNotification:n,children:a}=this.props,{displayDetails:s}=this.state;return i.createElement(i.Fragment,null,i.createElement("h4",null,t.title||n.notification_id),i.createElement("dl",null,i.createElement("dd",null,e),i.createElement("dd",null,i.createElement(_.zx,{bsStyle:"link",className:"btn-text",bsSize:"xsmall",onClick:this.toggleDisplayDetails},i.createElement(c.JO,{name:"caret-"+(s?"down":"right")})," ",s?"Less details":"More details"),s&&i.createElement(_.iA,{condensed:!0,hover:!0,className:M.fixedTable},i.createElement("tbody",null,i.createElement("tr",null,i.createElement("td",null,"Description"),i.createElement("td",null,t.description||"No description given")),a)))))}}X(G,"propTypes",{type:l().string.isRequired,notification:l().object.isRequired,definitionNotification:l().object.isRequired,children:l().element.isRequired});const K=G;var W=n("eWgADhWh"),H={};H.styleTagTransform=z(),H.setAttributes=q(),H.insert=O().bind(null,"head"),H.domAPI=I(),H.insertStyleElement=D();Z()(W.Z,H);const Q=W.Z&&W.Z.locals?W.Z.locals:void 0;function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class V extends i.Component{render(){const{notification:e}=this.props;return i.createElement(K,this.props,i.createElement(i.Fragment,null,i.createElement("tr",null,i.createElement("td",null,"Sender"),i.createElement("td",null,e.config.sender)),i.createElement("tr",null,i.createElement("td",null,"Subject"),i.createElement("td",null,e.config.subject)),i.createElement("tr",null,i.createElement("td",null,"User recipients"),i.createElement("td",null,e.config.user_recipients.join(", ")||"No users will receive this notification.")),i.createElement("tr",null,i.createElement("td",null,"Email recipients"),i.createElement("td",null,e.config.email_recipients.join(", ")||"No email addresses are configured to receive this notification.")),i.createElement("tr",null,i.createElement("td",null,"Email Body"),i.createElement("td",null,i.createElement(_.tW,{bsSize:"small",className:Q.bodyPreview},e.config.body_template||i.createElement("em",null,"Empty body")))),i.createElement("tr",null,i.createElement("td",null,"Email HTML Body"),i.createElement("td",null,i.createElement(_.tW,{bsSize:"small",className:Q.bodyPreview},e.config.html_body_template||i.createElement("em",null,"Empty HTML body"))))))}}Y(V,"propTypes",{type:l().string.isRequired,notification:l().object,definitionNotification:l().object.isRequired}),Y(V,"defaultProps",{notification:{}});const ee=V;function te(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ne=(0,n("J6y4/h8P").default)(_.zx).withConfig({displayName:"HttpNotificationForm__StyledButton",componentId:"sc-x17v0p-0"})(["clear:both;display:block;margin-bottom:15px;"]);class ae extends i.Component{constructor(){super(),te(this,"propagateChange",((e,t)=>{const{config:n,onChange:a}=this.props,i=o().cloneDeep(n);i[e]=t,a(i)})),te(this,"handleChange",(e=>{const{name:t}=e.target,n=S.n6(e.target);this.propagateChange(t,n)})),te(this,"handleSecretInputChange",(e=>{const{name:t}=e.target,n=S.n6(e.target),a=0===n.length?{delete_value:!0}:{set_value:n};this.setState({[t]:n}),this.propagateChange(t,a)})),te(this,"onValidationChange",(e=>{const{setIsSubmitEnabled:t}=this.props;t("error"!==e)})),te(this,"resetSecret",(e=>{const{reset:t}=this.state;t[e]=!0,this.setState({reset:t}),this.propagateChange(e,{delete_value:!0}),this.setState({[e]:""})})),te(this,"undoResetSecret",(e=>{const{reset:t}=this.state;t[e]=!1,this.setState({reset:t}),this.propagateChange(e,{keep_value:!0}),this.setState({[e]:"******"})})),this.state={api_secret:"",basic_auth:"",reset:{api_secret:!1,basic_auth:!1}}}componentDidMount(){var e,t;const{config:n,onChange:a}=this.props,i=o().cloneDeep(n);i.basic_auth=null!==(e=n.basic_auth)&&void 0!==e&&e.is_set?{keep_value:!0}:null,i.api_secret=null!==(t=n.api_secret)&&void 0!==t&&t.is_set?{keep_value:!0}:null,a(i),this.setState({basic_auth:n.basic_auth.is_set?"******":""}),this.setState({api_secret:n.api_secret.is_set?"******":""})}render(){const{config:e,validation:t}=this.props,{api_secret:n,basic_auth:a}=e,{reset:s}=this.state;return i.createElement(i.Fragment,null,i.createElement(c.zX,{label:"URL",onChange:this.handleChange,validationState:t.errors.url?"error":null,validationMessage:o().get(t,"errors.url[0]","The URL to POST to when an Event occurs."),onValidationChange:this.onValidationChange,url:e.url,autofocus:!1}),i.createElement(_.X2,null,i.createElement(_.JX,{md:12},null!=a&&a.keep_value?i.createElement(i.Fragment,null,i.createElement(_.J$,null,"Basic authentication"),i.createElement(ne,{bsStyle:"default",type:"button",onClick:()=>{this.resetSecret("basic_auth")}},"Reset Secret")):i.createElement(_.II,{id:"basicAuth",label:i.createElement("span",null,"Basic authentication ",i.createElement("small",{className:"text-muted"},"(Optional)")),name:"basic_auth",type:"password",onChange:this.handleSecretInputChange,value:this.state.basic_auth||"",help:"The Basic authentication string needs to follow this format: ':'.",buttonAfter:s.basic_auth?i.createElement(_.zx,{type:"button",onClick:()=>{this.undoResetSecret("basic_auth")}},"Undo Reset"):void 0}))),i.createElement(_.X2,null,i.createElement(_.JX,{md:12},i.createElement(_.II,{id:"api_key",name:"api_key",label:i.createElement("span",null,"API Key ",i.createElement("small",{className:"text-muted"},"(Optional)")),type:"text",onChange:this.handleChange,bsStyle:t.errors.api_key?"error":null,help:o().get(t,"errors.api_key[0]","If an API secret is set, an API key must also be set."),value:e.api_key}))),i.createElement(_.X2,null,i.createElement(_.JX,{md:12},null!=n&&n.keep_value?i.createElement(i.Fragment,null,i.createElement(_.J$,null,"API Secret"),i.createElement(ne,{bsStyle:"default",type:"button",onClick:()=>{this.resetSecret("api_secret")}},"Reset Secret")):i.createElement(_.II,{id:"apiSecret",label:i.createElement("span",null,"API Secret ",i.createElement("small",{className:"text-muted"},"(Optional)")),name:"api_secret",type:"password",onChange:this.handleSecretInputChange,bsStyle:t.errors.api_secret?"error":null,help:o().get(t,"errors.api_secret[0]","If an API key is set, an API secret must also be set."),value:this.state.api_secret||"",buttonAfter:s.api_secret?i.createElement(_.zx,{type:"button",onClick:()=>{this.undoResetSecret("api_secret")}},"Undo Reset"):void 0}))))}}te(ae,"propTypes",{config:l().object.isRequired,validation:l().object.isRequired,onChange:l().func.isRequired,setIsSubmitEnabled:l().func}),te(ae,"defaultConfig",{url:"",api_key:"",api_secret:{keep_value:!0},basic_auth:{keep_value:!0}}),ae.defaultProps={setIsSubmitEnabled:()=>{}};const ie=ae;function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class le extends i.Component{render(){const{notification:e}=this.props;return i.createElement(K,this.props,i.createElement(i.Fragment,null,i.createElement("tr",null,i.createElement("td",null,"URL"),i.createElement("td",null,i.createElement("code",null,e.config.url)))))}}se(le,"propTypes",{type:l().string.isRequired,notification:l().object,definitionNotification:l().object.isRequired}),se(le,"defaultProps",{notification:{}});const re=le;var oe=n("Vpcj0rDf"),ce=n("+u3mJE4Q"),ue={};ue.styleTagTransform=z(),ue.setAttributes=q(),ue.insert=O().bind(null,"head"),ue.domAPI=I(),ue.insertStyleElement=D();Z()(ce.Z,ue);const de=ce.Z&&ce.Z.locals?ce.Z.locals:void 0;function me(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pe=e=>Object.keys(e).map((t=>({label:`Legacy ${e[t].name}`,value:t})));class ge extends i.Component{constructor(){super(...arguments),me(this,"propagateMultiChange",(e=>{const{config:t,onChange:n}=this.props;n({...t,...e})})),me(this,"propagateChange",((e,t)=>{const{config:n}=this.props,a={...n.configuration,[e]:t};this.propagateMultiChange({configuration:a})})),me(this,"getDefaultConfiguration",(e=>{const{legacyTypes:t}=this.props,{configuration:n}=t[e],a={};return Object.keys(n).forEach((e=>{a[e]=n[e].default_value})),a})),me(this,"handleSelectNotificationChange",(e=>{this.propagateMultiChange({callback_type:e,configuration:this.getDefaultConfiguration(e)})})),me(this,"handleFormFieldChange",((e,t)=>{this.propagateChange(e,t)}))}renderNotificationForm(e,t){const{configuration:n}=t,a=Object.keys(n).map((t=>{const a=n[t],s=e.configuration[t];return i.createElement(oe.nz,{key:t,typeName:e.callback_type,configField:a,configKey:t,configValue:s,onChange:this.handleFormFieldChange})}));return i.createElement("fieldset",null,a)}render(){const{config:e,legacyTypes:t,validation:n}=this.props,a=e.callback_type,s=t[a];let l;return s?l=this.renderNotificationForm(e,s):a&&(l=i.createElement(_.bZ,{bsStyle:"danger",className:de.legacyNotificationAlert},"Unknown legacy alarm callback type: ",i.createElement("strong",null,a)," Please make sure the plugin is installed.")),i.createElement(i.Fragment,null,i.createElement("fieldset",null,i.createElement(_.cw,{controlId:"notification-legacy-select",validationState:n.errors.callback_type?"error":null},i.createElement(_.J$,null,"Choose Legacy Notification"),i.createElement(c.Ph,{id:"notification-legacy-select",matchProp:"label",placeholder:"Select Legacy Notification",onChange:this.handleSelectNotificationChange,options:pe(t),value:a}),i.createElement(_.Qb,null,o().get(n,"errors.callback_type[0]","Select a Legacy Notification to use on this Event Definition.")))),i.createElement(_.bZ,{bsStyle:"danger",className:de.legacyNotificationAlert},"Legacy alarm callbacks are deprecated and will be removed with the next major release. Please switch to the new notification types as soon as possible!"),l)}}me(ge,"propTypes",{config:l().object.isRequired,validation:l().object.isRequired,onChange:l().func.isRequired,legacyTypes:l().object.isRequired}),me(ge,"defaultConfig",{callback_type:"",configuration:{}});const he=ge;var fe,ye,ve,be=n("b/6pmtOr"),Ee=n("5GvVt6f3");function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let[t,a]=e;return i.createElement("tr",{key:t},i.createElement("td",null,a.human_name),i.createElement("td",null,n[t]))}))}else l=i.createElement("tr",{className:"danger"},i.createElement("td",null,"Type"),i.createElement("td",null,"Unknown legacy alarm callback type: ",i.createElement("code",null,a),". Please make sure the plugin is installed."));return i.createElement(i.Fragment,null,!s&&i.createElement(_.bZ,{bsStyle:"danger",className:de.legacyNotificationAlert},"Error in ",e.title||"Legacy Alarm Callback",": Unknown type ",i.createElement("code",null,a),", please ensure the plugin is installed."),i.createElement(K,this.props,i.createElement(i.Fragment,null,l)))}}!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(we,"propTypes",{type:l().string.isRequired,notification:l().object.isRequired,definitionNotification:l().object.isRequired,legacyTypes:l().object.isRequired});const Te=we;function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let{notification:t}=e;return i.createElement(i.Fragment,null,i.createElement(c.mv,{label:"Sender",value:t.config.sender}),i.createElement(c.mv,{label:"Subject",value:t.config.subject}),i.createElement(c.mv,{label:"User recipients",value:t.config.user_recipients.join(", ")||"No users will receive this notification."}),i.createElement(c.mv,{label:"Email recipients",value:t.config.email_recipients.join(", ")||"No email addresses are configured to receive this notification."}),i.createElement(c.mv,{label:"Time zone",value:t.config.time_zone}),i.createElement(c.mv,{label:"Email Body",value:i.createElement(_.tW,{bsSize:"small",className:Q.bodyPreview},t.config.body_template||i.createElement("em",null,"Empty body"))}),i.createElement(c.mv,{label:"Email HTML Body",value:i.createElement(_.tW,{bsSize:"small",className:Q.bodyPreview},t.config.html_body_template||i.createElement("em",null,"Empty body"))}))};Re.propTypes={notification:l().object.isRequired};const Ze=Re,$e=e=>{var t,n;let{notification:a}=e;return i.createElement(i.Fragment,null,i.createElement(c.mv,{label:"URL",value:a.config.url}),i.createElement(c.mv,{label:"Basic Authentication",value:null!==(t=a.config.basic_auth)&&void 0!==t&&t.is_set?"******":null}),i.createElement(c.mv,{label:"API Key",value:a.config.api_key}),i.createElement(c.mv,{label:"API Secret",value:null!==(n=a.config.api_secret)&&void 0!==n&&n.is_set?"******":null}))};$e.propTypes={notification:l().object.isRequired};const Ue=$e,Ie=e=>{let{notification:t}=e;const[n,a]=(0,i.useState)(),s=t.config.configuration,l=t.config.callback_type,r=null==n?void 0:n[l];return(0,i.useEffect)((()=>{Ee.e.listAllLegacyTypes().then((e=>a(e.types)))}),[]),n?i.createElement(i.Fragment,null,!r&&i.createElement(_.bZ,{bsStyle:"danger",className:de.legacyNotificationAlert},"Error in ",t.title||"Legacy Alarm Callback",": Unknown type ",i.createElement("code",null,l),", please ensure the plugin is installed."),r&&Object.entries(r.configuration).map((e=>{let[t,n]=e;return"body"===t||"script_args"===t?i.createElement(c.mv,{label:n.human_name,value:i.createElement(_.tW,{bsSize:"small",className:Q.bodyPreview},s[t]||i.createElement("em",null,"Empty body"))}):i.createElement(c.mv,{label:n.human_name,value:s[t]})}))):i.createElement("p",null,i.createElement(c.$j,{text:"Loading legacy notification information..."}))};Ie.propTypes={notification:l().object.isRequired};const je=Ie;a.PluginStore.register(new a.PluginManifest({},{eventNotificationTypes:[{type:"email-notification-v1",displayName:"Email Notification",formComponent:k,summaryComponent:ee,detailsComponent:Ze,defaultConfig:N.defaultConfig},{type:"http-notification-v1",displayName:"HTTP Notification",formComponent:ie,summaryComponent:re,detailsComponent:Ue,defaultConfig:ie.defaultConfig},{type:"legacy-alarm-callback-notification-v1",displayName:"Legacy Alarm Callbacks",formComponent:Se,summaryComponent:ke,detailsComponent:je,defaultConfig:he.defaultConfig}]}))},GdY2o7iN:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n("Z7aTuO5B"),i=n("pLLmkYy5"),s=n("DeVaSktS"),l=n("F9olzlTR");const r=[{title:"Alerts & Events",path:s.ZP.ALERTS.LIST,exactPathMatch:!0},{title:"Event Definitions",path:s.ZP.ALERTS.DEFINITIONS.LIST},{title:"Notifications",path:s.ZP.ALERTS.NOTIFICATIONS.LIST}],o=()=>a.createElement(l.X2,null,a.createElement(i.Z,{items:r}))},F95zaCK8:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n("q/NP8wy0"),i=n("VHOukFih");const s={create:(0,i.Z)({action:a.X.create,success:e=>({message:`User "${null==e?void 0:e.first_name} ${null==e?void 0:e.last_name}" was created successfully`}),error:(e,t)=>({message:`Creating user "${null==t?void 0:t.first_name} ${null==t?void 0:t.last_name}" failed with status: ${e}`})}),load:(0,i.Z)({action:a.X.load,error:(e,t)=>({message:`Loading user with id "${t}" failed with status: ${e}`}),notFoundRedirect:!0}),loadByUsername:(0,i.Z)({action:a.X.loadByUsername,error:(e,t)=>({message:`Loading user with username "${t}" failed with status: ${e}`}),notFoundRedirect:!0}),update:(0,i.Z)({action:a.X.update,success:(e,t,n)=>({message:`User "${n}" was updated successfully`}),error:(e,t,n,a)=>({message:`Updating user "${a}" failed with status: ${e}`})}),delete:(0,i.Z)({action:a.X.delete,success:(e,t)=>({message:`User "${t}" was deleted successfully`}),error:(e,t,n)=>({message:`Deleting user "${n}" failed with status: ${e}`})}),changePassword:(0,i.Z)({action:a.X.changePassword,success:()=>({message:"Password was changed successfully "}),error:(e,t)=>({message:`Changing password for user with id "${t}" failed with status: ${e}`})}),createToken:(0,i.Z)({action:a.X.createToken,success:(e,t)=>({message:`Token "${t}" created successfully`}),error:(e,t,n)=>({message:`Creating token "${n}" for user with id "${t}" failed with status: ${e}`})}),loadTokens:(0,i.Z)({action:a.X.loadTokens,error:(e,t)=>({message:`Loading tokens for user with id "${t}" failed with status: ${e}`})}),deleteToken:(0,i.Z)({action:a.X.deleteToken,success:(e,t,n)=>({message:`Token "${n}" deleted successfully`}),error:(e,t,n,a)=>({message:`Deleting token "${a}" for user with id "${t}" failed with status: ${e}`})}),loadUsers:(0,i.Z)({action:a.X.loadUsers,error:e=>({message:`Loading users failed with status: ${e}`})}),loadUsersPaginated:(0,i.Z)({action:a.X.loadUsersPaginated,error:e=>({message:`Loading users failed with status: ${e}`})}),setStatus:(0,i.Z)({action:a.X.setStatus,success:(e,t)=>({message:`User "${e}" was set to ${t}`}),error:(e,t,n)=>({message:`Updating user ("${t}") to ${n} failed with status: ${e}`})})}},"3KQynTtD":(e,t,n)=>{n.d(t,{Z:()=>i});var a=n("VPaD/Np4");class i{constructor(e,t,n,a,i,s,l,r,o,c,u,d,m,p){this._value={id:e,username:t,fullName:n,email:a,roles:i,readOnly:s,external:l,sessionActive:r,clientAddress:o,lastActivity:c,enabled:u,authServiceId:d,authServiceUid:m,accountStatus:p}}get id(){return this._value.id}get username(){return this._value.username}get name(){return this._value.username}get fullName(){return this._value.fullName}get description(){return this._value.fullName}get email(){return this._value.email}get roles(){return this._value.roles}get readOnly(){return this._value.readOnly}get external(){return this._value.external}get sessionActive(){return this._value.sessionActive}get clientAddress(){return this._value.clientAddress}get lastActivity(){return this._value.lastActivity}get enabled(){return this._value.enabled}get authServiceId(){return this._value.authServiceId}get authServiceUid(){return this._value.authServiceUid}get accountStatus(){return this._value.accountStatus}toBuilder(){const{id:e,username:t,fullName:n,email:i,roles:l,readOnly:r,external:o,sessionActive:c,clientAddress:u,lastActivity:d,enabled:m,authServiceId:p,authServiceUid:g,accountStatus:h}=this._value;return new s(a.Map({id:e,username:t,fullName:n,email:i,roles:l,readOnly:r,external:o,sessionActive:c,clientAddress:u,lastActivity:d,enabled:m,authServiceId:p,authServiceUid:g,accountStatus:h}))}static create(e,t,n,a,s,l,r,o,c,u,d,m,p,g){return new i(e,t,n,a,s,l,r,o,c,u,d,m,p,g)}toJSON(){const{id:e,username:t,fullName:n,email:a,roles:i,readOnly:s,external:l,sessionActive:r,clientAddress:o,lastActivity:c,enabled:u,authServiceId:d,authServiceUid:m,accountStatus:p}=this._value;return{id:e,username:t,full_name:n,email:a,roles:i.toArray(),read_only:s,external_user:l,session_active:r,client_address:o,last_activity:c,enabled:u,auth_service_id:d,auth_service_uid:m,account_status:p}}static fromJSON(e){const{id:t,username:n,full_name:s,email:l,roles:r,read_only:o,external_user:c,session_active:u,client_address:d,last_activity:m,enabled:p,auth_service_id:g,auth_service_uid:h,account_status:f}=e;return i.create(t,n,s,l,a.Set(r),null!=o&&o,null!=c&&c,null!=u&&u,d,m,p,g,h,f)}static builder(){return new s}}class s{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.Map();this.value=e}id(e){return new s(this.value.set("id",e))}username(e){return new s(this.value.set("username",e))}fullName(e){return new s(this.value.set("fullName",e))}email(e){return new s(this.value.set("email",e))}roles(e){return new s(this.value.set("roles",e))}readOnly(e){return new s(this.value.set("readOnly",e))}external(e){return new s(this.value.set("external",e))}sessionActive(e){return new s(this.value.set("sessionActive",e))}clientAddress(e){return new s(this.value.set("clientAddress",e))}lastActivity(e){return new s(this.value.set("lastActivity",e))}enabled(e){return new s(this.value.set("enabled",e))}authServiceId(e){return new s(this.value.set("authServiceId",e))}authServiceUid(e){return new s(this.value.set("authServiceUid",e))}accountStatus(e){return new s(this.value.set("accountStatus",e))}build(){const{id:e,username:t,fullName:n,email:a,roles:s,readOnly:l,external:r,sessionActive:o,clientAddress:c,lastActivity:u,enabled:d,authServiceId:m,authServiceUid:p,accountStatus:g}=this.value.toObject();return new i(e,t,n,a,s,l,r,o,c,u,d,m,p,g)}}},"5GvVt6f3":(e,t,n)=>{n.d(t,{O:()=>g,e:()=>p});var a=n("JnTtTRmZ"),i=n.n(a),s=n("oCSEoDew"),l=n.n(s),r=n("nHcjWeCO"),o=n.n(r),c=n("0wQfx7YJ"),u=n("4af3+9mh"),d=n("OqsMdpSm"),m=n("xc00RsLr");const p=(0,m.ei)("core.EventNotifications",(()=>i().createActions({listAll:{asyncResult:!0},listAllLegacyTypes:{asyncResult:!0},listPaginated:{asyncResult:!0},get:{asyncResult:!0},create:{asyncResult:!0},update:{asyncResult:!0},delete:{asyncResult:!0},test:{asyncResult:!0},testPersisted:{asyncResult:!0}}))),g=(0,m.dS)("core.EventNotifications",(()=>i().createStore({listenables:[p],sourceUrl:"/events/notifications",all:void 0,allLegacyTypes:void 0,notifications:void 0,query:void 0,pagination:{count:void 0,page:void 0,pageSize:void 0,total:void 0,grandTotal:void 0},getInitialState(){return this.getState()},propagateChanges(){this.trigger(this.getState())},getState(){return{all:this.all,allLegacyTypes:this.allLegacyTypes,notifications:this.notifications,query:this.query,pagination:this.pagination}},eventNotificationsUrl(e){let{segments:t=[],query:n={}}=e;const a=new(l())(this.sourceUrl),i=o().concat(a.segment(),t);return a.segmentCoded(i),a.query(n),c.DC(a.resource())},refresh(){this.all&&this.listAll(),this.pagination.page&&this.listPaginated({query:this.query,page:this.pagination.page,pageSize:this.pagination.pageSize})},listAll(){const e=(0,d.ZP)("GET",this.eventNotificationsUrl({query:{per_page:0}}));e.then((e=>(this.all=e.notifications,this.propagateChanges(),e))),p.listAll.promise(e)},listPaginated(e){let{query:t="",page:n=1,pageSize:a=10}=e;const i=(0,d.ZP)("GET",this.eventNotificationsUrl({query:{query:t,page:n,per_page:a}}));i.then((e=>(this.notifications=e.notifications,this.query=e.query,this.pagination={count:e.count,page:e.page,pageSize:e.per_page,total:e.total,grandTotal:e.grand_total},this.propagateChanges(),e))),p.listPaginated.promise(i)},get(e){const t=(0,d.ZP)("GET",this.eventNotificationsUrl({segments:[e]}));t.catch((t=>{404===t.status&&u.Z.error(`Unable to find Event Notification with id <${e}>, please ensure it wasn't deleted.`,"Could not retrieve Event Notification")})),p.get.promise(t)},create(e){const t=(0,d.ZP)("POST",this.eventNotificationsUrl({}),e);t.then((t=>(u.Z.success("Notification created successfully",`Notification "${e.title}" was created successfully.`),this.refresh(),t)),(t=>{400===t.status&&t.additional.body&&t.additional.body.failed||u.Z.error(`Creating Notification "${e.title}" failed with status: ${t}`,"Could not save Notification")})),p.create.promise(t)},update(e,t){const n=(0,d.ZP)("PUT",this.eventNotificationsUrl({segments:[e]}),t);n.then((e=>(u.Z.success("Notification updated successfully",`Notification "${t.title}" was updated successfully.`),this.refresh(),e)),(e=>{400===e.status&&e.additional.body&&e.additional.body.failed||u.Z.error(`Updating Notification "${t.title}" failed with status: ${e}`,"Could not update Notification")})),p.update.promise(n)},delete(e){const t=(0,d.ZP)("DELETE",this.eventNotificationsUrl({segments:[e.id]}));t.then((()=>{u.Z.success("Notification deleted successfully",`Notification "${e.title}" was deleted successfully.`),this.refresh()}),(t=>{u.Z.error(`Deleting Notification "${e.title}" failed with status: ${t}`,"Could not delete Notification")})),p.delete.promise(t)},test(e){const t=(0,d.ZP)("POST",this.eventNotificationsUrl({segments:["test"]}),e);p.test.promise(t)},testPersisted(e){const t=(0,d.ZP)("POST",this.eventNotificationsUrl({segments:[e.id,"test"]}));p.testPersisted.promise(t)},listAllLegacyTypes(){const e=(0,d.ZP)("GET",this.eventNotificationsUrl({segments:["legacy","types"]}));e.then((e=>(this.allLegacyTypes=e.types,this.propagateChanges(),e))),p.listAllLegacyTypes.promise(e)}})))},"q/NP8wy0":(e,t,n)=>{n.d(t,{X:()=>h});var a=n("JnTtTRmZ"),i=n.n(a),s=n("VPaD/Np4"),l=n("oCSEoDew"),r=n.n(l),o=n("3KQynTtD"),c=n("OqsMdpSm"),u=n("rkoyttmq"),d=n("xc00RsLr"),m=n("0wQfx7YJ"),p=n("4sldgQy6"),g=n("Z7J0eezr");const h=(0,d.ei)("core.Users",(()=>i().createActions({create:{asyncResult:!0},load:{asyncResult:!0},loadByUsername:{asyncResult:!0},update:{asyncResult:!0},delete:{asyncResult:!0},changePassword:{asyncResult:!0},createToken:{asyncResult:!0},loadTokens:{asyncResult:!0},deleteToken:{asyncResult:!0},loadUsersPaginated:{asyncResult:!0},loadUsers:{asyncResult:!0},setStatus:{asyncResult:!0}})));(0,d.dS)("core.Users",(()=>i().createStore({listenables:[h],create(e){const t=(0,m.DC)(u.Z.UsersApiController.create().url),n=(0,c.ZP)("POST",t,e);return h.create.promise(n),n},load(e){const t=(0,m.DC)(u.Z.UsersApiController.load(encodeURIComponent(e)).url),n=(0,c.ZP)("GET",t).then(g.Z.fromJSON);return h.load.promise(n),n},loadByUsername(e){const t=(0,m.DC)(u.Z.UsersApiController.loadByUsername(encodeURIComponent(e)).url),n=(0,c.ZP)("GET",t).then(g.Z.fromJSON);return h.loadByUsername.promise(n),n},update(e,t){const n=(0,m.DC)(u.Z.UsersApiController.update(encodeURIComponent(e)).url),a=(0,c.ZP)("PUT",n,t);return h.update.promise(a),a},delete(e){const t=(0,m.DC)(u.Z.UsersApiController.delete(encodeURIComponent(e)).url),n=(0,c.ZP)("DELETE",t);return h.delete.promise(n),n},changePassword(e,t){const n=(0,m.DC)(u.Z.UsersApiController.changePassword(encodeURIComponent(e)).url),a=(0,c.ZP)("PUT",n,t);return h.changePassword.promise(a),a},createToken(e,t){const n=(0,m.DC)(u.Z.UsersApiController.create_token(encodeURIComponent(e),encodeURIComponent(t)).url),a=(0,c.ZP)("POST",n);return h.createToken.promise(a),a},loadTokens(e){const t=(0,m.DC)(u.Z.UsersApiController.list_tokens(encodeURIComponent(e)).url),n=(0,c.ZP)("GET",t).then((e=>e.tokens));return h.loadTokens.promise(n),n},deleteToken(e,t){const n=(0,m.DC)(u.Z.UsersApiController.delete_token(encodeURIComponent(e),encodeURIComponent(t)).url),a=(0,c.ZP)("DELETE",n);return h.deleteToken.promise(a),a},loadUsers(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(e=>{let{url:t="",query:n={}}=e;const a=new(r())(t);return a.query(n),(0,m.DC)(a.resource())})({url:u.Z.UsersApiController.list().url,query:e}),n=(0,c.ZP)("GET",t).then((e=>{let{users:t}=e;return s.List(t.map((e=>o.Z.fromJSON(e))))}));return h.loadUsers.promise(n),n},loadUsersPaginated(e){let{page:t,perPage:n,query:a}=e;const i=(0,p.Z)(u.Z.UsersApiController.paginated().url,t,n,a),l=(0,c.ZP)("GET",(0,m.DC)(i)).then((e=>({adminUser:e.context.admin_user?o.Z.fromJSON(e.context.admin_user):void 0,list:s.List(e.users.map((e=>o.Z.fromJSON(e)))),pagination:{page:e.page,perPage:e.per_page,query:e.query,count:e.count,total:e.total}})));return h.loadUsersPaginated.promise(l),l},setStatus(e,t){const n=(0,m.DC)(u.Z.UsersApiController.setStatus(e,t).url),a=(0,c.ZP)("PUT",n);return h.setStatus.promise(a),a}})))},ZddqZk1Z:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n("pmX897Fv"),i=n.n(a),s=n("DjJvgDaP"),l=n.n(s)()(i());l.push([e.id,".QOxROnWrKzReuEpPEJMw {\n table-layout: fixed;\n overflow-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/components/event-notifications/event-notification-types/CommonNotificationSummary.css"],names:[],mappings:"AAAA;IACI,mBAAmB;IACnB,yBAAyB;AAC7B",sourcesContent:[":local(.fixedTable) {\n table-layout: fixed;\n overflow-wrap: break-word;\n}\n"],sourceRoot:""}]),l.locals={fixedTable:"QOxROnWrKzReuEpPEJMw"};const r=l},eWgADhWh:(e,t,n)=>{n.d(t,{Z:()=>r});var a=n("pmX897Fv"),i=n.n(a),s=n("DjJvgDaP"),l=n.n(s)()(i());l.push([e.id,'.bN2Fa5FgSGHUh4zYUYzt {\n font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace;\n font-size: 1rem; /* theme.fonts.size.body */\n overflow-wrap: break-word;\n white-space: pre-wrap;\n}\n',"",{version:3,sources:["webpack://./src/components/event-notifications/event-notification-types/EmailNotificationSummary.css"],names:[],mappings:"AAAA;IACI,6EAA6E;IAC7E,eAAe,EAAE,0BAA0B;IAC3C,yBAAyB;IACzB,qBAAqB;AACzB",sourcesContent:[':local(.bodyPreview) {\n font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace;\n font-size: 1rem; /* theme.fonts.size.body */\n overflow-wrap: break-word;\n white-space: pre-wrap;\n}\n'],sourceRoot:""}]),l.locals={bodyPreview:"bN2Fa5FgSGHUh4zYUYzt"};const r=l},"+u3mJE4Q":(e,t,n)=>{n.d(t,{Z:()=>r});var a=n("pmX897Fv"),i=n.n(a),s=n("DjJvgDaP"),l=n.n(s)()(i());l.push([e.id,".rKKIeiSYDcRNaNEaL85y {\n margin-bottom: 15px;\n overflow-wrap: break-word;\n}\n","",{version:3,sources:["webpack://./src/components/event-notifications/event-notification-types/LegacyNotificationCommonStyles.css"],names:[],mappings:"AAAA;IACI,mBAAmB;IACnB,yBAAyB;AAC7B",sourcesContent:[":local(.legacyNotificationAlert) {\n margin-bottom: 15px;\n overflow-wrap: break-word;\n}\n"],sourceRoot:""}]),l.locals={legacyNotificationAlert:"rKKIeiSYDcRNaNEaL85y"};const r=l}}]); //# sourceMappingURL=325e2d4b-9046.64a02bdbf48d850d060f.js.map




    © 2015 - 2024 Weber Informatics LLC | Privacy Policy