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

web-interface.assets.36.746b58959a350aa1ebcf.js Maven / Gradle / Ivy

There is a newer version: 6.0.6
Show newest version
webpackJsonp([36],{1345:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(2),a=i(n),o=e(1),l=i(o),r=e(16),s=e(915),u=e(46),c=e(923),f=e(76),d=i(f),m=e(23),p=i(m),h=p.default.getStore("CurrentUser"),g=a.default.createClass({displayName:"AlertNotificationsPage",mixins:[l.default.connect(h)],render:function(){return a.default.createElement(u.DocumentTitle,{title:"Alert notifications"},a.default.createElement("div",null,a.default.createElement(u.PageHeader,{title:"Manage alert notifications"},a.default.createElement("span",null,"Notifications let you be aware of changes in your alert conditions status any time. Graylog can send notifications directly to you or to other systems you use for that purpose."),a.default.createElement("span",null,"Remember to assign the notifications to use in the alert conditions page."),a.default.createElement("span",null,a.default.createElement(s.LinkContainer,{to:d.default.ALERTS.CONDITIONS},a.default.createElement(r.Button,{bsStyle:"info"},"Manage conditions"))," ",a.default.createElement(r.Button,{bsStyle:"info",href:"https://marketplace.graylog.org/",target:"_blank"},a.default.createElement("i",{className:"fa fa-external-link"}),"  Find more notifications"))),a.default.createElement(r.Row,{className:"content"},a.default.createElement(r.Col,{md:12},a.default.createElement(c.AlertNotificationsComponent,null)))))}});exports.default=g,t.exports=exports.default},923:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(938);Object.defineProperty(exports,"AlertNotification",{enumerable:!0,get:function(){return i(n).default}});var a=e(939);Object.defineProperty(exports,"AlertNotificationsComponent",{enumerable:!0,get:function(){return i(a).default}});var o=e(940);Object.defineProperty(exports,"AlertNotificationsList",{enumerable:!0,get:function(){return i(o).default}});var l=e(941);Object.defineProperty(exports,"CreateAlertNotificationInput",{enumerable:!0,get:function(){return i(l).default}});var r=e(942);Object.defineProperty(exports,"UnknownAlertNotification",{enumerable:!0,get:function(){return i(r).default}})},938:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(5),a=i(n),o=e(2),l=i(o),r=e(1),s=i(r),u=e(16),c=e(167),f=i(c),d=e(68),m=i(d),p=e(46),h=e(923),g=e(919),N=m.default.get("AlertNotifications"),E=N.AlertNotificationsStore,y=m.default.get("AlarmCallbacks"),_=y.AlarmCallbacksActions,b=m.default.get("CurrentUser"),S=b.CurrentUserStore,v=l.default.createClass({displayName:"AlertNotification",propTypes:{alertNotification:a.default.object.isRequired,stream:a.default.object,onNotificationUpdate:a.default.func,onNotificationDelete:a.default.func},mixins:[s.default.connect(E),s.default.connect(S),f.default],getInitialState:function(){return{isTestingAlert:!1}},_onTestNotification:function(){var t=this;this.setState({isTestingAlert:!0}),E.testAlert(this.props.alertNotification.id).finally(function(){return t.setState({isTestingAlert:!1})})},_onEdit:function(){this.refs.configurationForm.open()},_onSubmit:function(t){var e=this;_.update(this.props.alertNotification.stream_id,this.props.alertNotification.id,t).then(function(){"function"==typeof e.props.onNotificationUpdate&&e.props.onNotificationUpdate()})},_onDelete:function(){var t=this;window.confirm("Really delete alert notification?")&&_.delete(this.props.alertNotification.stream_id,this.props.alertNotification.id).then(function(){"function"==typeof t.props.onNotificationUpdate&&t.props.onNotificationUpdate()})},render:function(){if(!this.state.availableNotifications)return l.default.createElement(p.Spinner,null);var t=this.props.alertNotification,e=this.props.stream,i=this.state.availableNotifications[t.type];if(!i)return l.default.createElement(h.UnknownAlertNotification,{alertNotification:t,onDelete:this._onDelete});var n=e?l.default.createElement("span",null,"Executed once per triggered alert condition in stream ",l.default.createElement("em",null,e.title)):"Not executed, as it is not connected to a stream",a=this.isPermitted(this.state.currentUser.permissions,["streams:edit:"+e.id])&&[l.default.createElement(u.Button,{key:"test-button",bsStyle:"info",disabled:this.state.isTestingAlert,onClick:this._onTestNotification},this.state.isTestingAlert?"Testing...":"Test"),l.default.createElement(u.DropdownButton,{key:"more-actions-button",title:"More actions",pullRight:!0,id:"more-actions-dropdown-"+t.id},l.default.createElement(u.MenuItem,{onSelect:this._onEdit},"Edit"),l.default.createElement(u.MenuItem,{divider:!0}),l.default.createElement(u.MenuItem,{onSelect:this._onDelete},"Delete"))],o=l.default.createElement(u.Col,{md:12},l.default.createElement("div",{className:"alert-callback alarm-callbacks"},l.default.createElement(g.ConfigurationForm,{ref:"configurationForm",key:"configuration-form-notification-"+t.id,configFields:i.requested_configuration,title:"Editing alert configuration ",typeName:t.type,titleValue:t.title,submitAction:this._onSubmit,values:t.configuration}),l.default.createElement(g.ConfigurationWell,{configuration:t.configuration,typeDefinition:i})));return l.default.createElement(p.EntityListItem,{key:"entry-list-"+t.id,title:t.title?t.title:"Untitled",titleSuffix:"("+i.name+")",description:n,actions:a,contentRow:o})}});exports.default=v,t.exports=exports.default},939:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(2),a=i(n),o=e(1),l=i(o),r=e(16),s=e(915),u=e(917),c=i(u),f=e(46),d=e(923),m=e(76),p=i(m),h=e(68),g=i(h),N=g.default.get("AlertNotifications"),E=N.AlertNotificationsStore,y=N.AlertNotificationsActions,_=g.default.get("Streams"),b=_.StreamsStore,S=a.default.createClass({displayName:"AlertNotificationsComponent",mixins:[l.default.connect(E)],getInitialState:function(){return{streams:void 0}},componentDidMount:function(){this._loadData()},_loadData:function(){var t=this;b.listStreams().then(function(e){t.setState({streams:e})}),y.available(),y.listAll()},_isLoading:function(){return!this.state.streams||!this.state.availableNotifications||!this.state.allNotifications},render:function(){if(this._isLoading())return a.default.createElement(f.Spinner,null);var t=this.state.allNotifications.sort(function(t,e){var i=t.title||"Untitled",n=e.title||"Untitled";return(0,c.default)(i.toLowerCase(),n.toLowerCase())});return a.default.createElement("div",null,a.default.createElement("div",{className:"pull-right"},a.default.createElement(s.LinkContainer,{to:p.default.ALERTS.NEW_NOTIFICATION},a.default.createElement(r.Button,{bsStyle:"success"},"Add new notification"))),a.default.createElement("h2",null,"Notifications"),a.default.createElement("p",null,"These are all configured alert notifications."),a.default.createElement(d.AlertNotificationsList,{alertNotifications:t,streams:this.state.streams,onNotificationUpdate:this._loadData,onNotificationDelete:this._loadData}))}});exports.default=S,t.exports=exports.default},940:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(5),a=i(n),o=e(2),l=i(o),r=e(923),s=e(46),u=l.default.createClass({displayName:"AlertNotificationsList",propTypes:{alertNotifications:a.default.array.isRequired,streams:a.default.array.isRequired,onNotificationUpdate:a.default.func,onNotificationDelete:a.default.func},getInitialState:function(){return{currentPage:0}},PAGE_SIZE:10,_onChangePaginatedList:function(t){this.setState({currentPage:t-1})},_paginatedNotifications:function(){return this.props.alertNotifications.slice(this.state.currentPage*this.PAGE_SIZE,(this.state.currentPage+1)*this.PAGE_SIZE)},_formatNotification:function(t){var e=this.props.streams.find(function(e){return e.id===t.stream_id});return l.default.createElement(r.AlertNotification,{key:t.id,alertNotification:t,stream:e,onNotificationUpdate:this.props.onNotificationUpdate,onNotificationDelete:this.props.onNotificationDelete})},render:function(){var t=this,e=this.props.alertNotifications;return l.default.createElement(s.PaginatedList,{totalItems:e.length,onChange:this._onChangePaginatedList,showPageSizeSelect:!1,pageSize:this.PAGE_SIZE},l.default.createElement(s.EntityList,{bsNoItemsStyle:"info",noItemsText:"There are no configured notifications.",items:this._paginatedNotifications().map(function(e){return t._formatNotification(e)})}))}});exports.default=u,t.exports=exports.default},941:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(2),a=i(n),o=e(1),l=i(o),r=e(917),s=i(r),u=e(16),c=e(47),f=e(46),d=e(919),m=e(76),p=i(m),h=e(6),g=i(h),N=e(168),E=i(N),y=e(68),_=i(y),b=_.default.get("AlertNotifications"),S=b.AlertNotificationsStore,v=b.AlertNotificationsActions,A=_.default.get("AlarmCallbacks"),C=A.AlarmCallbacksActions,L=_.default.get("Streams"),P=L.StreamsStore,k=a.default.createClass({displayName:"CreateAlertNotificationInput",mixins:[l.default.connect(S)],getInitialState:function(){return{streams:void 0,selectedStream:void 0,type:this.PLACEHOLDER}},componentDidMount:function(){var t=this;P.listStreams().then(function(e){t.setState({streams:e})}),v.available()},PLACEHOLDER:"placeholder",_onChange:function(t){this.setState({type:t.target.value})},_onStreamChange:function(t){this.setState({selectedStream:this.state.streams.find(function(e){return e.id===t})})},_onSubmit:function(t){var e=this;this.state.selectedStream||g.default.error("Please select the stream that the condition should check.","Could not save condition"),C.save(this.state.selectedStream.id,t).then(function(){E.default.pushState(null,p.default.ALERTS.NOTIFICATIONS)},function(){return e.refs.configurationForm.open()})},_openForm:function(){this.refs.configurationForm.open()},_resetForm:function(){this.setState({type:this.PLACEHOLDER})},_formatNotificationForm:function(t){var e=this.state.availableNotifications[t];return a.default.createElement(d.ConfigurationForm,{ref:"configurationForm",key:"configuration-form-output",configFields:e.requested_configuration,title:"Create new "+e.name,typeName:t,submitAction:this._onSubmit,cancelAction:this._resetForm})},_formatOption:function(t,e){return{value:e,label:t}},_isLoading:function(){return!this.state.availableNotifications||!this.state.streams},render:function(){var t=this;if(this._isLoading())return a.default.createElement(f.Spinner,null);var e=this.state.type!==this.PLACEHOLDER?this._formatNotificationForm(this.state.type):null,i=Object.keys(this.state.availableNotifications).map(function(e){return a.default.createElement("option",{key:"type-option-"+e,value:e},t.state.availableNotifications[e].name)}),n=this.state.streams.map(function(e){return t._formatOption(e.title,e.id)}).sort(function(t,e){return(0,s.default)(t.label.toLowerCase(),e.label.toLowerCase())});return a.default.createElement("div",null,a.default.createElement(f.ExternalLinkButton,{href:"https://marketplace.graylog.org/",bsStyle:"info",className:"pull-right"},"Find more notifications"),a.default.createElement("h2",null,"Notification"),a.default.createElement("p",{className:"description"},"Define the notification that will be triggered from the alert conditions in a stream."),a.default.createElement(u.Row,null,a.default.createElement(u.Col,{md:6},a.default.createElement("form",null,a.default.createElement(c.Input,{label:"Notify on stream",help:"Select the stream that should use this notification when its alert conditions are triggered."},a.default.createElement(f.Select,{placeholder:"Select a stream",options:n,onChange:this._onStreamChange})),a.default.createElement(c.Input,{type:"select",value:this.state.type,onChange:this._onChange,disabled:!this.state.selectedStream,label:"Notification type",help:"Select the notification type that will be used."},a.default.createElement("option",{value:this.PLACEHOLDER,disabled:!0},"Select a notification type"),i),e," ",a.default.createElement(u.Button,{onClick:this._openForm,disabled:this.state.type===this.PLACEHOLDER,bsStyle:"success"},"Add alert notification")))))}});exports.default=k,t.exports=exports.default},942:function(t,exports,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(exports,"__esModule",{value:!0});var n=e(5),a=i(n),o=e(2),l=i(o),r=e(16),s=e(46),u=l.default.createClass({displayName:"UnknownAlertNotification",propTypes:{alertNotification:a.default.object.isRequired,onDelete:a.default.func.isRequired},render:function(){var t=this.props.alertNotification,e=[l.default.createElement(r.DropdownButton,{key:"actions-button",title:"Actions",pullRight:!0,id:"more-actions-dropdown-"+t.id},l.default.createElement(r.MenuItem,{onSelect:this.props.onDelete},"Delete"))],i=l.default.createElement(r.Col,{md:12},l.default.createElement(r.Alert,{bsStyle:"warning"},"Could not resolve notification type. This is most likely caused by a missing plugin in your Graylog setup."));return l.default.createElement(s.EntityListItem,{key:"entry-list-"+t.id,title:"Unknown notification",titleSuffix:"("+t.type+")",description:"Cannot be executed while the notification type is unknown",actions:e,contentRow:i})}});exports.default=u,t.exports=exports.default}});
//# sourceMappingURL=36.746b58959a350aa1ebcf.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy