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

web-interface.assets.d5f85445-0.a49ba8ace624afae35ed.js Maven / Gradle / Ivy

There is a newer version: 6.0.6
Show newest version
(window.webpackJsonp=window.webpackJsonp||[]).push([["d5f85445-0"],{"7NKO1ghU":function(t,e,n){"use strict";var r=n("ii0bleBb"),o=n.n(r),i=n("ivGQtwpr"),a=n.n(i),c=n("ZX4j5H1r"),l=n("qoq4u5Uq"),s=n("oBIKikY9"),u=n("W+sNG9T1"),f=n("QDVhqBhn"),p=n("wj38KA5i"),m=n.n(p);function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function y(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var n=0;n0?t.setState({messages:e.messages,totalMessages:e.total_results}):t.setState({messages:[],totalMessages:0})}),(function(t){yt.a.error("Fetching messages during alert failed with error: ".concat(t),"Could not get messages during alert")}))})),Ct(St(t),"_isLoading",(function(){return!t.state.messages})),Ct(St(t),"_onPageChange",(function(e){t._loadData(e)})),Ct(St(t),"_formatMessages",(function(t){return t.map((function(t){return a.a.createElement("tr",{key:"".concat(t.index,"-").concat(t.id)},a.a.createElement("td",null,a.a.createElement(s.P,{dateTime:t.formatted_fields.timestamp})),a.a.createElement("td",null,t.formatted_fields.message))}))})),Ct(St(t),"_formatAlertTimeRange",(function(){return a.a.createElement("span",null,"(",a.a.createElement(s.P,{dateTime:t._getFrom(),format:f.a.Formats.DATETIME})," – ",a.a.createElement(s.P,{dateTime:t._getTo(),format:f.a.Formats.DATETIME}),")")})),t}return e=i,(n=[{key:"componentDidMount",value:function(){this._loadData()}},{key:"render",value:function(){var t={rangetype:"absolute",from:this._getFrom(),to:this._getTo()},e=a.a.createElement("div",null,a.a.createElement("div",{className:"pull-right"},a.a.createElement(w.LinkContainer,{to:u.a.stream_search(this.props.stream.id,"*",t)},a.a.createElement(l.c,{bsStyle:"info"},"Open in search page"))),a.a.createElement("h2",null,"Messages evaluated"),a.a.createElement("p",null,"These are the messages evaluated around the time of the alert ",this._formatAlertTimeRange()," in stream"," ",a.a.createElement("em",null,this.props.stream.title),"."));if(this._isLoading())return a.a.createElement("div",null,e,a.a.createElement(s.L,null));var n=this.state.messages;return 0===n.length?a.a.createElement("div",null,e,a.a.createElement(l.a,{bsStyle:"info"},"No search results found during the time of the alert.")):a.a.createElement("div",null,e,a.a.createElement(s.B,{pageSize:this.PAGE_SIZE,onChange:this._onPageChange,totalItems:this.state.totalMessages,showPageSizeSelect:!1},a.a.createElement("div",{className:"table-responsive"},a.a.createElement("table",{className:"table table-striped table-hover table-condensed"},a.a.createElement("thead",null,a.a.createElement("tr",null,a.a.createElement("th",null,"Timestamp"),a.a.createElement("th",null,"Message"))),a.a.createElement("tbody",null,this._formatMessages(n))))))}}])&>(e.prototype,n),r&>(e,r),i}(a.a.Component);Ct(Ot,"propTypes",{alert:o.a.object.isRequired,stream:o.a.object.isRequired});var Pt=Ot,Rt=n("YPyIcTeH"),At=n.n(Rt),jt=K.a.get("Alerts"),Tt=jt.AlertsStore,Dt=jt.AlertsActions,kt=K.a.get("AlertConditions"),Nt=kt.AlertConditionsStore,Lt=kt.AlertConditionsActions,It=K.a.get("Streams").StreamsStore,xt=Z()({displayName:"AlertsComponent",mixins:[X.a.connect(Tt),X.a.connect(Nt)],getInitialState:function(){return{displayAllAlerts:!1,loading:!1}},componentDidMount:function(){var t=this;this.loadData(this.currentPage,this.pageSize),this.interval=setInterval((function(){return t.fetchData(t.currentPage,t.pageSize)}),1e4)},componentWillUnmount:function(){this.interval&&clearInterval(this.interval)},currentPage:1,pageSize:10,loadData:function(t,e){var n=this;this.setState({loading:!0});var r=this.fetchData(t,e);At.a.all(r).finally((function(){return n.setState({loading:!1})}))},fetchData:function(t,e){var n=this,r=this.state.displayAllAlerts;return[Dt.listAllPaginated((t-1)*e,e,r?"any":"unresolved"),Lt.listAll(),Lt.available(),It.listStreams().then((function(t){n.setState({streams:t})}))]},refreshData:function(){this.loadData(this.currentPage,this.pageSize)},_onToggleAllAlerts:function(){var t=this,e=this.state.displayAllAlerts;this.currentPage=1,this.pageSize=10,this.setState({displayAllAlerts:!e},(function(){return t.loadData(t.currentPage,t.pageSize)}))},_onChangePaginatedList:function(t,e){this.currentPage=t,this.pageSize=e,this.loadData(t,e)},_formatAlert:function(t){var e=this.state,n=e.allAlertConditions,r=e.streams,o=e.availableConditions,i=n.find((function(e){return e.id===t.condition_id})),c=r.find((function(e){return e.id===t.stream_id})),l=i?o[i.type]:{};return a.a.createElement(C,{key:t.id,alert:t,alertCondition:i,stream:c,conditionType:l})},_isLoading:function(){var t=this.state,e=t.alerts,n=t.allAlertConditions,r=t.streams,o=t.availableConditions;return!(e&&n&&o&&r)},render:function(){var t=this;if(this._isLoading())return a.a.createElement(s.L,null);var e=this.state,n=e.loading,r=e.displayAllAlerts,o=e.alerts;return a.a.createElement("div",null,a.a.createElement("div",{className:"pull-right"},a.a.createElement(l.c,{bsStyle:"info",onClick:this.refreshData,disabled:n},n?"Refreshing...":"Refresh")," ",a.a.createElement(l.c,{bsStyle:"info",onClick:this._onToggleAllAlerts},"Show ",r?"unresolved":"all"," alerts")),a.a.createElement("h2",null,r?"Alerts":"Unresolved alerts"),a.a.createElement("p",{className:"description"},"Check your alerts status from here. Currently displaying"," ",r?"all":"unresolved"," alerts."),a.a.createElement(s.B,{totalItems:o.total,pageSize:this.pageSize,onChange:this._onChangePaginatedList,showPageSizeSelect:!1},a.a.createElement(s.k,{bsNoItemsStyle:r?"info":"success",noItemsText:r?"There are no alerts to display":"Good news! Currently there are no unresolved alerts.",items:o.alerts.map((function(e){return t._formatAlert(e)}))})))}}),Ut=n("tf+eiskh"),qt=n.n(Ut),Ft=K.a.get("AlarmCallbackHistory").AlarmCallbackHistoryStore,Mt=K.a.get("AlertNotifications").AlertNotificationsStore,Ht=Z()({displayName:"AlertTimeline",propTypes:{alert:o.a.object.isRequired,stream:o.a.object.isRequired,condition:o.a.object,conditionType:o.a.object},mixins:[X.a.connect(Mt),X.a.connect(Ft)],_isLoading:function(){return!this.state.histories||!this.state.availableNotifications},_historiesTimeline:function(t){var e=this,n=[];return 0===this.state.histories.length?[a.a.createElement("dt",{key:"history-title"},a.a.createElement(s.P,{dateTime:t})),a.a.createElement("dd",{key:"history-desc"},"No notifications were configured for this alert")]:(this.state.histories.sort((function(t,e){return Object(J.b)(t.created_at,e.created_at)})).forEach((function(t){var r,o=t.alarmcallbackconfiguration,i=e.state.availableNotifications[o.type];r=i?a.a.createElement("span",null,a.a.createElement("em",null,o.title||"Untitled notification")," (",i.name,")"):a.a.createElement("span",null,a.a.createElement("em",null,"Unknown notification")," ",a.a.createElement("small",null,"(",o.type,")")),n.push(a.a.createElement("dt",{key:"".concat(t.id,"-title")},a.a.createElement(s.P,{dateTime:t.created_at})),a.a.createElement("dd",{key:"".concat(t.id,"-desc")},"Graylog ","error"===t.result.type?"could not send":"sent"," ",r," notification"))})),n)},_resolutionTimeline:function(){var t=[];if(this.props.alert.is_interval)if(this.props.alert.resolved_at)t.push(a.a.createElement("dt",{key:"resolution-title"},a.a.createElement(s.P,{dateTime:this.props.alert.resolved_at})),a.a.createElement("dd",{key:"resolution-desc"},"Condition is no longer satisfied, alert is marked as resolved"));else{var e=(this.props.alert.condition_parameters||{}).repeat_notifications||!1?"Condition is configured to repeat notifications, Graylog will send notifications when evaluating the condition until it is no longer satisfied":"Condition is configured to not repeat notifications";t.push(a.a.createElement("dt",{key:"notifications-title"},a.a.createElement(s.P,{dateTime:new Date})),a.a.createElement("dd",{key:"notifications-desc"},e),a.a.createElement("dt",{key:"resolution-title"},a.a.createElement(s.P,{dateTime:new Date})),a.a.createElement("dd",{key:"resolution-desc"},"Condition is still satisfied, ",a.a.createElement("strong",null,"alert is unresolved")))}else t.push(a.a.createElement("dt",{key:"resolution-title"},a.a.createElement(s.P,{dateTime:this.props.alert.triggered_at})),a.a.createElement("dd",{key:"resolution-desc"},"This alert does not support resolution. It was marked as resolved when triggered."));return t},render:function(){if(this._isLoading())return a.a.createElement(s.L,null);var t=this.props.alert,e=this.props.condition&&Object.keys(this.props.condition).length>0,n=this.props.condition||{},r=this.props.conditionType,o=a.a.createElement(s.P,{dateTime:t.triggered_at}),i=a.a.createElement("span",null,a.a.createElement("em",null,e?n.title||"Untitled condition":"Unknown condition")," ","(",r.name||n.type||"Unknown condition type",")");return a.a.createElement("dl",{className:"dl-horizontal ".concat(qt.a.alertTimeline)},a.a.createElement("dt",null,o),a.a.createElement("dd",null,"Graylog checks ",i," condition on stream ",a.a.createElement("em",null,this.props.stream.title)),a.a.createElement("dt",null,o),a.a.createElement("dd",null,t.description),a.a.createElement("dt",null,o),a.a.createElement("dd",null,"Graylog triggers an alert for ",i," and starts sending notifications"),this._historiesTimeline(t.triggered_at),this._resolutionTimeline())}}),Gt=K.a.get("Alerts"),Vt=Gt.AlertsStore,zt=Gt.AlertsActions,Wt=Z()({displayName:"StreamAlerts",propTypes:{stream:o.a.object.isRequired,alertConditions:o.a.array.isRequired,availableConditions:o.a.object.isRequired},mixins:[X.a.connect(Vt)],getInitialState:function(){return{loading:!0}},componentDidMount:function(){var t=this;this.loadData(this.currentPage,this.pageSize),this.interval=setInterval((function(){return t.fetchData(t.currentPage,t.pageSize)}),1e4)},componentWillUnmount:function(){this.interval&&clearInterval(this.interval)},currentPage:1,pageSize:3,loadData:function(t,e){var n=this;this.setState({loading:!0}),this.fetchData(t,e).finally((function(){return n.setState({loading:!1})}))},fetchData:function(t,e){return zt.listPaginated(this.props.stream.id,(t-1)*e,e,"unresolved")},_onChangePaginatedList:function(t,e){this.currentPage=t,this.pageSize=e,this.loadData(t,e)},_formatAlert:function(t){var e=this.props.alertConditions.find((function(e){return e.id===t.condition_id})),n=e?this.props.availableConditions[e.type]:{};return a.a.createElement(C,{key:t.id,alert:t,alertCondition:e,stream:this.props.stream,conditionType:n})},render:function(){var t=this;return this.state.loading?a.a.createElement(s.L,null):a.a.createElement("div",null,a.a.createElement("h2",null,"Unresolved Alerts"),a.a.createElement("p",{className:"description"},"These are the Alerts for this Stream that require your attention. Alerts will be resolved automatically when the Condition that triggered them is no longer satisfied."),a.a.createElement(s.B,{totalItems:this.state.alerts.total,pageSize:this.pageSize,onChange:this._onChangePaginatedList,showPageSizeSelect:!1},a.a.createElement(s.k,{bsNoItemsStyle:"success",noItemsText:"Good news! Currently there are no unresolved alerts on this stream.",items:this.state.alerts.alerts.map((function(e){return t._formatAlert(e)}))})))}}),Qt=n("ulKR5lF3"),Bt=n("V8O/dgQq"),Zt=K.a.get("AlertConditions"),Yt=Zt.AlertConditionsStore,Xt=Zt.AlertConditionsActions,Kt=Z()({displayName:"StreamAlertsOverviewContainer",propTypes:{stream:o.a.object.isRequired},mixins:[X.a.connect(Yt)],getInitialState:function(){return{loading:!0}},componentDidMount:function(){this.loadData()},loadData:function(){var t=this;this.setState({loading:!0});var e=this.fetchData();At.a.all(e).finally((function(){return t.setState({loading:!1})}))},fetchData:function(){return[Xt.list(this.props.stream.id),Xt.available()]},render:function(){if(this.state.loading)return a.a.createElement(s.L,null);var t=this.props.stream,e=this.state,n=e.alertConditions,r=e.availableConditions;return a.a.createElement(a.a.Fragment,null,a.a.createElement(l.I,{className:"content"},a.a.createElement(l.h,{md:12},a.a.createElement(Wt,{stream:t,alertConditions:n,availableConditions:r}))),a.a.createElement(l.I,{className:"content"},a.a.createElement(l.h,{md:12},a.a.createElement(Qt.j,{stream:t,alertConditions:n,availableConditions:r,onConditionUpdate:this.fetchData,onConditionDelete:this.fetchData}))),a.a.createElement(l.I,{className:"content"},a.a.createElement(l.h,{md:12},a.a.createElement(Bt.e,{stream:t}))))}});n.d(e,"a",(function(){return C})),n.d(e,"f",(function(){return L})),n.d(e,"b",(function(){return dt})),n.d(e,"c",(function(){return Pt})),n.d(e,"e",(function(){return xt})),n.d(e,"d",(function(){return Ht})),n.d(e,"g",(function(){return Wt})),n.d(e,"h",(function(){return Kt}))},"9UnUDoQf":function(t,exports,e){(exports=t.exports=e("wTjlWjHz")(!1)).push([t.i,"ul._16zQRTCAtSVZNQD7bYDQTR{list-style-type:disc}._1qYsBoPcDjPwHQrPoqmPG{padding-left:20px}._3Qey3eXr5ZVFXIpyZoR2Ma{float:left;line-height:inherit}",""]),exports.locals={errorMessages:"_16zQRTCAtSVZNQD7bYDQTR",testResultText:"_1qYsBoPcDjPwHQrPoqmPG",testResultIcon:"_3Qey3eXr5ZVFXIpyZoR2Ma"}},ILZIWXp8:function(t,exports,e){(exports=t.exports=e("wTjlWjHz")(!1)).push([t.i,".g95Sn8lHxAA_SpWHyk37X dt{text-align:left;width:140px}.g95Sn8lHxAA_SpWHyk37X dd{margin-left:160px}",""]),exports.locals={alertTimeline:"g95Sn8lHxAA_SpWHyk37X"}},T6WiRsQ1:function(t,exports,e){var n=e("9UnUDoQf");"string"==typeof n&&(n=[[t.i,n,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};e("HkU00dYq")(n,r);n.locals&&(t.exports=n.locals)},"V8O/dgQq":function(t,e,n){"use strict";var r=n("ii0bleBb"),o=n.n(r),i=n("ivGQtwpr"),a=n.n(i),c=n("PcYM+wZ7"),l=n.n(c),s=n("4KF7VOU5"),u=n.n(s),f=n("wkvtUUMm"),p=n("dOmQZ9N/"),m=n("21p8kIWv"),d=n("qoq4u5Uq"),y=n("oBIKikY9"),h=n("cqPeOTxf"),b=n("W+sNG9T1"),g=m.a.get("AlertNotifications").AlertNotificationsStore,v=m.a.get("AlarmCallbacks").AlarmCallbacksActions,E=m.a.get("CurrentUser").CurrentUserStore,S=l()({displayName:"AlertNotification",propTypes:{alertNotification:o.a.object.isRequired,stream:o.a.object,onNotificationUpdate:o.a.func.isRequired,onNotificationDelete:o.a.func.isRequired,isStreamView:o.a.bool},mixins:[u.a.connect(g),u.a.connect(E),p.a],getDefaultProps:function(){return{stream:void 0,isStreamView:!1}},getInitialState:function(){return{isTestingAlert:!1,isConfigurationShown:!1}},_onTestNotification:function(){var t=this,e=this.props.alertNotification;this.setState({isTestingAlert:!0}),g.testAlert(e.id).finally((function(){return t.setState({isTestingAlert:!1})}))},_onEdit:function(){this.configurationForm.open()},_onSubmit:function(t){var e=this.props,n=e.alertNotification,r=e.onNotificationUpdate;v.update(n.stream_id,n.id,t).then(r)},_onDelete:function(){var t=this.props,e=t.alertNotification,n=t.onNotificationDelete;window.confirm("Really delete alert notification?")&&v.delete(e.stream_id,e.id).then(n)},_toggleIsConfigurationShown:function(){var t=this.state.isConfigurationShown;this.setState({isConfigurationShown:!t})},render:function(){var t=this,e=this.state,n=e.availableNotifications,r=e.isTestingAlert,o=this.props,i=o.isStreamView,c=o.alertNotification;if(!n)return a.a.createElement(y.L,null);var l=c,s=this.props.stream,u=this.state.isConfigurationShown,p=n[l.type];if(!p)return a.a.createElement(bt,{alertNotification:l,onDelete:this._onDelete});var m=a.a.createElement("a",{href:"#toggleconfiguration",onClick:this._toggleIsConfigurationShown},u?"Hide":"Show"," configuration"),g=s?a.a.createElement("span",null,"Executed once per triggered alert condition in stream ",a.a.createElement("em",null,s.title),". ",m):a.a.createElement("span",null,"Not executed, as it is not connected to a stream. ",m),v=s&&a.a.createElement(y.s,{permissions:"streams:edit:".concat(s.id)},a.a.createElement(a.a.Fragment,null,a.a.createElement(d.c,{key:"test-button",bsStyle:"info",disabled:r,onClick:this._onTestNotification},r?"Testing...":"Test"),a.a.createElement(d.k,{key:"more-actions-button",title:"More actions",pullRight:!0,id:"more-actions-dropdown-".concat(l.id)},!i&&a.a.createElement(f.LinkContainer,{to:b.a.stream_alerts(s.id)},a.a.createElement(d.v,null,"Alerting overview for Stream")),a.a.createElement(d.v,{onSelect:this._onEdit},"Edit"),a.a.createElement(d.v,{divider:!0}),a.a.createElement(d.v,{onSelect:this._onDelete},"Delete")))),E=a.a.createElement(d.h,{md:12},a.a.createElement("div",{className:"alert-callback alarm-callbacks"},a.a.createElement(h.b,{ref:function(e){t.configurationForm=e},key:"configuration-form-notification-".concat(l.id),configFields:p.requested_configuration,title:"Editing alert configuration ",typeName:l.type,titleValue:l.title,submitAction:this._onSubmit,values:l.configuration}),u&&a.a.createElement(h.d,{configuration:l.configuration,typeDefinition:p})));return a.a.createElement(y.l,{key:"entry-list-".concat(l.id),title:l.title?l.title:"Untitled",titleSuffix:"(".concat(p.name,")"),description:g,actions:v,contentRow:E})}}),_=n("8FtKQWAV"),C=n.n(_),w=m.a.get("AlertNotifications"),O=w.AlertNotificationsStore,P=w.AlertNotificationsActions,R=m.a.get("Streams").StreamsStore,A=l()({displayName:"AlertNotificationsComponent",mixins:[u.a.connect(O)],getInitialState:function(){return{allNotifications:void 0,streams:void 0}},componentDidMount:function(){this._loadData()},_loadData:function(){var t=this;R.listStreams().then((function(e){t.setState({streams:e})})),P.available(),P.listAll()},_isLoading:function(){var t=this.state,e=t.streams,n=t.allNotifications;return!e||!n},render:function(){if(this._isLoading())return a.a.createElement(y.L,null);var t=this.state,e=t.allNotifications,n=t.streams,r=e.sort((function(t,e){var n=t.title||"Untitled",r=e.title||"Untitled";return C()(n.toLowerCase(),r.toLowerCase())}));return a.a.createElement("div",null,a.a.createElement("div",{className:"pull-right"},a.a.createElement(f.LinkContainer,{to:b.a.LEGACY_ALERTS.NEW_NOTIFICATION},a.a.createElement(d.c,{bsStyle:"success"},"Add new notification"))),a.a.createElement("h2",null,"Notifications"),a.a.createElement("p",null,"These are all configured alert notifications."),a.a.createElement(q,{alertNotifications:r,streams:n,onNotificationUpdate:this._loadData,onNotificationDelete:this._loadData}))}});function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n'))})),t}return e=i,(n=[{key:"render",value:function(){var t=this.props.alertCondition,e=t.parameters.field,n=t.parameters.value;return c.a.createElement("span",null,"Alert is triggered when messages matching ",this._formatMatcher(e,n)," are received."," ",c.a.createElement(b,{alertCondition:t})," ",c.a.createElement(R,{alertCondition:t})," ",c.a.createElement(q,{alertCondition:t}))}}])&&H(e.prototype,n),r&&H(e,r),i}(c.a.Component);Q(B,"propTypes",{alertCondition:i.a.object.isRequired});var Z=B,Y=n("oBIKikY9");function X(t){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function K(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t,e){for(var n=0;n




© 2015 - 2024 Weber Informatics LLC | Privacy Policy