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

web-interface.assets.325e2d4b-4779.2e828791258080e16181.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-4779"],{"ZfRiC/i0":(e,t,n)=>{n.d(t,{Z:()=>s});var i=n("Z7aTuO5B"),o=n("3kMHuq+3");function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{n.r(t),n.d(t,{default:()=>G});var i=n("Z7aTuO5B"),o=n("EeAwn/0x"),a=n("F9olzlTR"),s=n("0zTRKSqx"),r=n("ii0bleBb"),c=n.n(r),l=n("b/6pmtOr"),u=n("5GvVt6f3"),d=n("ZfRiC/i0"),m=n("AztyBNMT"),p=n("0zEavvpT"),g=n("hrRwHSRW"),f=n("DeVaSktS"),h=n("dFpwyWHg"),E=n.n(h),y=n("C2ikvoS0"),T=n.n(y),v=n("1IntWRSu"),A=n.n(v),S=n("8nGWeFnd"),b=n.n(S),R=n("TeAcaicX"),C=n.n(R),P=n("eE3+5goe"),N=n.n(P),q=n("5c1R34VZ"),I={};I.styleTagTransform=N(),I.setAttributes=b(),I.insert=A().bind(null,"head"),I.domAPI=T(),I.insertStyleElement=C();E()(q.Z,I);const Z=q.Z&&q.Z.locals?q.Z.locals:void 0;function w(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const O=[10,25,50];class L extends i.Component{constructor(e){super(e),w(this,"formatNotification",((e,t)=>{const{testResult:n}=this.props;return e.map((e=>{const r=n.id===e.id&&n.isLoading,c=this.formatActions(e,r,t),l=void 0===(u=e.config.type)?{}:m.PluginStore.exports("eventNotificationTypes").find((e=>e.type===u))||{};var u;const d=n.id===e.id?i.createElement(a.JX,{md:12},n.isLoading?i.createElement(s.$j,{text:"Testing Notification..."}):i.createElement("p",{className:n.error?"text-danger":"text-success"},i.createElement("b",null,n.error?"Error":"Success",":")," ",n.message)):null,p=i.createElement(o.r,{to:f.ZP.ALERTS.NOTIFICATIONS.show(e.id)},e.title);return i.createElement(s.S6,{key:`event-definition-${e.id}`,title:p,titleSuffix:l.displayName||e.config.type,description:e.description||i.createElement("em",null,"No description given"),actions:c,contentRow:d})}))})),this.state={notificationToShare:void 0}}formatActions(e,t,n){const{onDelete:r,onTest:c}=this.props;return i.createElement(p.Z,null,i.createElement(o.J,{to:f.ZP.ALERTS.NOTIFICATIONS.edit(e.id)},i.createElement(s.AE,{permissions:`eventnotifications:edit:${e.id}`},i.createElement(a.zx,null,i.createElement(s.JO,{name:"edit"})," Edit"))),i.createElement(s.Tz,{entityType:"notification",entityId:e.id,onClick:()=>n(e)}),i.createElement(s.AE,{permissions:[`eventnotifications:edit:${e.id}`,`eventnotifications:delete:${e.id}`],anyPermissions:!0},i.createElement(a.PS,{id:`more-dropdown-${e.id}`,title:"More",pullRight:!0},i.createElement(s.AE,{permissions:`eventnotifications:edit:${e.id}`},i.createElement(a.sN,{disabled:t,onClick:c(e)},t?"Testing...":"Test Notification")),i.createElement(a.sN,{divider:!0}),i.createElement(s.AE,{permissions:`eventnotifications:delete:${e.id}`},i.createElement(a.sN,{onClick:r(e)},"Delete")))))}render(){const{notifications:e,pagination:t,query:n,onPageChange:r,onQueryChange:c}=this.props,{notificationToShare:l}=this.state,u=e=>this.setState({notificationToShare:e});return 0===t.grandTotal?i.createElement(a.X2,null,i.createElement(a.JX,{md:4,mdOffset:4},i.createElement(s.ai,null,i.createElement("p",null,"Configure Event Notifications that can alert you when an Event occurs. You can also use Notifications to integrate Graylog Alerts with an external alerting system you use."),i.createElement(s.AE,{permissions:"eventnotifications:create"},i.createElement(o.J,{to:f.ZP.ALERTS.NOTIFICATIONS.CREATE},i.createElement(a.zx,{bsStyle:"success"},"Get Started!")))))):i.createElement(i.Fragment,null,i.createElement(a.X2,null,i.createElement(a.JX,{md:12},i.createElement(s.UI,{query:n,onSearch:c,onReset:c,searchButtonLabel:"Find",placeholder:"Find Notifications",wrapperClass:Z.inline,queryHelpComponent:i.createElement(s.y8,{entityName:"notification"}),queryWidth:200,topMargin:0,useLoadingState:!0}),i.createElement(s.l9,{pageSizes:O,totalItems:t.total,onChange:r},i.createElement("div",{className:Z.notificationList},i.createElement(s.XO,{items:this.formatNotification(e,u)}))))),l&&i.createElement(g.Z,{entityId:l.id,entityType:"notification",description:"Search for a User or Team to add as collaborator on this notification.",entityTitle:l.title,onClose:()=>u(void 0)}))}}w(L,"propTypes",{notifications:c().array.isRequired,pagination:c().object.isRequired,query:c().string.isRequired,testResult:c().shape({isLoading:c().bool,id:c().string,error:c().bool,message:c().string}).isRequired,onPageChange:c().func.isRequired,onQueryChange:c().func.isRequired,onDelete:c().func.isRequired,onTest:c().func.isRequired});const k=L;n("BXP2KjIr");function z(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const x=e=>{let{page:t,pageSize:n,query:i}=e;return u.e.listPaginated({query:i,page:t,pageSize:n})},j=e=>()=>{window.confirm(`Are you sure you want to delete "${e.title}"?`)&&u.e.delete(e)};class D extends i.Component{constructor(e){var t;super(e),t=this,z(this,"handlePageChange",((e,t)=>{const{notifications:n}=this.props;x({page:e,pageSize:t,query:n.query})})),z(this,"handleQueryChange",(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};const{pageSize:i,resetPage:o}=t.props.paginationQueryParameter;o();const a=x({query:e,pageSize:i});a.finally(n)})),z(this,"handleTest",(e=>()=>{this.setState({testResult:{isLoading:!0,id:e.id}});let t={isLoading:!1};this.testPromise&&this.testPromise.cancel(),this.testPromise=u.e.testPersisted(e),this.testPromise.then((n=>(t={isLoading:!1,id:e.id,error:!1,message:"Notification was executed successfully."},n)),(n=>(t={isLoading:!1,id:e.id,error:!0},400===n.status&&n.additional.body&&n.additional.body.failed||(t.message=n.responseMessage||"Unknown errorResponse, please check your Graylog server logs."),n))).finally((()=>{this.setState({testResult:t}),this.testPromise=void 0}))})),this.state={testResult:{}}}componentDidMount(){const{page:e,pageSize:t}=this.props.paginationQueryParameter;x({page:e,pageSize:t})}componentWillUnmount(){this.testPromise&&this.testPromise.cancel()}render(){const{notifications:e}=this.props,{testResult:t}=this.state;return e.notifications?i.createElement(k,{notifications:e.notifications,pagination:e.pagination,query:e.query,testResult:t,onPageChange:this.handlePageChange,onQueryChange:this.handleQueryChange,onDelete:j,onTest:this.handleTest}):i.createElement(s.$j,{text:"Loading Notifications information..."})}}z(D,"propTypes",{notifications:c().object,paginationQueryParameter:c().object.isRequired}),z(D,"defaultProps",{notifications:void 0});const F=(0,l.Z)((0,d.Z)(D,{pageSizes:O}),{notifications:u.O});var X=n("4Js8dUPg"),B=n("GdY2o7iN");const G=()=>i.createElement(s.$4,{title:"Notifications"},i.createElement(B.Z,null),i.createElement(s.mr,{title:"Notifications",actions:i.createElement(s.AE,{permissions:"eventnotifications:create"},i.createElement(o.J,{to:f.ZP.ALERTS.NOTIFICATIONS.CREATE},i.createElement(a.zx,{bsStyle:"success"},"Create notification"))),documentationLink:{title:"Alerts documentation",path:X.Z.PAGES.ALERTS}},i.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. Remember to assign Notifications while creating or editing an Event Definition.")),i.createElement(a.X2,{className:"content"},i.createElement(a.JX,{md:12},i.createElement(F,null))))},"5c1R34VZ":(e,t,n)=>{n.d(t,{Z:()=>r});var i=n("pmX897Fv"),o=n.n(i),a=n("DjJvgDaP"),s=n.n(a)()(o());s.push([e.id,".FnZT8GuTq42YjXVGfTcW {\n    margin-top: 10px;\n}\n\n.sDIUj6rDoQWioRbUUkH1 {\n    display: inline-block;\n}\n","",{version:3,sources:["webpack://./src/components/event-notifications/event-notifications/EventNotifications.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB;;AAEA;IACI,qBAAqB;AACzB",sourcesContent:[":local(.notificationList) {\n    margin-top: 10px;\n}\n\n:local(.inline) {\n    display: inline-block;\n}\n"],sourceRoot:""}]),s.locals={notificationList:"FnZT8GuTq42YjXVGfTcW",inline:"sDIUj6rDoQWioRbUUkH1"};const r=s}}]);
//# sourceMappingURL=325e2d4b-4779.2e828791258080e16181.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy