web-interface.assets.bb8c8232-2310.f7b597027ba87fd4ec17.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-2310"],{SfPIQIJE:(O,y,e)=>{e.d(y,{A:()=>m});var t=e("Z7aTuO5B"),a=e("J6y4/h8P"),o=e("rIl5IEuP"),u=e("ty2gyrHp"),r=e("IOI9nV80"),d=e("NV1/EHMi");const P=(0,a.default)(o.ButtonToolbar)`
margin-bottom: 10px;
`,E=(0,a.default)(o.Button)(({theme:i})=>(0,a.css)`
font-family: ${i.fonts.family.navigation};
font-size: ${i.fonts.size.navigation};
color: ${i.colors.variant.darker.default};
&:hover,
&:focus {
background: inherit;
text-decoration: none;
}
&:hover {
color: inherit;
${(0,d.WS)(i)}
}
&.active {
color: ${i.colors.global.textDefault};
${(0,d.at)(i)}
&:hover,
&:focus {
${(0,d.at)(i)}
}
`);E.displayName="Button";const m=({items:i})=>t.createElement(P,null,i.map(({path:A,title:c,permissions:n,exactPathMatch:s})=>A?t.createElement(r.Wj,{permissions:n!=null?n:[],key:A},t.createElement(u.m,{to:A,relativeActive:!s},t.createElement(E,{bsStyle:"link"},t.createElement(d.Ay,null,c)))):null))},"1f+2RmbX":(O,y,e)=>{e.d(y,{A:()=>d});var t=e("ii0bleBb"),a=e.n(t),o=e("Z7aTuO5B"),u=e("4E3oowBb");const r=({pipeline:P,connections:E,streams:M,streamsFormatter:m,noConnectionsMessage:i})=>{const A=E.filter(c=>c.pipeline_ids&&c.pipeline_ids.includes(P.id)).filter(c=>M.some(n=>n.id===c.stream_id)).map(c=>M.find(n=>n.id===c.stream_id)).sort((c,n)=>(0,u.j)(c.title,n.title));return o.createElement("span",null,A.length===0?i:m(A))};r.propTypes={pipeline:a().object.isRequired,connections:a().array.isRequired,streams:a().array.isRequired,streamsFormatter:a().func.isRequired,noConnectionsMessage:a().node},r.defaultProps={noConnectionsMessage:"Pipeline not connected to any streams"};const d=r},ZspbpBGx:(O,y,e)=>{e.d(y,{A:()=>P});var t=e("Z7aTuO5B"),a=e("SfPIQIJE"),o=e("d4kzUuQm"),u=e("rIl5IEuP");const r=[{title:"Manage pipelines",path:o.Ay.SYSTEM.PIPELINES.OVERVIEW,exactPathMatch:!0},{title:"Manage rules",path:o.Ay.SYSTEM.PIPELINES.RULES},{title:"Simulator",path:o.Ay.SYSTEM.PIPELINES.SIMULATOR}],P=()=>t.createElement(u.Row,null,t.createElement(a.A,{items:r}))},rwPgmTJe:(O,y,e)=>{e.r(y),e.d(y,{default:()=>w});var t=e("Z7aTuO5B"),a=e("rIl5IEuP"),o=e("IOI9nV80"),u=e("J6y4/h8P"),r=e("VPaD/Np4"),d=e.n(r),P=e("4E3oowBb"),E=e("ty2gyrHp"),M=e("nKnTKuph"),m=e("d4kzUuQm"),i=e("8fnsnG21"),A=e("pUKP3+Pg"),c=e("RU4i+ZYB"),n=e("ij/cnY+3"),s=e("rVdVsuGH"),l=e("3ndo/hra"),v=e("q2j1bVbz"),p=e("yGRmSjYM"),g=e("CrIFpfDF"),F=e("1f+2RmbX");const b=(0,u.default)(o.OW)`
.pagination {
margin: 0;
}
`,H=u.default.div(({theme:f})=>(0,u.css)`
font-size: ${f.fonts.size.h3};
padding: ${f.spacings.xxs} ${f.spacings.sm};
`),Y=u.default.div`
display: flex;
`,U=u.default.div(({$idle:f,theme:h})=>(0,u.css)`
border: 1px solid ${h.colors.gray[f?"50px":"70px"]};
border-radius: 4px;
display: inline-block;
margin-right: 15px;
padding: 20px;
text-align: center;
width: 120px;
background-color: ${f?h.utils.colorLevel(h.colors.global.contentBackground,10):h.colors.global.contentBackground};
`),j=u.default.td`
max-width: 300px;
overflow-x: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 300px;
`,G=u.default.td`
max-width: 150px;
width: 150px;
word-wrap: break-word;
`,J=({query:f,onSearch:h})=>t.createElement(o.B9,{query:f,onSearch:h,queryHelpComponent:t.createElement(o.xf,{entityName:"Pipeline"}),wrapperClass:"has-bm",onReset:()=>h(""),topMargin:0}),Z=f=>f.map(h=>h.title).join(", "),x=(f,h,I)=>{h(!0),c.l.listPaginated(f).then(R=>{I(R),h(!1)})},N=()=>{const f=(0,v.A)(),{connections:h}=(0,i.P)(l.J),{page:I,pageSize:R,resetPage:k,setPagination:q}=(0,s.Ay)(),[S,ee]=(0,t.useState)(""),[K,te]=(0,t.useState)(),[ne,W]=(0,t.useState)(),[se,$]=(0,t.useState)(!1),{list:L=d().List(),pagination:{total:ie=0}={}}=ne||{};if((0,t.useEffect)(()=>{x({page:I,perPage:R,query:S},$,W),l.H.list(),A.Ay.listStreams().then(te)},[I,R,S]),!L||!K||!h)return t.createElement(o.y$,null);const oe=C=>{k(),ee(C)},le=t.createElement(Y,null,t.createElement(J,{query:S,onSearch:oe}),se&&t.createElement(H,null,t.createElement(o.y$,{text:"",delay:0}))),ae=C=>{let D;return C==="Actions"&&(D="actions"),t.createElement("th",{className:D},C)},re=(C,D)=>{const B=D.map(T=>T.stage);return L.map(({stages:T})=>T.map(({stage:_})=>_)).reduce((T,_)=>Array.from(new Set([...T,..._])),[]).sort(P.j).map(T=>B.indexOf(T)===-1?t.createElement(U,{key:`${C.id}-stage${T}`,$idle:!0},"Idle"):t.createElement(U,{key:`${C.id}-stage${T}`},"Stage ",T))},ce=C=>()=>{window.confirm(`Do you really want to delete pipeline "${C.title}"? This action cannot be undone.`)&&c.l.delete(C.id).then(()=>{x({page:I,perPage:R,query:S},$,W),q({page:Math.max(n.n.page,I-1)})})},pe=C=>{const{id:D,title:B,description:T,stages:_}=C;return t.createElement("tr",{key:D},t.createElement(j,null,t.createElement(E.N,{to:m.Ay.SYSTEM.PIPELINES.PIPELINE(D),title:B},B),t.createElement("br",null),T,t.createElement("br",null),t.createElement(M.my,{name:`org.graylog.plugins.pipelineprocessor.ast.Pipeline.${D}.executed`},t.createElement(M.nf,{prefix:"Throughput:",suffix:"msg/s"}))),t.createElement(G,null,t.createElement(F.A,{pipeline:C,connections:h,streams:K,streamsFormatter:Z,noConnectionsMessage:t.createElement("em",null,"Not connected")})),t.createElement("td",null,re(C,_)),t.createElement("td",null,t.createElement(g.A,null,t.createElement(E.m,{to:m.Ay.SYSTEM.PIPELINES.PIPELINE(D)},t.createElement(a.Button,{disabled:!(0,p.Nn)(f.permissions,"pipeline:edit"),bsSize:"xsmall"},"Edit")),t.createElement(a.Button,{disabled:!(0,p.Nn)(f.permissions,"pipeline:delete"),bsStyle:"danger",bsSize:"xsmall",onClick:ce(C)},"Delete"))))},de=["Pipeline","Connected to Streams","Processing Timeline","Actions"];return t.createElement("div",null,t.createElement(b,{totalItems:ie},t.createElement(o.bQ,{id:"processing-timeline",className:"table-hover",headers:de,headerCellFormatter:ae,rows:L.toJS(),customFilter:le,filterKeys:[],filterLabel:"Filter Pipelines",noDataText:"No pipelines have been found",dataRowFormatter:pe})))};N.propTypes={};const z=N;var Q=e("E+CaPsQD");const V=()=>{const f=(0,v.A)();return t.createElement("div",{className:"pull-right"},t.createElement(E.m,{to:m.Ay.SYSTEM.PIPELINES.PIPELINE("new")},t.createElement(a.Button,{disabled:!(0,p.Nn)(f.permissions,"pipeline:create"),bsStyle:"success"},"Add new pipeline")))};var X=e("ZspbpBGx");const w=()=>t.createElement(o.Qc,{title:"Pipelines"},t.createElement(X.A,null),t.createElement(o.zY,{title:"Pipelines overview",actions:t.createElement(V,null),documentationLink:{title:"Pipelines documentation",path:Q.A.PAGES.PIPELINES}},t.createElement("span",null,"Pipelines let you transform and process messages coming from streams. Pipelines consist of stages where rules are evaluated and applied. Messages can go through one or more stages.")),t.createElement(a.Row,{className:"content"},t.createElement(a.Col,{md:12},t.createElement(z,null))))},"ij/cnY+3":(O,y,e)=>{e.d(y,{n:()=>t});const t={page:1,perPage:10,query:""}},"3ndo/hra":(O,y,e)=>{e.d(y,{H:()=>E,J:()=>M});var t=e("JnTtTRmZ"),a=e.n(t),o=e("jAGDuYSC"),u=e("U1Iufsob"),r=e("MdYBRjRJ"),d=e("eFxcQyPT"),P=e("IA3Ku5lS");const E=(0,P.rN)("core.PipelineConnections",()=>a().createActions({list:{asyncResult:!0},connectToStream:{asyncResult:!0},connectToPipeline:{asyncResult:!0}})),M=(0,P.Bv)("core.PipelineConnections",()=>a().createStore({listenables:[E],connections:void 0,getInitialState(){return{connections:this.connections}},list(){const m=c=>{o.A.error(`Fetching pipeline connections failed with status: ${c.message}`,"Could not retrieve pipeline connections")},i=(0,r.H3)(u.A.ConnectionsController.list().url);(0,d.Ay)("GET",i).then(c=>{this.connections=c,this.trigger({connections:c})},m)},connectToStream(m){const i=(0,r.H3)(u.A.ConnectionsController.to_stream().url),A={stream_id:m.stream,pipeline_ids:m.pipelines};(0,d.Ay)("POST",i,A).then(n=>{this.connections.filter(s=>s.stream_id===n.stream_id)[0]?this.connections=this.connections.map(s=>s.stream_id===n.stream_id?n:s):this.connections.push(n),this.trigger({connections:this.connections}),o.A.success("Pipeline connections updated successfully")},this._failUpdateCallback)},connectToPipeline(m){const i=(0,r.H3)(u.A.ConnectionsController.to_pipeline().url),A={pipeline_id:m.pipeline,stream_ids:m.streams};(0,d.Ay)("POST",i,A).then(n=>{n.forEach(s=>{this.connections.filter(l=>l.stream_id===s.stream_id)[0]?this.connections=this.connections.map(l=>l.stream_id===s.stream_id?s:l):this.connections.push(s)}),this.trigger({connections:this.connections}),o.A.success("Pipeline connections updated successfully")},this._failUpdateCallback)},_failUpdateCallback(m){o.A.error(`Updating pipeline connections failed with status: ${m.message}`,"Could not update pipeline connections")}}))},"RU4i+ZYB":(O,y,e)=>{e.d(y,{Z:()=>c,l:()=>i});var t=e("JnTtTRmZ"),a=e.n(t),o=e("VPaD/Np4"),u=e.n(o),r=e("jAGDuYSC"),d=e("MdYBRjRJ"),P=e("U1Iufsob"),E=e("eFxcQyPT"),M=e("gyRmhZSW"),m=e("IA3Ku5lS");const i=(0,m.rN)("core.Pipelines",()=>a().createActions({delete:{asyncResult:!0},list:{asyncResult:!0},listPaginated:{asyncResult:!0},get:{asyncResult:!0},save:{asyncResult:!0},update:{asyncResult:!0},parse:{asyncResult:!0}})),A=n=>{r.A.error(`Fetching pipelines failed with status: ${n.message}`,"Could not retrieve processing pipelines")},c=(0,m.Bv)("core.Pipelines",()=>a().createStore({listenables:[i],pipelines:void 0,getInitialState(){return{pipelines:this.pipelines}},_updatePipelinesState(n){this.pipelines?this.pipelines.some(l=>l.id===n.id)?this.pipelines=this.pipelines.map(l=>l.id===n.id?n:l):this.pipelines.push(n):this.pipelines=[n],this.trigger({pipelines:this.pipelines})},list(){const n=(0,d.H3)(P.A.PipelinesController.list().url);return(0,E.Ay)("GET",n).then(s=>{this.pipelines=s,this.trigger({pipelines:s})},A)},listPaginated({page:n,perPage:s,query:l}){const v=(0,M.A)(P.A.PipelinesController.paginatedList().url,n,s,l),p=(0,E.Ay)("GET",(0,d.H3)(v)).then(g=>({list:u().List(g.pipelines),pagination:{page:g.page,perPage:g.per_page,query:g.query,count:g.count,total:g.total}}));return p.catch(A),i.listPaginated.promise(p),p},get(n){const s=p=>{r.A.error(`Fetching pipeline failed with status: ${p.message}`,`Could not retrieve processing pipeline "${n}"`)},l=(0,d.H3)(P.A.PipelinesController.get(n).url);(0,E.Ay)("GET",l).then(this._updatePipelinesState,s)},save(n){const s=g=>{r.A.error(`Saving pipeline failed with status: ${g.message}`,"Could not save processing pipeline")},l=(0,d.H3)(P.A.PipelinesController.create().url),v={title:n.title,description:n.description,source:n.source},p=(0,E.Ay)("POST",l,v);p.then(g=>{this._updatePipelinesState(g),r.A.success(`Pipeline "${v.title}" created successfully`)},s),i.save.promise(p)},update(n){const s=g=>{r.A.error(`Updating pipeline failed with status: ${g.message}`,"Could not update processing pipeline")},l=(0,d.H3)(P.A.PipelinesController.update(n.id).url),v={id:n.id,title:n.title,description:n.description,source:n.source},p=(0,E.Ay)("PUT",l,v);p.then(g=>{this._updatePipelinesState(g),r.A.success(`Pipeline "${v.title}" updated successfully`)},s),i.update.promise(p)},delete(n){const s=p=>{r.A.error(`Deleting pipeline failed with status: ${p.message}`,`Could not delete processing pipeline "${n}"`)},l=(0,d.H3)(P.A.PipelinesController.delete(n).url),v=(0,E.Ay)("DELETE",l).then(()=>{const p=this.pipelines||[];this.pipelines=p.filter(g=>g.id!==n),this.trigger({pipelines:this.pipelines}),r.A.success(`Pipeline "${n}" deleted successfully`)},s);return i.delete.promise(v),v},parse(n,s){const l=(0,d.H3)(P.A.PipelinesController.parse().url),v={title:n.title,description:n.description,source:n.source};return(0,E.Ay)("POST",l,v).then(()=>{s([])},p=>{p.status===400&&s(p.additional.body)})}}))}}]);})();
//# sourceMappingURL=bb8c8232-2310.f7b597027ba87fd4ec17.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy