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

web-interface.assets.bb8c8232-5778.292c50d54ae3864f7e07.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-5778"],{"v49VAhM/":(I,g,t)=>{t.d(g,{A:()=>v});var n=t("pmX897Fv"),m=t.n(n),l=t("DjJvgDaP"),h=t.n(l),i=h()(m());i.push([I.id,`.zcLZoqCM3gdYwBxCBfhI {
    display: flex;
    flex-flow: column nowrap;
    margin-bottom: 15px;
}

@media all and (max-width: 768px) {
    .zcLZoqCM3gdYwBxCBfhI > div {
        flex-flow: column nowrap;
    }
}

.zcLZoqCM3gdYwBxCBfhI > div {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.zcLZoqCM3gdYwBxCBfhI .form-group {
    margin-bottom: 0;
}

.cZx0sEUi7VmYCScAlRqg {
    flex: 0 1 45%;
    margin-right: 10px;
}

.cZx0sEUi7VmYCScAlRqg .form-inline {
    display: flex;
    flex-flow: row nowrap;
}

.cZx0sEUi7VmYCScAlRqg .form-group:first-child {
    flex: 1 100%;
}

.cZx0sEUi7VmYCScAlRqg .form-group:not(:first-child) {
    margin-right: 5px;
}
`,"",{version:3,sources:["webpack://./src/components/events/events/EventsSearchBar.css"],names:[],mappings:"AAAA;IACI,aAAa;IACb,wBAAwB;IACxB,mBAAmB;AACvB;;AAEA;IACI;QACI,wBAAwB;IAC5B;AACJ;;AAEA;IACI,aAAa;IACb,qBAAqB;IACrB,8BAA8B;IAC9B,uBAAuB;IACvB,mBAAmB;AACvB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,aAAa;IACb,kBAAkB;AACtB;;AAEA;IACI,aAAa;IACb,qBAAqB;AACzB;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,iBAAiB;AACrB",sourcesContent:[`:local(.eventsSearchBar) {
    display: flex;
    flex-flow: column nowrap;
    margin-bottom: 15px;
}

@media all and (max-width: 768px) {
    :local(.eventsSearchBar) > div {
        flex-flow: column nowrap;
    }
}

:local(.eventsSearchBar) > div {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

:local(.eventsSearchBar) .form-group {
    margin-bottom: 0;
}

:local(.searchForm) {
    flex: 0 1 45%;
    margin-right: 10px;
}

:local(.searchForm) .form-inline {
    display: flex;
    flex-flow: row nowrap;
}

:local(.searchForm) .form-group:first-child {
    flex: 1 100%;
}

:local(.searchForm) .form-group:not(:first-child) {
    margin-right: 5px;
}
`],sourceRoot:""}]),i.locals={eventsSearchBar:"zcLZoqCM3gdYwBxCBfhI",searchForm:"cZx0sEUi7VmYCScAlRqg"};const v=i},SfPIQIJE:(I,g,t)=>{t.d(g,{A:()=>L});var n=t("Z7aTuO5B"),m=t("J6y4/h8P"),l=t("rIl5IEuP"),h=t("ty2gyrHp"),i=t("IOI9nV80"),v=t("NV1/EHMi");const C=(0,m.default)(l.ButtonToolbar)`
  margin-bottom: 10px;
`,B=(0,m.default)(l.Button)(({theme:u})=>(0,m.css)`
  font-family: ${u.fonts.family.navigation};
  font-size: ${u.fonts.size.navigation};
  color: ${u.colors.variant.darker.default};
  
  &:hover,
  &:focus {
    background: inherit;
    text-decoration: none;
  }

  &:hover {
    color: inherit;
    ${(0,v.WS)(u)}
  }

  &.active {
    color: ${u.colors.global.textDefault};

    ${(0,v.at)(u)}

    &:hover,
    &:focus {
      ${(0,v.at)(u)}
    }
`);B.displayName="Button";const L=({items:u})=>n.createElement(C,null,u.map(({path:p,title:M,permissions:S,exactPathMatch:U})=>p?n.createElement(i.Wj,{permissions:S!=null?S:[],key:p},n.createElement(h.m,{to:p,relativeActive:!U},n.createElement(B,{bsStyle:"link"},n.createElement(v.Ay,null,M)))):null))},jvpdvVQ7:(I,g,t)=>{t.d(g,{A:()=>C});var n=t("Z7aTuO5B"),m=t("SfPIQIJE"),l=t("d4kzUuQm"),h=t("rIl5IEuP");const i=[{title:"Alerts & Events",path:l.Ay.ALERTS.LIST,exactPathMatch:!0},{title:"Event Definitions",path:l.Ay.ALERTS.DEFINITIONS.LIST},{title:"Notifications",path:l.Ay.ALERTS.NOTIFICATIONS.LIST}],C=()=>n.createElement(h.Row,null,n.createElement(m.A,{items:i}))},J7jHQVWe:(I,g,t)=>{t.r(g),t.d(g,{default:()=>et});var n=t("Z7aTuO5B"),m=t("rIl5IEuP"),l=t("IOI9nV80"),h=t("ii0bleBb"),i=t.n(h),v=t("06hQxAAN"),C=t.n(v),B=t("Mx+G+HdB"),Q=t.n(B),L=t("jAGDuYSC"),u=t("8fnsnG21"),p=t("7GNmVOX8"),M=t("J1ga+jW6"),S=t("cd5HAK44"),U=t("JnTtTRmZ"),W=t.n(U),ne=t("oCSEoDew"),ae=t.n(ne),re=t("u1Q00LVl"),se=t.n(re),oe=t("MdYBRjRJ"),ie=t("eFxcQyPT"),j=t("IA3Ku5lS");const N=(0,j.rN)("core.Events",()=>W().createActions({search:{asyncResult:!0}})),le=(0,j.Bv)("core.Events",()=>W().createStore({listenables:[N],sourceUrl:"/events/search",events:void 0,totalEvents:void 0,context:void 0,parameters:{page:void 0,pageSize:void 0,query:void 0,filter:void 0,timerange:void 0},getInitialState(){return this.getState()},propagateChanges(){this.trigger(this.getState())},getState(){return{events:this.events,parameters:this.parameters,totalEvents:this.totalEvents,context:this.context}},eventsUrl({segments:s=[],query:a={}}){const e=new(ae())(this.sourceUrl),r=se()(e.segment(),s);return e.segmentCoded(r),e.query(a),oe.H3(e.resource())},refresh(){const{query:s,page:a,pageSize:e,filter:r}=this.parameters;this.search({query:s,page:a,pageSize:e,filter:r})},search({query:s="",page:a=1,pageSize:e=25,filter:r={alerts:"only"},timerange:o={type:"relative",range:3600}}){const c=(0,ie.Ay)("POST",this.eventsUrl({}),{query:s,page:a,per_page:e,filter:r,timerange:o});c.then(d=>(this.events=d.events,this.parameters={query:d.parameters.query,page:d.parameters.page,pageSize:d.parameters.per_page,filter:d.parameters.filter,timerange:d.parameters.timerange},this.totalEvents=d.total_events,this.context=d.context,this.propagateChanges(),d)).catch(d=>(this.events=[],this.parameters={query:s,page:a,pageSize:e,filter:r,timerange:o},this.totalEvents=0,this.context={event_definitions:{},streams:{}},this.propagateChanges(),d)),N.search.promise(c)}}));var z=t("XyJ0Mvpg"),ce=t("13uboeDm"),me=t.n(ce),de=t("LLTH+mT+"),ue=t.n(de),E=t("J6y4/h8P"),b=t("ty2gyrHp"),K=t("d4kzUuQm"),P=t("UMMlOSMl"),Ee=t("yGRmSjYM"),ve=t("9oVghaOd"),ge=t.n(ve),he=t("ZoCQyFC1"),fe=t.n(he),pe=t("ATOIS62c"),Ae=t("dFpwyWHg"),ye=t.n(Ae),Ce=t("C2ikvoS0"),Se=t.n(Ce),Re=t("1IntWRSu"),Ie=t.n(Re),Be=t("8nGWeFnd"),Pe=t.n(Be),Te=t("TeAcaicX"),xe=t.n(Te),De=t("eE3+5goe"),Oe=t.n(De),T=t("v49VAhM/"),A={};A.styleTagTransform=Oe(),A.setAttributes=Pe(),A.insert=Ie().bind(null,"head"),A.domAPI=Se(),A.insertStyleElement=xe();var ot=ye()(T.A,A);const $=T.A&&T.A.locals?T.A.locals:void 0;var Le=Object.defineProperty,Me=(s,a,e)=>a in s?Le(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e,x=(s,a,e)=>(Me(s,typeof a!="symbol"?a+"":a,e),e);const H=["DAYS","HOURS","MINUTES","SECONDS"];class Y extends n.Component{constructor(a){super(a),x(this,"updateSearchTimeRange",(r,o)=>{const{onTimeRangeChange:c}=this.props,d=ge().duration(fe()([r,1]),o).asSeconds();c("relative",d),this.setState({timeRangeDuration:r,timeRangeUnit:o})}),x(this,"resetLoadingState",()=>{this.setState({isReloadingResults:!1})}),x(this,"handleSearchReload",()=>{this.setState({isReloadingResults:!0});const{onSearchReload:r}=this.props;r(this.resetLoadingState)});const e=(0,pe.z)(a.parameters.timerange.range*1e3,H);this.state={isReloadingResults:!1,timeRangeDuration:e.duration,timeRangeUnit:e.unit}}render(){const{parameters:a,onQueryChange:e,onAlertFilterChange:r}=this.props,{isReloadingResults:o,timeRangeUnit:c,timeRangeDuration:d}=this.state,R=a.filter.alerts;return n.createElement("div",{className:$.eventsSearchBar},n.createElement("div",null,n.createElement("div",{className:$.searchForm},n.createElement(l.B9,{query:a.query,onSearch:e,placeholder:"Find Events",topMargin:0,useLoadingState:!0},n.createElement(m.Button,{onClick:this.handleSearchReload,disabled:o,title:"Refresh Events"},n.createElement(l.In,{name:"sync",spin:o})))),n.createElement(l.gM,{id:"event-timerange-selector",update:this.updateSearchTimeRange,units:H,unit:c,value:d,clearable:!0,pullRight:!0,required:!0})),n.createElement("div",null,n.createElement(m.ButtonGroup,null,n.createElement(m.Button,{active:R==="only",onClick:r("only")},"Alerts"),n.createElement(m.Button,{active:R==="exclude",onClick:r("exclude")},"Events"),n.createElement(m.Button,{active:R==="include",onClick:r("include")},"Both"))))}}x(Y,"propTypes",{parameters:i().object.isRequired,onQueryChange:i().func.isRequired,onAlertFilterChange:i().func.isRequired,onTimeRangeChange:i().func.isRequired,onSearchReload:i().func.isRequired});const Ue=Y;var Ne=t("LgqVPv05"),Fe=t("BGrPYJnO"),Qe=Object.defineProperty,We=(s,a,e)=>a in s?Qe(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e,D=(s,a,e)=>(We(s,typeof a!="symbol"?a+"":a,e),e);const V=["Description","Key","Type","Event Definition","Timestamp"],Z=E.default.tr(({theme:s})=>(0,E.css)`
  > td {
    border-top: 1px solid ${s.colors.gray[80]} !important;
    padding: 10px 8px 8px 35px !important;
  }

  dd {
    margin-bottom: 0.25em;
  }

  dl {
    > dl,
    > ul {
      padding-left: 1.5em;
    }
  }

  ul {
    list-style-type: disc;
  }
`),je=E.default.tbody(({expanded:s,theme:a})=>(0,E.css)`
    border-left: ${s?`3px solid ${a.colors.variant.light.info}`:""};
    border-collapse: ${s?"separate":"collapse"};
`),ze=E.default.tr`
  cursor: pointer;
`,be=(0,E.default)(m.Table)(({theme:s})=>(0,E.css)`
  tr {
    &:hover {
      background-color: ${s.colors.gray[90]};
    }

    &${Z} {
      &:hover {
        background-color: ${s.colors.global.contentBackground};
      }
    }
  }
`),Ke=(0,E.default)(l.In)(({theme:s})=>(0,E.css)`
  font-size: ${s.fonts.size.large};
  vertical-align: top;
`),$e=E.default.div`
  margin-top: -50px;
`,G=[10,25,50,100],J=1e4,He=(s,a)=>{const e=me()(P.A.properties[a].name);let r;switch(a){case P.A.LOW:r="text-muted";break;case P.A.HIGH:r="text-danger";break;default:r="text-info"}const o=n.createElement(n.Fragment,null,e," Priority");return n.createElement(l.N,{placement:"top",trigger:["hover","click","focus"],overlay:o},n.createElement(Ke,{name:"thermometer",className:r}))},Ye=()=>n.createElement(m.Row,null,n.createElement(m.Col,{md:6,mdOffset:3,lg:4,lgOffset:4},n.createElement(l.$R,{title:"Looks like you didn't define any Events yet"},n.createElement("p",null,"Create Event Definitions that are able to search, aggregate or correlate Messages and other Events, allowing you to record significant Events in Graylog and alert on them."),n.createElement(l.Wj,{permissions:"eventdefinitions:create"},n.createElement(b.m,{to:K.Ay.ALERTS.DEFINITIONS.CREATE},n.createElement(m.Button,{bsStyle:"success"},"Get Started!"))))));class X extends n.Component{constructor(a){super(a),D(this,"expandRow",e=>()=>{const{expanded:r}=this.state,o=r.includes(e)?ue()(r,e):r.concat([e]);this.setState({expanded:o})}),D(this,"renderLinkToEventDefinition",(e,r)=>{const{currentUser:o}=this.props;return r?(0,Ee.Nn)(o.permissions,`eventdefinitions:edit:${r.id}`)?n.createElement(b.N,{to:K.Ay.ALERTS.DEFINITIONS.edit(r.id)},r.title):r.title:n.createElement("em",null,e.event_definition_id)}),D(this,"renderEvent",e=>{const{context:r,currentUser:o}=this.props,{expanded:c}=this.state,d=r.event_definitions[e.event_definition_id];return n.createElement(je,{key:e.id,expanded:c.includes(e.id)},n.createElement(ze,{className:e.priority===P.A.HIGH?"bg-danger":"",onClick:this.expandRow(e.id)},n.createElement("td",null,He(e.id,e.priority),"\xA0",e.message),n.createElement("td",null,e.key||n.createElement("em",null,"none")),n.createElement("td",null,n.createElement(Fe.A,{isAlert:e.alert})),n.createElement("td",null,this.renderLinkToEventDefinition(e,d)),n.createElement("td",null,n.createElement(l.Dc,{dateTime:e.timestamp}))),c.includes(e.id)&&n.createElement(Z,null,n.createElement("td",{colSpan:V.length+1},n.createElement(Ne.A,{event:e,eventDefinitionContext:d,currentUser:o}))))}),this.state={expanded:[]}}render(){const{events:a,parameters:e,totalEvents:r,totalEventDefinitions:o,onPageChange:c,onQueryChange:d,onAlertFilterChange:R,onTimeRangeChange:tt,onSearchReload:nt,paginationQueryParameter:q}=this.props,k=a.map(O=>O.event);if(o===0)return Ye();const{query:at,filter:{alerts:_}}=e,ee=_==="only"?"Alerts":_==="exclude"?"Events":"Alerts & Events",te=q.page*q.pageSize>J,rt=at?n.createElement(l.EO,null,"No ",ee," found for the current search criteria."):n.createElement(l.WE,null,"No ",ee," exist."),st=n.createElement("tbody",null,n.createElement("tr",null,n.createElement("td",{colSpan:5},n.createElement(l.EO,null,"Unfortunately we can only fetch Events with an Offset (page number * rows per page) less than or equal to: [10000]. Please use more advanced methods (Search Field and Date Filter) in order to get distant chunks of results."))));return n.createElement(m.Row,null,n.createElement(m.Col,{md:12},n.createElement(Ue,{parameters:e,onQueryChange:d,onAlertFilterChange:R,onTimeRangeChange:tt,onSearchReload:nt}),k.length===0&&!te?rt:n.createElement($e,null,n.createElement(l.OW,{totalItems:r,onChange:c,pageSizes:G},n.createElement(be,{id:"events-table"},n.createElement("thead",null,n.createElement("tr",null,V.map(O=>n.createElement("th",{key:O},O)))),te?st:k.map(this.renderEvent))))))}}D(X,"propTypes",{events:i().array.isRequired,parameters:i().object.isRequired,currentUser:i().object.isRequired,totalEvents:i().number.isRequired,totalEventDefinitions:i().number.isRequired,context:i().object.isRequired,onPageChange:i().func.isRequired,onQueryChange:i().func.isRequired,onAlertFilterChange:i().func.isRequired,onTimeRangeChange:i().func.isRequired,onSearchReload:i().func.isRequired,paginationQueryParameter:i().object.isRequired});const Ve=(0,z.A)(X);var Ze=Object.defineProperty,Ge=(s,a,e)=>a in s?Ze(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e,f=(s,a,e)=>(Ge(s,typeof a!="symbol"?a+"":a,e),e);const w="events-last-search",Je=500,y=({page:s,pageSize:a,query:e,filter:r,timerange:o})=>(p.A.set(w,{filter:r,timerange:o}),N.search({query:e,page:s,pageSize:a,filter:r,timerange:o}).catch(c=>{L.A.error(`Fetching alerts failed with status: ${c}`)})),Xe=()=>S.a.listPaginated({});class F extends n.Component{constructor(){super(...arguments),f(this,"handlePageChange",(a,e)=>{if(a*e<=J){const{events:r}=this.props;y({page:a,pageSize:e,query:r.parameters.query,filter:r.parameters.filter,timerange:r.parameters.timerange})}}),f(this,"handleQueryChange",Q()((a,e=()=>{})=>{const{events:r}=this.props,{resetPage:o,pageSize:c}=this.props.paginationQueryParameter;o(),y({query:a,pageSize:c,filter:r.parameters.filter,timerange:r.parameters.timerange}).finally(e)},Je)),f(this,"handleAlertFilterChange",a=>()=>{const{events:e}=this.props,{resetPage:r,pageSize:o}=this.props.paginationQueryParameter;r(),y({query:e.parameters.query,pageSize:o,filter:{alerts:a},timerange:e.parameters.timerange})}),f(this,"handleTimeRangeChange",(a,e)=>{const{events:r}=this.props,{resetPage:o,pageSize:c}=this.props.paginationQueryParameter;o(),y({query:r.parameters.query,pageSize:c,filter:r.parameters.filter,timerange:{type:a,range:e}})}),f(this,"handleSearchReload",(a=()=>{})=>{const{events:e}=this.props,{resetPage:r,pageSize:o}=this.props.paginationQueryParameter;r(),y({query:e.parameters.query,pageSize:o,filter:e.parameters.filter,timerange:e.parameters.timerange}).finally(a)})}componentDidMount(){const{streamId:a}=this.props,{page:e,pageSize:r}=this.props.paginationQueryParameter,o=p.A.get(w)||{},c={page:e,pageSize:r};a&&(c.query=`source_streams:${a}`),o&&C()(o)&&(c.filter=o.filter,c.timerange=o.timerange),y(c),Xe()}render(){const{events:a,eventDefinitions:e,currentUser:r}=this.props;return!a.events||!e.eventDefinitions?n.createElement(l.y$,{text:"Loading Events information..."}):n.createElement(Ve,{events:a.events,parameters:a.parameters,totalEvents:a.totalEvents,currentUser:r,totalEventDefinitions:e.pagination.grandTotal,context:a.context,onQueryChange:this.handleQueryChange,onPageChange:this.handlePageChange,onAlertFilterChange:this.handleAlertFilterChange,onTimeRangeChange:this.handleTimeRangeChange,onSearchReload:this.handleSearchReload})}}f(F,"propTypes",{events:i().object.isRequired,eventDefinitions:i().object.isRequired,currentUser:i().object.isRequired,streamId:i().string,paginationQueryParameter:i().object.isRequired}),f(F,"defaultProps",{streamId:""});const we=(0,u.A)((0,z.A)(F,{pageSizes:G}),{events:le,eventDefinitions:S.o,currentUser:M.y},({currentUser:s,...a})=>({...a,currentUser:s.currentUser}));var qe=t("E+CaPsQD"),ke=t("jvpdvVQ7"),_e=t("brbjQOmY");const et=()=>{const{stream_id:s}=(0,_e.A)();return n.createElement(l.Qc,{title:"Alerts & Events"},n.createElement(ke.A,null),n.createElement(l.zY,{title:"Alerts & Events",documentationLink:{title:"Alerts documentation",path:qe.A.PAGES.ALERTS}},n.createElement("span",null,"Define Events through different conditions. Add Notifications to Events that require your attention to create Alerts.")),n.createElement(m.Row,{className:"content"},n.createElement(m.Col,{md:12},n.createElement(we,{key:s,streamId:s}))))}}}]);})();

//# sourceMappingURL=bb8c8232-5778.292c50d54ae3864f7e07.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy