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

web-interface.assets.6e61897c-1.472622149827c1587209.js Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
(window.webpackJsonp=window.webpackJsonp||[]).push([["6e61897c-1"],{"7NKO1ghU":function(e,t,n){"use strict";n.d(t,"a",(function(){return R})),n.d(t,"f",(function(){return B})),n.d(t,"b",(function(){return Ee})),n.d(t,"c",(function(){return De})),n.d(t,"e",(function(){return Ge})),n.d(t,"d",(function(){return Ye})),n.d(t,"g",(function(){return $e})),n.d(t,"h",(function(){return it}));var r=n("ii0bleBb"),o=n.n(r),i=n("ivGQtwpr"),a=n.n(i),l=n("X+7LuFrS"),c=n("qoq4u5Uq"),s=n("0tVB/fkh"),u=n("/lavANvI"),f=n("GhoMYXSj"),p=n("dFpwyWHg"),m=n.n(p),d=n("xToTn6AK"),y={insert:"head",singleton:!1},h=(m()(d.a,y),d.a.locals||{});function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n0?e.setState({messages:t.messages,totalMessages:t.total_results}):e.setState({messages:[],totalMessages:0})}),(function(e){_e.a.error("Fetching messages during alert failed with error: ".concat(e),"Could not get messages during alert")}))})),Te(Pe(e),"_isLoading",(function(){return!e.state.messages})),Te(Pe(e),"_onPageChange",(function(t){e._loadData(t)})),Te(Pe(e),"_formatMessages",(function(e){return e.map((function(e){return a.a.createElement("tr",{key:"".concat(e.index,"-").concat(e.id)},a.a.createElement("td",null,a.a.createElement(s.hb,{dateTime:e.formatted_fields.timestamp})),a.a.createElement("td",null,e.formatted_fields.message))}))})),Te(Pe(e),"_formatAlertTimeRange",(function(){return a.a.createElement("span",null,"(",a.a.createElement(s.hb,{dateTime:e._getFrom(),format:f.a.Formats.DATETIME})," – ",a.a.createElement(s.hb,{dateTime:e._getTo(),format:f.a.Formats.DATETIME}),")")})),e}return t=i,(n=[{key:"componentDidMount",value:function(){this._loadData()}},{key:"render",value:function(){var e={rangetype:"absolute",from:this._getFrom(),to:this._getTo()},t=a.a.createElement("div",null,a.a.createElement("div",{className:"pull-right"},a.a.createElement(l.b,{to:u.a.stream_search(this.props.stream.id,"*",e)},a.a.createElement(c.e,{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,t,a.a.createElement(s.db,null));var n=this.state.messages;return 0===n.length?a.a.createElement("div",null,t,a.a.createElement(c.c,{bsStyle:"info"},"No search results found during the time of the alert.")):a.a.createElement("div",null,t,a.a.createElement(s.P,{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))))))}}])&&we(t.prototype,n),r&&we(t,r),i}(a.a.Component);Te(ke,"propTypes",{alert:o.a.object.isRequired,stream:o.a.object.isRequired});var De=ke,Ie=n("YPyIcTeH"),Le=n.n(Ie),xe=re.a.get("Alerts"),Ue=xe.AlertsStore,Be=xe.AlertsActions,qe=re.a.get("AlertConditions"),Fe=qe.AlertConditionsStore,Ve=qe.AlertConditionsActions,Me=re.a.get("Streams").StreamsStore,Ge=ee()({displayName:"AlertsComponent",mixins:[ne.a.connect(Ue),ne.a.connect(Fe)],getInitialState:function(){return{displayAllAlerts:!1,loading:!1}},componentDidMount:function(){var e=this;this.loadData(this.currentPage,this.pageSize),this.interval=setInterval((function(){return e.fetchData(e.currentPage,e.pageSize)}),1e4)},componentWillUnmount:function(){this.interval&&clearInterval(this.interval)},currentPage:1,pageSize:10,loadData:function(e,t){var n=this;this.setState({loading:!0});var r=this.fetchData(e,t);Le.a.all(r).finally((function(){return n.setState({loading:!1})}))},fetchData:function(e,t){var n=this,r=this.state.displayAllAlerts;return[Be.listAllPaginated((e-1)*t,t,r?"any":"unresolved"),Ve.listAll(),Ve.available(),Me.listStreams().then((function(e){n.setState({streams:e})}))]},refreshData:function(){this.loadData(this.currentPage,this.pageSize)},_onToggleAllAlerts:function(){var e=this,t=this.state.displayAllAlerts;this.currentPage=1,this.pageSize=10,this.setState({displayAllAlerts:!t},(function(){return e.loadData(e.currentPage,e.pageSize)}))},_onChangePaginatedList:function(e,t){this.currentPage=e,this.pageSize=t,this.loadData(e,t)},_formatAlert:function(e){var t=this.state,n=t.allAlertConditions,r=t.streams,o=t.availableConditions,i=n.find((function(t){return t.id===e.condition_id})),l=r.find((function(t){return t.id===e.stream_id})),c=i?o[i.type]:{};return a.a.createElement(R,{key:e.id,alert:e,alertCondition:i,stream:l,conditionType:c})},_isLoading:function(){var e=this.state,t=e.alerts,n=e.allAlertConditions,r=e.streams,o=e.availableConditions;return!(t&&n&&o&&r)},render:function(){var e=this;if(this._isLoading())return a.a.createElement(s.db,null);var t=this.state,n=t.loading,r=t.displayAllAlerts,o=t.alerts;return a.a.createElement("div",null,a.a.createElement("div",{className:"pull-right"},a.a.createElement(c.e,{bsStyle:"info",onClick:this.refreshData,disabled:n},n?"Refreshing...":"Refresh")," ",a.a.createElement(c.e,{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.P,{totalItems:o.total,pageSize:this.pageSize,onChange:this._onChangePaginatedList,showPageSizeSelect:!1},a.a.createElement(s.n,{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(t){return e._formatAlert(t)}))})))}}),ze=n("a36nkhgM"),He={insert:"head",singleton:!1},We=(m()(ze.a,He),ze.a.locals||{}),Ze=re.a.get("AlarmCallbackHistory").AlarmCallbackHistoryStore,Ke=re.a.get("AlertNotifications").AlertNotificationsStore,Ye=ee()({displayName:"AlertTimeline",propTypes:{alert:o.a.object.isRequired,stream:o.a.object.isRequired,condition:o.a.object,conditionType:o.a.object},mixins:[ne.a.connect(Ke),ne.a.connect(Ze)],_isLoading:function(){return!this.state.histories||!this.state.availableNotifications},_historiesTimeline:function(e){var t=this,n=[];return 0===this.state.histories.length?[a.a.createElement("dt",{key:"history-title"},a.a.createElement(s.hb,{dateTime:e})),a.a.createElement("dd",{key:"history-desc"},"No notifications were configured for this alert")]:(this.state.histories.sort((function(e,t){return Object(oe.b)(e.created_at,t.created_at)})).forEach((function(e){var r,o=e.alarmcallbackconfiguration,i=t.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(e.id,"-title")},a.a.createElement(s.hb,{dateTime:e.created_at})),a.a.createElement("dd",{key:"".concat(e.id,"-desc")},"Graylog ","error"===e.result.type?"could not send":"sent"," ",r," notification"))})),n)},_resolutionTimeline:function(){var e=[];if(this.props.alert.is_interval)if(this.props.alert.resolved_at)e.push(a.a.createElement("dt",{key:"resolution-title"},a.a.createElement(s.hb,{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 t=(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";e.push(a.a.createElement("dt",{key:"notifications-title"},a.a.createElement(s.hb,{dateTime:new Date})),a.a.createElement("dd",{key:"notifications-desc"},t),a.a.createElement("dt",{key:"resolution-title"},a.a.createElement(s.hb,{dateTime:new Date})),a.a.createElement("dd",{key:"resolution-desc"},"Condition is still satisfied, ",a.a.createElement("strong",null,"alert is unresolved")))}else e.push(a.a.createElement("dt",{key:"resolution-title"},a.a.createElement(s.hb,{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 e},render:function(){if(this._isLoading())return a.a.createElement(s.db,null);var e=this.props.alert,t=this.props.condition&&Object.keys(this.props.condition).length>0,n=this.props.condition||{},r=this.props.conditionType,o=a.a.createElement(s.hb,{dateTime:e.triggered_at}),i=a.a.createElement("span",null,a.a.createElement("em",null,t?n.title||"Untitled condition":"Unknown condition")," ","(",r.name||n.type||"Unknown condition type",")");return a.a.createElement("dl",{className:"dl-horizontal ".concat(We.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,e.description),a.a.createElement("dt",null,o),a.a.createElement("dd",null,"Graylog triggers an alert for ",i," and starts sending notifications"),this._historiesTimeline(e.triggered_at),this._resolutionTimeline())}}),Qe=re.a.get("Alerts"),Je=Qe.AlertsStore,Xe=Qe.AlertsActions,$e=ee()({displayName:"StreamAlerts",propTypes:{stream:o.a.object.isRequired,alertConditions:o.a.array.isRequired,availableConditions:o.a.object.isRequired},mixins:[ne.a.connect(Je)],getInitialState:function(){return{loading:!0}},componentDidMount:function(){var e=this;this.loadData(this.currentPage,this.pageSize),this.interval=setInterval((function(){return e.fetchData(e.currentPage,e.pageSize)}),1e4)},componentWillUnmount:function(){this.interval&&clearInterval(this.interval)},currentPage:1,pageSize:3,loadData:function(e,t){var n=this;this.setState({loading:!0}),this.fetchData(e,t).finally((function(){return n.setState({loading:!1})}))},fetchData:function(e,t){return Xe.listPaginated(this.props.stream.id,(e-1)*t,t,"unresolved")},_onChangePaginatedList:function(e,t){this.currentPage=e,this.pageSize=t,this.loadData(e,t)},_formatAlert:function(e){var t=this.props.alertConditions.find((function(t){return t.id===e.condition_id})),n=t?this.props.availableConditions[t.type]:{};return a.a.createElement(R,{key:e.id,alert:e,alertCondition:t,stream:this.props.stream,conditionType:n})},render:function(){var e=this;return this.state.loading?a.a.createElement(s.db,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.P,{totalItems:this.state.alerts.total,pageSize:this.pageSize,onChange:this._onChangePaginatedList,showPageSizeSelect:!1},a.a.createElement(s.n,{bsNoItemsStyle:"success",noItemsText:"Good news! Currently there are no unresolved alerts on this stream.",items:this.state.alerts.alerts.map((function(t){return e._formatAlert(t)}))})))}}),et=n("ulKR5lF3"),tt=n("V8O/dgQq"),nt=re.a.get("AlertConditions"),rt=nt.AlertConditionsStore,ot=nt.AlertConditionsActions,it=ee()({displayName:"StreamAlertsOverviewContainer",propTypes:{stream:o.a.object.isRequired},mixins:[ne.a.connect(rt)],getInitialState:function(){return{loading:!0}},componentDidMount:function(){this.loadData()},loadData:function(){var e=this;this.setState({loading:!0});var t=this.fetchData();Le.a.all(t).finally((function(){return e.setState({loading:!1})}))},fetchData:function(){return[ot.list(this.props.stream.id),ot.available()]},render:function(){if(this.state.loading)return a.a.createElement(s.db,null);var e=this.props.stream,t=this.state,n=t.alertConditions,r=t.availableConditions;return a.a.createElement(a.a.Fragment,null,a.a.createElement(c.L,{className:"content"},a.a.createElement(c.j,{md:12},a.a.createElement($e,{stream:e,alertConditions:n,availableConditions:r}))),a.a.createElement(c.L,{className:"content"},a.a.createElement(c.j,{md:12},a.a.createElement(et.j,{stream:e,alertConditions:n,availableConditions:r,onConditionUpdate:this.fetchData,onConditionDelete:this.fetchData}))),a.a.createElement(c.L,{className:"content"},a.a.createElement(c.j,{md:12},a.a.createElement(tt.e,{stream:e}))))}})},"V8O/dgQq":function(e,t,n){"use strict";n.d(t,"a",(function(){return _})),n.d(t,"b",(function(){return P})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return K})),n.d(t,"e",(function(){return ce})),n.d(t,"f",(function(){return Ee}));var r=n("ii0bleBb"),o=n.n(r),i=n("ivGQtwpr"),a=n.n(i),l=n("PcYM+wZ7"),c=n.n(l),s=n("4KF7VOU5"),u=n.n(s),f=n("X+7LuFrS"),p=n("dOmQZ9N/"),m=n("21p8kIWv"),d=n("qoq4u5Uq"),y=n("0tVB/fkh"),h=n("cqPeOTxf"),b=n("/lavANvI"),g=m.a.get("AlertNotifications").AlertNotificationsStore,v=m.a.get("AlarmCallbacks").AlarmCallbacksActions,E=m.a.get("CurrentUser").CurrentUserStore,_=c()({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 e=this,t=this.props.alertNotification;this.setState({isTestingAlert:!0}),g.testAlert(t.id).finally((function(){return e.setState({isTestingAlert:!1})}))},_onEdit:function(){this.configurationForm.open()},_onSubmit:function(e){var t=this.props,n=t.alertNotification,r=t.onNotificationUpdate;v.update(n.stream_id,n.id,e).then(r)},_onDelete:function(){var e=this.props,t=e.alertNotification,n=e.onNotificationDelete;window.confirm("Really delete alert notification?")&&v.delete(t.stream_id,t.id).then(n)},_toggleIsConfigurationShown:function(){var e=this.state.isConfigurationShown;this.setState({isConfigurationShown:!e})},render:function(){var e=this,t=this.state,n=t.availableNotifications,r=t.isTestingAlert,o=this.props,i=o.isStreamView,l=o.alertNotification;if(!n)return a.a.createElement(y.db,null);var c=l,s=this.props.stream,u=this.state.isConfigurationShown,p=n[c.type];if(!p)return a.a.createElement(Ee,{alertNotification:c,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.B,{permissions:"streams:edit:".concat(s.id)},a.a.createElement(a.a.Fragment,null,a.a.createElement(d.e,{key:"test-button",bsStyle:"info",disabled:r,onClick:this._onTestNotification},r?"Testing...":"Test"),a.a.createElement(d.m,{key:"more-actions-button",title:"More actions",pullRight:!0,id:"more-actions-dropdown-".concat(c.id)},!i&&a.a.createElement(f.b,{to:b.a.stream_alerts(s.id)},a.a.createElement(d.y,null,"Alerting overview for Stream")),a.a.createElement(d.y,{onSelect:this._onEdit},"Edit"),a.a.createElement(d.y,{divider:!0}),a.a.createElement(d.y,{onSelect:this._onDelete},"Delete")))),E=a.a.createElement(d.j,{md:12},a.a.createElement("div",{className:"alert-callback alarm-callbacks"},a.a.createElement(h.b,{ref:function(t){e.configurationForm=t},key:"configuration-form-notification-".concat(c.id),configFields:p.requested_configuration,title:"Editing alert configuration ",typeName:c.type,titleValue:c.title,submitAction:this._onSubmit,values:c.configuration}),u&&a.a.createElement(h.d,{configuration:c.configuration,typeDefinition:p})));return a.a.createElement(y.o,{key:"entry-list-".concat(c.id),title:c.title?c.title:"Untitled",titleSuffix:"(".concat(p.name,")"),description:g,actions:v,contentRow:E})}}),S=n("8FtKQWAV"),C=n.n(S),w=m.a.get("AlertNotifications"),A=w.AlertNotificationsStore,O=w.AlertNotificationsActions,R=m.a.get("Streams").StreamsStore,P=c()({displayName:"AlertNotificationsComponent",mixins:[u.a.connect(A)],getInitialState:function(){return{allNotifications:void 0,streams:void 0}},componentDidMount:function(){this._loadData()},_loadData:function(){var e=this;R.listStreams().then((function(t){e.setState({streams:t})})),O.available(),O.listAll()},_isLoading:function(){var e=this.state,t=e.streams,n=e.allNotifications;return!t||!n},render:function(){if(this._isLoading())return a.a.createElement(y.db,null);var e=this.state,t=e.allNotifications,n=e.streams,r=t.sort((function(e,t){var n=e.title||"Untitled",r=t.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.b,{to:b.a.LEGACY_ALERTS.NEW_NOTIFICATION},a.a.createElement(d.e,{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(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var n=0;n'))})),e}return t=i,(n=[{key:"render",value:function(){var e=this.props.alertCondition,t=e.parameters.field,n=e.parameters.value;return l.a.createElement("span",null,"Alert is triggered when messages matching ",this._formatMatcher(t,n)," are received."," ",l.a.createElement(g,{alertCondition:e})," ",l.a.createElement(j,{alertCondition:e})," ",l.a.createElement(V,{alertCondition:e}))}}])&&z(t.prototype,n),r&&z(t,r),i}(l.a.Component);Q(J,"propTypes",{alertCondition:i.a.object.isRequired});var X=J,ee=n("0tVB/fkh");function te(e){return(te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function re(e,t){for(var n=0;n




© 2015 - 2024 Weber Informatics LLC | Privacy Policy