web-interface.assets.bb8c8232-1320.b35b8a794ed0a972125d.js Maven / Gradle / Ivy
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-1320"],{ojMHq0dv:(L,B,e)=>{"use strict";e.d(B,{A:()=>p});var t=e("pmX897Fv"),a=e.n(t),A=e("DjJvgDaP"),d=e.n(A),C=d()(a());C.push([L.id,`.Lrll75Yl_6CGdqA_fws8 {
vertical-align: baseline;
}`,"",{version:3,sources:["webpack://./src/components/sidecars/administration/FiltersSummary.css"],names:[],mappings:"AAAA;IACI,wBAAwB;AAC5B",sourcesContent:[`:local(.deleteButton) {
vertical-align: baseline;
}`],sourceRoot:""}]),C.locals={deleteButton:"Lrll75Yl_6CGdqA_fws8"};const p=C},"lxV/WNDc":(L,B,e)=>{"use strict";e.d(B,{A:()=>p});var t=e("pmX897Fv"),a=e.n(t),A=e("DjJvgDaP"),d=e.n(A),C=d()(a());C.push([L.id,`.zL2vwyqmPLuE_eSRQt1q {
margin-top: 10px;
}
.zL2vwyqmPLuE_eSRQt1q dt {
float: left;
clear: left;
}
.zL2vwyqmPLuE_eSRQt1q dd {
margin-left: 160px;
}
.m4So8k7QXl39uuSoP2WS {
margin-top: 10px;
}
.Bfhoisypey7je2baSbGs {
opacity: 0.5;
z-index: 20;
}
`,"",{version:3,sources:["webpack://./src/components/sidecars/common/CommonSidecarStyles.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB;;AAEA;IACI,WAAW;IACX,WAAW;AACf;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,YAAY;IACZ,WAAW;AACf",sourcesContent:[`:local(.deflist) {
margin-top: 10px;
}
:local(.deflist) dt {
float: left;
clear: left;
}
:local(.deflist) dd {
margin-left: 160px;
}
:local(.topMargin) {
margin-top: 10px;
}
:local(.greyedOut) {
opacity: 0.5;
z-index: 20;
}
`],sourceRoot:""}]),C.locals={deflist:"zL2vwyqmPLuE_eSRQt1q",topMargin:"m4So8k7QXl39uuSoP2WS",greyedOut:"Bfhoisypey7je2baSbGs"};const p=C},"TsXT+bAI":(L,B,e)=>{"use strict";e.d(B,{A:()=>p});var t=e("pmX897Fv"),a=e.n(t),A=e("DjJvgDaP"),d=e.n(A),C=d()(a());C.push([L.id,`.xUMQPeRwYREG_QMMJHzD {
white-space: nowrap;
}`,"",{version:3,sources:["webpack://./src/components/sidecars/common/StatusIndicator.css"],names:[],mappings:"AAAA;IACI,mBAAmB;AACvB",sourcesContent:[`:local(.indicator) {
white-space: nowrap;
}`],sourceRoot:""}]),C.locals={indicator:"xUMQPeRwYREG_QMMJHzD"};const p=C},jlBzXt0Y:(L,B,e)=>{"use strict";e.d(B,{A:()=>j});var t=e("Z7aTuO5B"),a=e("ii0bleBb"),A=e.n(a),d=e("IOI9nV80"),C=e("rlwexfKi");const p=t.createElement(t.Fragment,null,t.createElement("p",null,"Find sidecars that did not communicate with Graylog since a date:",t.createElement("br",null),t.createElement("kbd",null,"last_seen:<=2018-04-10"),t.createElement("br",null)),t.createElement("p",null,"Find sidecars with ",t.createElement("code",null,"failing")," or ",t.createElement("code",null,"unknown")," status:",t.createElement("br",null),t.createElement("kbd",null,"status:failing status:unknown"),t.createElement("br",null))),S={status:"Status of the sidecar as it appears in the list, i.e. running, failing, or unknown",operating_system:"Operating system the sidecar is running on",last_seen:"Date and time when the sidecar last communicated with Graylog",node_id:"Identifier of the sidecar",sidecar_version:"Sidecar version"},r=t.createElement(C.A,{entityName:"sidecar",example:p,commonFields:["name"],fieldMap:S}),F=({query:T,onSearch:D,onReset:v,children:P})=>t.createElement(d.B9,{query:T,onSearch:D,onReset:v,placeholder:"Find sidecars",queryHelpComponent:r,topMargin:0,useLoadingState:!0},P);F.propTypes={query:A().string.isRequired,onSearch:A().func.isRequired,onReset:A().func.isRequired,children:A().element},F.defaultProps={children:void 0};const j=F},"nP+JCm88":(L,B,e)=>{"use strict";e.d(B,{A:()=>yt});var t=e("Z7aTuO5B"),a=e("ii0bleBb"),A=e.n(a),d=e("Dg7SLLbb"),C=e.n(d),p=e("IOI9nV80"),S=e("Y7XN0VBN"),r=e("IZYxBTgT"),F=e("O/XpfGnR"),j=e("dFpwyWHg"),T=e.n(j),D=e("C2ikvoS0"),v=e.n(D),P=e("1IntWRSu"),O=e.n(P),G=e("8nGWeFnd"),H=e.n(G),J=e("TeAcaicX"),X=e.n(J),x=e("eE3+5goe"),rt=e.n(x),Z=e("TsXT+bAI"),Q={};Q.styleTagTransform=rt(),Q.setAttributes=H(),Q.insert=O().bind(null,"head"),Q.domAPI=v(),Q.insertStyleElement=X();var gt=T()(Z.A,Q);const ft=Z.A&&Z.A.locals?Z.A.locals:void 0,Et=({message:q,status:St,lastSeen:Rt,id:Tt})=>{const{toUserTimezone:Ot}=(0,F.A)();let k=q;const vt=C()(S.A.toString(St)),Mt=Ot(Rt);let y,nt;switch(St){case S.A.RUNNING:nt="text-success",y="play_arrow";break;case S.A.FAILING:nt="text-danger",y="warning";break;case S.A.STOPPED:nt="text-danger",y="error";break;default:nt="text-info",y="help",k+=` (${(0,r._$)(Mt)})`}return k&&Tt?t.createElement(p.N,{placement:"top",overlay:k,rootClose:!0,trigger:"hover"},t.createElement("span",{className:`${nt} ${ft.indicator}`},t.createElement(p.In,{name:y})," ",vt)):t.createElement("span",{className:`${nt} ${ft.indicator}`},t.createElement(p.In,{name:y})," ",vt)};Et.propTypes={id:A().string,lastSeen:A().string,message:A().string,status:A().number},Et.defaultProps={id:"",lastSeen:void 0,message:"",status:-1};const yt=Et},Y7XN0VBN:(L,B,e)=>{"use strict";e.d(B,{A:()=>p});var t=e("PH5VRLCQ"),a=e.n(t),A=e("ueJll2OF"),d=e.n(A);const p={RUNNING:0,UNKNOWN:1,FAILING:2,STOPPED:3,properties:{0:{name:"running"},1:{name:"unknown"},2:{name:"failing"},3:{name:"stopped"}},isValidStatusCode(S){return Object.keys(this.properties).includes(String(S))},toStatusCode(S){const r=a()(S);return r===this.properties[this.RUNNING].name?this.RUNNING:r===this.properties[this.FAILING].name?this.FAILING:r===this.properties[this.STOPPED].name?this.STOPPED:this.UNKNOWN},toString(S){switch(d()(S)){case this.RUNNING:return"running";case this.FAILING:return"failing";case this.STOPPED:return"stopped";default:return"unknown"}}}},nivIhX0y:(L,B,e)=>{"use strict";e.r(B),e.d(B,{default:()=>en});var t=e("Z7aTuO5B"),a=e("rIl5IEuP"),A=e("E+CaPsQD"),d=e("IOI9nV80"),C=e("D4SbLiE/"),p=e.n(C),S=e("ii0bleBb"),r=e.n(S),F=e("JnTtTRmZ"),j=e.n(F),T=e("IW7priiX"),D=e.n(T),v=e("alU4HbhK"),P=e.n(v),O=e("oc9db6Tt"),G=e.n(O),H=e("1/PeS1Oa"),J=e("XyJ0Mvpg"),X=e("djwd899R"),x=e("kHvj/lAD"),rt=e("r6oYOZXJ"),Z=e("Dg7SLLbb"),Q=e.n(Z),gt=e("MdYBRjRJ"),ft=e("jAGDuYSC"),Et=e("eFxcQyPT"),yt=e("IA3Ku5lS");const q=(0,yt.rN)("core.SidecarsAdministration",()=>j().createActions({list:{asyncResult:!0},refreshList:{asyncResult:!0},setAction:{asyncResult:!0}})),St=(0,yt.Bv)("core.SidecarsAdministration",()=>j().createStore({listenables:[q],sourceUrl:"/sidecar",sidecars:void 0,filters:void 0,pagination:{count:void 0,page:void 0,pageSize:void 0,total:void 0},query:void 0,getInitialState(){return{sidecars:this.sidecars,filters:this.filters,query:this.query,pagination:this.pagination}},propagateChanges(){this.trigger({sidecars:this.sidecars,filters:this.filters,query:this.query,pagination:this.pagination})},list({query:o="",page:s=1,pageSize:n=50,filters:u}){const g={query:o,page:s,per_page:n,filters:u},c=(0,Et.Ur)("POST",gt.H3(`${this.sourceUrl}/administration`),g);c.then(i=>(this.sidecars=i.sidecars,this.query=i.query,this.filters=i.filters,this.pagination={total:i.pagination.total,count:i.pagination.count,page:i.pagination.page,pageSize:i.pagination.per_page},this.propagateChanges(),i),i=>{ft.A.error(i.status===400?i.responseMessage:`Fetching Sidecars failed with status: ${i.message}`,"Could not retrieve Sidecars")}),q.list.promise(c)},refreshList(){this.list({query:this.query,page:this.pagination.page,pageSize:this.pagination.pageSize,filters:this.filters})},setAction(o,s){const u=Object.keys(s).map(i=>({sidecar_id:i,collector_ids:s[i]})),g={action:o,collectors:u},c=(0,Et.Ur)("PUT",gt.H3(`${this.sourceUrl}/administration/action`),g);c.then(i=>(ft.A.success("",`${Q()(o)} for ${u.length} collectors requested`),i),i=>{ft.A.error(`Requesting ${o} failed with status: ${i}`,`Could not ${o} collectors`)}),q.setAction.promise(c)}}));var Rt=e("yA/mTvIZ"),Tt=e.n(Rt),Ot=e("efAt+LzL"),k=e.n(Ot),vt=e("LLTH+mT+"),Mt=e.n(vt),y=e("J6y4/h8P"),nt=e("ty2gyrHp"),Ut=e("d4kzUuQm"),Dt=e("1LOzeRr1"),_t=e("UXJZ+NkS"),qt=e("jlBzXt0Y"),kt=e("nP+JCm88"),te=e("kZOSo4r4"),ee=e("tr19tF7z"),ne=e.n(ee),oe=e("ZyOJ+T1N"),se=e.n(oe),Wt=e("8OvTct/Z"),Nt=e("v4GbOr/o"),ae=e("+KM7MH1U"),jt=e.n(ae),bt=e("kj1rMO+m"),re=e("kwpLVeht");const le=y.default.div`
overflow: auto;
height: 360px;
margin-top: 8px;
`,ie=(0,y.default)(a.Table)`
margin-bottom: 0;
`,ce=y.default.div`
display: flex;
justify-content: center;
`,de=y.default.div`
display: flex;
justify-content: center;
align-items: center;
`,ue=y.default.div`
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #aaa;
margin-top: -4px;
margin-bottom: -2px;
`,Kt=y.default.tr(({disabled:o=!1})=>(0,y.css)`
cursor: ${o?"auto":"pointer"};
background-color: ${o?"#E8E8E8 !important":"initial"};
border-bottom: 1px solid lightgray;
height: 49px;
`),me=y.default.tr`
height: 32px;
position: sticky;
bottom: -1px;
`,Bt=y.default.td`
width: 32px;
`,ge=y.default.td`
width: 140px;
text-align: right;
`,fe=y.default.td`
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
max-width: 0;
`,Ee=y.default.td`
width: 32px;
text-align: center;
`,he=(0,y.default)(a.Modal.Title)`
font-size: 1.266rem !important;
line-height: 1.1;
`,pe=y.default.div`
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
`,Ae=(0,y.default)(d.B9)`
.form-group,
.query {
width: 100% !important;
}
`,Ce=(0,y.default)(re.A)`
border: unset;
margin-bottom: 0;
margin-top: 4px;
`,ye=o=>{try{return new RegExp(o,"i")}catch{return" "}},$t=({show:o,onCancel:s,onSave:n,selectedCollectorName:u,selectedSidecarNames:g,initialAssignedConfigs:c,initialPartiallyAssignedConfigs:i,unassignedConfigs:f,getRowData:I})=>{const[U,et]=(0,t.useState)(""),[Y,ot]=(0,t.useState)(c),[b,V]=(0,t.useState)(i),tt=()=>{ot(c),V(i),et("")},st=jt()(Y,c)&&jt()(b,i),$=[...c,...i,...f].filter(M=>M.match(ye(U))).map(M=>{const{configuration:it,collector:w,sidecars:mt,autoAssignedTags:ct}=I(M),at=Y.includes(M),dt=!at&&b.includes(M),pt=at&&g.join(", ")||dt&&mt.map(E=>E.node_name).join(", ")||"",ut=ct.length>0;return t.createElement(Kt,{key:M,disabled:ut,onClick:()=>{ut||(dt?V(b.filter(E=>E!==M)):ot(at?Y.filter(E=>E!==M):[...Y,M]))}},t.createElement(Bt,null,at&&t.createElement(d.In,{name:"check",title:`${M} is selected`}),dt&&t.createElement(d.In,{type:"regular",name:"radio_button_partial",title:`${M} is selected`})),t.createElement(Bt,null,t.createElement(Dt.A,{color:it.color,size:"xsmall"})),t.createElement(fe,null,M,t.createElement(ue,{title:pt},t.createElement("small",null,pt))),t.createElement(Bt,null,ut&&t.createElement(d.In,{name:"lock",title:`Assigned from tags: ${ct.join(", ")}`})),t.createElement(ge,null,t.createElement("small",null,w?t.createElement(bt.A,{collector:w.name,operatingSystem:w.node_operating_system}):t.createElement("em",null,"Unknown collector"))),t.createElement(Ee,null,(at||dt)&&!ut&&t.createElement(d.In,{name:"close",title:`Remove ${M}`})))});return t.createElement(a.BootstrapModalWrapper,{showModal:o,onHide:s},t.createElement(a.Modal.Header,null,t.createElement(he,null,"Edit ",t.createElement("b",null,u)," Configurations",t.createElement(pe,null,t.createElement("small",null,`${g.length} sidecar${g.length>1?"s":""}: `,g.join(", "))))),t.createElement(a.Modal.Body,null,t.createElement(Ae,{query:U,onQueryChange:M=>et(M),topMargin:0}),$.length>0&&t.createElement(Ce,{bsStyle:"info"},"Collector configurations that have a lock icon \xA0",t.createElement(d.In,{name:"lock",size:"xs"}),"\xA0 have been assigned using tags and cannot be changed here."),t.createElement(le,null,t.createElement(ie,{className:"table-condensed table-hover"},t.createElement("tbody",null,$.length===0?t.createElement(Kt,null,t.createElement("td",{colSpan:6},t.createElement(ce,null,"No configurations available for the selected log collector."))):$,t.createElement(me,null,t.createElement("td",{colSpan:6},t.createElement(de,null,t.createElement(nt.N,{to:Ut.Ay.SYSTEM.SIDECARS.NEW_CONFIGURATION},t.createElement(d.In,{name:"add"}),"\xA0Add a new configuration")))))))),t.createElement(a.Modal.Footer,null,t.createElement(a.Button,{type:"button",onClick:s},"Cancel"),t.createElement(a.Button,{type:"button",onClick:tt},"Reset"),t.createElement(a.Button,{type:"submit",bsStyle:"primary",disabled:st,onClick:()=>n(Y,b)},"Save")))};$t.propTypes={show:r().bool.isRequired,selectedCollectorName:r().string.isRequired,selectedSidecarNames:r().array.isRequired,initialAssignedConfigs:r().array.isRequired,initialPartiallyAssignedConfigs:r().array.isRequired,unassignedConfigs:r().array.isRequired,onCancel:r().func.isRequired,onSave:r().func.isRequired,getRowData:r().func.isRequired};const Se=$t,ve=y.default.div`
word-break: break-all;
`,zt=({collectors:o,configurations:s,selectedSidecarCollectorPairs:n,onConfigurationSelectionChange:u,show:g,onCancel:c})=>{const[i,f]=(0,t.useState)([]),[I,U]=(0,t.useState)([]),[et,Y]=(0,t.useState)(!1),ot=(0,Wt.A)(),b=()=>k()(n.map(({collector:E})=>E))[0],V=E=>E.sort((h,R)=>(0,H.m)(h.name,R.name)).map(h=>h.name),tt=(E,h)=>{const W=E.map(({sidecar:K})=>K).reduce((K,l)=>K.concat(l.assignments),[]).map(K=>s.find(l=>l.id===K.configuration_id)).filter(K=>(h==null?void 0:h.id)===K.collector_id);return V(W)},st=(E,h)=>{const R=s.filter(W=>!E.includes(W.name)&&(h==null?void 0:h.id)===W.collector_id);return V(R)},lt=E=>{const h=ne()(E);return[k()(E.filter(R=>h[R]===n.length)),k()(E.filter(R=>h[R]{f(E),U(h),Y(!0)},M=()=>{f([]),U([]),Y(!1)},it=()=>{const E=s.filter(h=>i.includes(h.name));n.forEach(h=>{let R=E;if(I.length){const W=b(),K=tt([h],W),l=se()(K,I),m=s.filter(_=>l.includes(_.name));R=[...E,...m]}ot(Nt.g.SIDECARS.CONFIGURATION_ASSIGNED,{app_pathname:"sidecars",app_section:"administration"}),u([h],R,()=>{})}),M(),c()},w=E=>s.find(h=>h.name===E),mt=E=>{const h=w(E);return o.find(R=>R.id===h.collector_id)},ct=E=>{const h=w(E);return n.filter(({sidecar:R})=>R.assignments.map(W=>W.configuration_id).includes(h.id)).map(R=>R.sidecar)},at=(E,h,R)=>{const W=R.reduce((K,l)=>K.concat(l.assignments.find(m=>m.collector_id===h&&m.configuration_id===E).assigned_from_tags),[]);return k()(W)},dt=E=>{const h=w(E),R=mt(E),W=ct(E),K=at(h.id,R.id,W);return{configuration:h,collector:R,sidecars:W,autoAssignedTags:K}},pt=()=>{const E=n.map(({sidecar:W})=>W.node_name).join(", "),h=`${n.length} sidecars`,R=n.length<=5?E:h;return t.createElement(a.BootstrapModalConfirm,{showModal:et,title:"Configuration summary",onConfirm:it,onCancel:M},t.createElement(ve,null,t.createElement("p",null,"Are you sure you want to proceed with this action for ",t.createElement("b",null,R),"?")))},ut=(0,t.useMemo)(()=>()=>{const h=b(),R=tt(n,h),W=st(R,h),[K,l]=lt(R);return t.createElement(Se,{show:g,selectedCollectorName:(h==null?void 0:h.name)||"",selectedSidecarNames:n.map(({sidecar:m})=>m.node_name),initialAssignedConfigs:K,initialPartiallyAssignedConfigs:l,unassignedConfigs:W,onCancel:c,onSave:$,getRowData:dt})},[g]);return t.createElement(t.Fragment,null,t.createElement(ut,null),pt())};zt.propTypes={collectors:r().array.isRequired,configurations:r().array.isRequired,selectedSidecarCollectorPairs:r().array.isRequired,onConfigurationSelectionChange:r().func.isRequired,show:r().bool.isRequired,onCancel:r().func.isRequired};const Gt=zt;var Pe=e("13uboeDm"),Ht=e.n(Pe);const Ie=["start","restart","stop"],Qt=({selectedSidecarCollectorPairs:o,onProcessAction:s})=>{const[n,u]=(0,t.useState)(""),[g,c]=(0,t.useState)(!1),[i,f]=(0,t.useState)(!1),I=(0,Wt.A)(),U=()=>{u(void 0)},et=($,M)=>{M(),u($?$[0]:void 0),f(!0)},Y=()=>{U(),f(!1)},ot=()=>{I(Nt.g.SIDECARS.PROCESS_ACTION_SET,{app_pathname:"sidecars",app_section:"administration",event_details:{action:n}}),s(n,o,Y)},b=()=>{c(!0)},V=$=>t.createElement(t.Fragment,null,t.createElement("p",null,"You are going to ",t.createElement("strong",null,n)," log collectors in\xA0",t.createElement(d.Fb,{singular:"this sidecar",plural:"these sidecars",value:$.length}),":"),t.createElement("p",null,$.join(", ")),t.createElement("p",null,"Are you sure you want to proceed with this action?")),tt=()=>t.createElement(a.Panel,{bsStyle:"info",header:"Collectors without Configuration"},t.createElement("p",null,"At least one selected Collector is not configured yet. To start a new Collector, assign a Configuration to it and the Sidecar will start the process for you."),t.createElement("p",null,Ht()(n),"ing a Collector without Configuration will have no effect."),t.createElement(a.Button,{bsSize:"xsmall",bsStyle:"primary",onClick:b},"Understood, continue anyway")),st=()=>{const $=k()(o.map(({sidecar:w})=>w.node_name)),M=o.every(({collector:w,sidecar:mt})=>mt.assignments.some(({collector_id:ct})=>ct===w.id)),it=!g&&!M;return t.createElement(a.BootstrapModalConfirm,{showModal:i,title:"Process action summary",confirmButtonDisabled:it,onConfirm:ot,onCancel:Y},t.createElement("div",null,it?tt():V($)))},lt=$=>Ht()($);return t.createElement("span",null,t.createElement(d.kA,{id:"process-management-action",title:"Manage collector processes",triggerNode:t.createElement(a.Button,{bsStyle:"primary",bsSize:"small"},"Process"),items:Ie,itemFormatter:lt,selectedItems:n?[n]:[],displayDataFilter:!1,onItemSelect:et}),st())};Qt.propTypes={selectedSidecarCollectorPairs:r().array.isRequired,onProcessAction:r().func.isRequired};const Re=Qt,Te=(0,y.default)(a.Button)`
margin-right: 6px;
`,Xt=({collectors:o,configurations:s,selectedSidecarCollectorPairs:n,onConfigurationSelectionChange:u,onProcessAction:g})=>{const[c,i]=(0,t.useState)(!1),f=(0,t.useCallback)(()=>i(!1),[]),I=k()(n.map(({collector:Y})=>Y.name)),U=!n.length||I.length!==1,et=()=>n.length?I.length!==1?`Cannot change configurations of ${I.join(", ")} collectors simultaneously.`:"Assign Configurations":"Incompatible collectors, please check your sidecar configuration.";return t.createElement(a.ButtonToolbar,null,t.createElement(Te,{title:et(),bsStyle:"primary",bsSize:"small",disabled:U,onClick:()=>i(!0)},t.createElement(d.In,{name:"edit_square"})," Assign Configurations"),t.createElement(Gt,{collectors:o,configurations:s,selectedSidecarCollectorPairs:n,onConfigurationSelectionChange:u,show:c,onCancel:f}),t.createElement(Re,{selectedSidecarCollectorPairs:n,onProcessAction:g}))};Xt.propTypes={collectors:r().array.isRequired,configurations:r().array.isRequired,selectedSidecarCollectorPairs:r().array.isRequired,onConfigurationSelectionChange:r().func.isRequired,onProcessAction:r().func.isRequired};const Oe=Xt;var Ft=e("Y7XN0VBN");const Me=p()({propTypes:{collectors:r().array.isRequired,configurations:r().array.isRequired,filters:r().object.isRequired,filter:r().func.isRequired},onFilterChange(o,s,n){const{filter:u}=this.props;u(o,s),n()},getCollectorsFilter(){const{collectors:o,filters:s}=this.props,n=f=>`${f.id};${f.name}`,u=o.sort((f,I)=>(0,H.m)(f.name,I.name)).map(n),g=f=>{const[I]=f.split(";"),U=P()(o,{id:I});return t.createElement(bt.A,{collector:U.name,operatingSystem:U.node_operating_system})},c=([f],I)=>{const[U]=f?f.split(";"):[];this.onFilterChange("collector",U,I)};let i;if(s.collector){const f=o.find(I=>I.id===s.collector);i=f?n(f):void 0}return t.createElement(d.kA,{id:"collector-filter",title:"Filter by collector",triggerNode:t.createElement(a.Button,{bsSize:"small",bsStyle:"link"},"Collector ",t.createElement("span",{className:"caret"})),items:u,itemFormatter:g,onItemSelect:c,selectedItems:i?[i]:[],filterPlaceholder:"Filter by collector"})},getConfigurationFilter(){const{configurations:o,filters:s}=this.props,n=f=>`${f.id};${f.name}`,u=o.sort((f,I)=>(0,H.m)(f.name,I.name)).map(n),g=f=>{const[I]=f.split(";"),U=P()(o,{id:I});return t.createElement("span",null,t.createElement(Dt.A,{color:U.color,size:"xsmall"})," ",U.name)},c=([f],I)=>{const[U]=f?f.split(";"):[];this.onFilterChange("configuration",U,I)};let i;if(s.configuration){const f=o.find(I=>I.id===s.configuration);i=f?n(f):void 0}return t.createElement(d.kA,{id:"configuration-filter",title:"Filter by configuration",triggerNode:t.createElement(a.Button,{bsSize:"small",bsStyle:"link"},"Configuration ",t.createElement("span",{className:"caret"})),items:u,itemFormatter:g,onItemSelect:c,selectedItems:i?[i]:[],filterPlaceholder:"Filter by configuration"})},getOSFilter(){const{collectors:o,filters:s}=this.props,n=k()(o.map(c=>Q()(c.node_operating_system))).sort(H.m),u=([c],i)=>this.onFilterChange("os",c,i),g=s.os;return t.createElement(d.kA,{id:"os-filter",title:"Filter by OS",triggerNode:t.createElement(a.Button,{bsSize:"small",bsStyle:"link"},"OS ",t.createElement("span",{className:"caret"})),items:n,onItemSelect:u,selectedItems:g?[g]:[],filterPlaceholder:"Filter by OS"})},getStatusFilter(){const{filters:o}=this.props,s=Object.keys(Ft.A.properties).map(c=>String(c)),n=([c],i)=>this.onFilterChange("status",c,i),u=o.status,g=c=>Q()(Ft.A.toString(c));return t.createElement(d.kA,{id:"status-filter",title:"Filter by collector status",triggerNode:t.createElement(a.Button,{bsSize:"small",bsStyle:"link"},"Collector Status ",t.createElement("span",{className:"caret"})),items:s,itemFormatter:g,onItemSelect:n,selectedItems:u?[u]:[],filterPlaceholder:"Filter by collector status"})},render(){return t.createElement(a.ButtonToolbar,null,this.getCollectorsFilter(),this.getConfigurationFilter(),this.getStatusFilter(),this.getOSFilter())}});var De=e("dFpwyWHg"),Be=e.n(De),Fe=e("C2ikvoS0"),xe=e.n(Fe),Le=e("1IntWRSu"),Ue=e.n(Le),_e=e("8nGWeFnd"),We=e.n(_e),Ne=e("TeAcaicX"),je=e.n(Ne),be=e("eE3+5goe"),Ke=e.n(be),Pt=e("ojMHq0dv"),ht={};ht.styleTagTransform=Ke(),ht.setAttributes=We(),ht.insert=Ue().bind(null,"head"),ht.domAPI=xe(),ht.insertStyleElement=je();var on=Be()(Pt.A,ht);const $e=Pt.A&&Pt.A.locals?Pt.A.locals:void 0;var ze=Object.defineProperty,Ge=(o,s,n)=>s in o?ze(o,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[s]=n,xt=(o,s,n)=>(Ge(o,typeof s!="symbol"?s+"":s,n),n);class Yt extends t.Component{constructor(){super(...arguments),xt(this,"formatFilter",(s,n)=>{const{collectors:u,configurations:g}=this.props;if(s==="collector"){const c=u.find(i=>i.id===n);return`${c.name} on ${c.node_operating_system}`}return s==="configuration"?g.find(c=>c.id===n).name:s==="status"?Ft.A.toString(n):n}),xt(this,"formatFilters",s=>Object.keys(s).map(n=>t.createElement("li",{key:n},n,": ",this.formatFilter(n,s[n]))))}render(){const{filters:s,onResetFilters:n}=this.props;return G()(s)?null:t.createElement(a.Row,{className:"row-sm"},t.createElement(a.Col,{md:10},t.createElement("ul",{className:"list-inline"},t.createElement("li",null,t.createElement("b",null,"Filters")),this.formatFilters(s),t.createElement("li",null,t.createElement(a.Button,{bsStyle:"link",bsSize:"xsmall",className:$e.deleteButton,onClick:n},t.createElement(d.In,{name:"close"})," Clear all")))))}}xt(Yt,"propTypes",{collectors:r().array.isRequired,configurations:r().array.isRequired,filters:r().object.isRequired,onResetFilters:r().func.isRequired});const He=Yt,Qe=y.default.div(({theme:o})=>(0,y.css)`
float: right;
margin: 5px 0;
.btn-link {
color: ${o.colors.variant.darker.default};
}
.btn-toolbar {
display: flex;
max-height: 29px;
}
`),Jt=y.default.div`
.row {
margin-bottom: 5px;
}
.form-group {
display: inline-block;
margin: 0 10px 0 0;
}
.checkbox {
margin-top: 5px;
margin-bottom: 5px;
}
.checkbox label {
font-size: 1rem; /* theme.fonts.size.body */
}
`,Xe=(0,y.default)(Jt)(({theme:o})=>(0,y.css)`
color: ${o.colors.variant.light.default};
margin-left: 20px;
`),Zt=y.default.span`
display: flex;
margin-top: 5px;
flex-wrap: wrap;
`,Ye=y.default.span`
margin-left: 20px;
`,Je=y.default.div`
.page-size {
padding-top: 4px;
}
.search {
margin-bottom: 15px;
}
`,Ze=y.default.span`
.color-label-wrapper {
display: flex;
}
`,Vt=[10,25,50,100],wt=({configurations:o,collectors:s,onPageChange:n,pagination:u,query:g,sidecarCollectorPairs:c,filters:i,onFilter:f,onQueryChange:I,onConfigurationChange:U,onProcessAction:et})=>{const[Y,ot]=(0,t.useState)(!1),[b,V]=(0,t.useState)([]),tt=(0,t.useRef)(null),st=c.filter(({collector:l})=>!G()(l)),lt=(l,m)=>`${l.node_id}-${m.name}`,$=(l,m)=>l.length>0&&l.length===m.length;(0,t.useEffect)(()=>{const l=tt?tt.current.getInputDOMNode():void 0;l&&(l.indeterminate=b.length>0&&!$(s,b))},[tt,s,b]);const M=(l,m,_)=>{U(l,m,_)},it=(l,m,_)=>{const N={};m.forEach(({sidecar:Ct,collector:At})=>{N[Ct.node_id]?N[Ct.node_id].push(At.id):N[Ct.node_id]=[At.id]}),et(l,N,_)},w=l=>{const m=l.target.checked?st.map(({sidecar:_,collector:N})=>lt(_,N)):[];V(m)},mt=l=>{const m=b.length;let _;return m===0?_=t.createElement(Me,{collectors:s,configurations:o,filters:i,filter:f}):_=t.createElement(Oe,{selectedSidecarCollectorPairs:l,collectors:s,configurations:o,onConfigurationSelectionChange:M,onProcessAction:it}),t.createElement(d.nB.Header,null,t.createElement(Qe,null,_),t.createElement(a.Input,{ref:tt,id:"select-all-checkbox",type:"checkbox",label:m===0?"Select all":`${m} selected`,disabled:st.length===0,checked:$(st,b),onChange:w,wrapperClassName:"form-group-inline"}))},ct=l=>m=>{const _=m.target.checked?Tt()(b,[l]):Mt()(b,l);V(_)},at=l=>t.createElement(d.nB.Item,{key:`sidecar-${l.node_id}`},t.createElement(Xe,null,t.createElement(a.Row,null,t.createElement(a.Col,{md:12},t.createElement("h4",{className:"list-group-item-heading"},l.node_name," ",t.createElement(_t.A,{operatingSystem:l.node_details.operating_system}),"\u2003",t.createElement("small",null,l.node_id)))),t.createElement(a.Row,null,t.createElement(a.Col,{md:12},t.createElement("span",null,"No collectors compatible with ",l.node_details.operating_system))))),dt=(l,m,_)=>{const N=lt(l,m),Ct=l.assignments.filter(z=>z.collector_id===m.id).map(z=>z.configuration_id),At=_.filter(z=>Ct.includes(z.id)).sort((z,Lt)=>(0,H.m)(z.name,Lt.name));let It={status:null,message:null,id:null};try{const z=l.node_details.status.collectors.find(Lt=>Lt.collector_id===m.id);z&&(It={status:z.status,message:z.message,id:z.collector_id})}catch{}return t.createElement(a.Row,{key:N},t.createElement(a.Col,{lg:1,md:2,xs:3},t.createElement(a.Input,{id:`${N}-checkbox`,type:"checkbox",label:m.name,checked:b.includes(N),onChange:ct(N)})),t.createElement(a.Col,{lg:1,md:2,xs:3},t.createElement(Zt,null,At.length>0&&t.createElement(kt.A,{status:It.status,message:It.message,id:It.id,lastSeen:l.last_seen}))),t.createElement(a.Col,{lg:10,md:8,xs:6},t.createElement(Zt,null,At.length>0&&t.createElement(d.K0,{name:"edit_square",onClick:()=>{V([N]),ot(!0)}}),At.map(z=>t.createElement(nt.N,{key:z.id,to:Ut.Ay.SYSTEM.SIDECARS.EDIT_CONFIGURATION(z.id)},t.createElement(Ze,null,t.createElement(Dt.A,{color:z.color,text:z.name})))))))},pt=(l,m,_)=>m.length===0?at(l):t.createElement(d.nB.Item,{key:`sidecar-${l.node_id}`},t.createElement(Jt,null,t.createElement(a.Row,null,t.createElement(a.Col,{md:12},t.createElement(Ye,{className:`list-group-item-heading ${!l.active&&te.A.greyedOut}`},l.node_name," ",t.createElement(_t.A,{operatingSystem:l.node_details.operating_system}),"\u2003",t.createElement("small",null,l.node_id," ",!l.active&&t.createElement("b",null,"\u2014 inactive"))))),m.map(N=>dt(l,N,_)))),ut=(l,m)=>{I(l,m)},E=()=>{I()},h=()=>{f()},R=(l,m)=>{V([]),n(l,m)},W=b.map(l=>c.find(({sidecar:m,collector:_})=>lt(m,_)===l)).filter(l=>!!(l!=null&&l.collector)&&!!(l!=null&&l.sidecar));let K;return c.length===0?K=t.createElement(d.nB.Item,null,c.length===0?"There are no collectors to display":"Filters do not match any collectors"):K=k()(c.map(({sidecar:m})=>m)).map(m=>{const _=c.filter(({sidecar:N})=>N.node_id===m.node_id).map(({collector:N})=>N).filter(N=>!G()(N));return pt(m,_,o)}),t.createElement(Je,null,t.createElement(d.OW,{pageSizes:Vt,totalItems:u.total,onChange:R},t.createElement(qt.A,{query:g,onSearch:ut,onReset:E}),t.createElement(He,{collectors:s,configurations:o,filters:i,onResetFilters:h}),t.createElement(a.Row,null,t.createElement(a.Col,{md:12},t.createElement(d.nB,null,mt(W),K)))),t.createElement(Gt,{collectors:s,configurations:o,selectedSidecarCollectorPairs:W,onConfigurationSelectionChange:M,show:Y,onCancel:()=>{V([]),ot(!1)}}))};wt.propTypes={sidecarCollectorPairs:r().array.isRequired,collectors:r().array.isRequired,configurations:r().array.isRequired,pagination:r().object.isRequired,query:r().string.isRequired,filters:r().object.isRequired,onPageChange:r().func.isRequired,onFilter:r().func.isRequired,onQueryChange:r().func.isRequired,onConfigurationChange:r().func.isRequired,onProcessAction:r().func.isRequired};const Ve=wt,we=p()({propTypes:{nodeId:r().string,paginationQueryParameter:r().object.isRequired},mixins:[j().connect(x.k,"collectors"),j().connect(St,"sidecars"),j().connect(X.g,"configurations")],getDefaultProps(){return{nodeId:void 0}},componentDidMount(){this.loadData(this.props.nodeId),this.interval=setInterval(this.reloadSidecars,5e3)},componentDidUpdate(o){o.nodeId!==this.props.nodeId&&this.loadData(this.props.nodeId)},componentWillUnmount(){this.interval&&clearInterval(this.interval)},handlePageChange(o,s){const{filters:n,query:u}=this.state.sidecars;q.list({query:u,filters:n,page:o,pageSize:s})},handleFilter(o,s){const{resetPage:n,pageSize:u}=this.props.paginationQueryParameter,{filters:g,query:c}=this.state.sidecars;let i;o?(i=D()(g),i[o]=s):i={},n(),q.list({query:c,filters:i,pageSize:u,page:1})},handleQueryChange(o="",s=()=>{}){const{resetPage:n,pageSize:u}=this.props.paginationQueryParameter,{filters:g}=this.state.sidecars;n(),q.list({query:o,filters:g,pageSize:u,page:1}).finally(s)},handleConfigurationChange(o,s,n){rt.U.assignConfigurations(o,s).then(u=>{n();const{query:g,filters:c}=this.state.sidecars,{page:i,pageSize:f}=this.props.paginationQueryParameter;return q.list({query:g,filters:c,pageSize:f,page:i}),u})},handleProcessAction(o,s,n){q.setAction(o,s).then(u=>(n(),u))},reloadSidecars(){this.state.sidecars&&q.refreshList()},loadData(o){const{page:s,pageSize:n}=this.props.paginationQueryParameter,u=o?`node_id:${o}`:"";x.C.all(),q.list({query:u,page:s,pageSize:n}),X.s.all()},render(){const{collectors:o,configurations:s,sidecars:n}=this.state;if(!o||!o.collectors||!n||!n.sidecars||!s||!s.configurations)return t.createElement(d.y$,{text:"Loading collector list..."});const u=[];return n.sidecars.sort((g,c)=>(0,H.m)(g.node_name,c.node_name)).forEach(g=>{const c=g.collectors;if(G()(c)){u.push({collector:{},sidecar:g});return}c.map(i=>P()(o.collectors,{id:i})).forEach(i=>{u.push({collector:i,sidecar:g})})}),t.createElement(Ve,{sidecarCollectorPairs:u,collectors:o.collectors,configurations:s.configurations,pagination:n.pagination,query:n.query,filters:n.filters,onPageChange:this.handlePageChange,onFilter:this.handleFilter,onQueryChange:this.handleQueryChange,onConfigurationChange:this.handleConfigurationChange,onProcessAction:this.handleProcessAction})}}),qe=(0,J.A)(we,{pageSizes:Vt});var ke=e("tBcsAR17"),tn=e("brbjQOmY");const en=()=>{const{node_id:o}=(0,tn.A)();return t.createElement(d.Qc,{title:"Collectors Administration"},t.createElement(ke.A,null),t.createElement(d.zY,{title:"Collectors Administration",documentationLink:{title:"Sidecar documentation",path:A.A.PAGES.COLLECTOR_SIDECAR}},t.createElement("span",null,"The Graylog collectors can reliably forward contents of log files or Windows EventLog from your servers.")),t.createElement(a.Row,{className:"content"},t.createElement(a.Col,{md:12},t.createElement(qe,{nodeId:o}))))}},r6oYOZXJ:(L,B,e)=>{"use strict";e.d(B,{U:()=>F,W:()=>j});var t=e("JnTtTRmZ"),a=e.n(t),A=e("oCSEoDew"),d=e.n(A),C=e("MdYBRjRJ"),p=e("jAGDuYSC"),S=e("eFxcQyPT"),r=e("IA3Ku5lS");const F=(0,r.rN)("core.Sidecars",()=>a().createActions({listPaginated:{asyncResult:!0},getSidecar:{asyncResult:!0},getSidecarActions:{asyncResult:!0},restartCollector:{asyncResult:!0},assignConfigurations:{asyncResult:!0}})),j=(0,r.Bv)("core.Sidecars",()=>a().createStore({listenables:[F],sourceUrl:"/sidecars",sidecars:void 0,onlyActive:void 0,pagination:{count:void 0,page:void 0,pageSize:void 0,total:void 0},query:void 0,sort:{field:void 0,order:void 0},init(){this.propagateChanges()},propagateChanges(){this.trigger({sidecars:this.sidecars,query:this.query,onlyActive:this.onlyActive,pagination:this.pagination,sort:this.sort})},listPaginated({query:T="",page:D=1,pageSize:v=50,onlyActive:P=!1,sortField:O="node_name",order:G="asc"}){const H={query:T,page:D,per_page:v,only_active:P,sort:O,order:G},J=d()(this.sourceUrl).search(H).toString(),X=(0,S.Ur)("GET",C.H3(J));X.then(x=>(this.sidecars=x.sidecars,this.query=x.query,this.onlyActive=x.only_active,this.pagination={total:x.pagination.total,count:x.pagination.count,page:x.pagination.page,pageSize:x.pagination.per_page},this.sort={field:x.sort,order:x.order},this.propagateChanges(),x),x=>{p.A.error(x.status===400?x.responseMessage:`Fetching Sidecars failed with status: ${x.message}`,"Could not retrieve Sidecars")}),F.listPaginated.promise(X)},getSidecar(T){const D=(0,S.Ur)("GET",C.H3(`${this.sourceUrl}/${T}`));D.catch(v=>{let P=`Fetching Sidecar failed with status: ${v}`;v.status===404&&(P=`Unable to find a sidecar with ID <${T}>, maybe it was inactive for too long.`),p.A.error(P,"Could not retrieve Sidecar")}),F.getSidecar.promise(D)},restartCollector(T,D){const v={};v.collector=D,v.properties={},v.properties.restart=!0;const P=(0,S.Ay)("PUT",C.H3(`${this.sourceUrl}/${T}/action`),[v]);P.catch(O=>{p.A.error(`Restarting Sidecar failed with status: ${O}`,"Could not restart Sidecar")}),F.restartCollector.promise(P)},getSidecarActions(T){const D=(0,S.Ur)("GET",C.H3(`${this.sourceUrl}/${T}/action`));D.catch(v=>{p.A.error(`Fetching Sidecar actions failed with status: ${v}`,"Could not retrieve Sidecar actions")}),F.getSidecarActions.promise(D)},toConfigurationAssignmentDto(T,D,v){return{node_id:T,collector_id:D,configuration_id:v}},assignConfigurations(T,D){const v=T.map(({sidecar:O,collector:G})=>{const H=O.assignments.filter(J=>J.collector_id!==G.id);return D.forEach(J=>{H.push({collector_id:G.id,configuration_id:J.id})}),{node_id:O.node_id,assignments:H}}),P=(0,S.Ay)("PUT",C.H3(`${this.sourceUrl}/configurations`),{nodes:v});P.then(O=>(p.A.success("",`Configuration change for ${T.length} collectors requested`),O),O=>{p.A.error(`Fetching Sidecar actions failed with status: ${O}`,"Could not retrieve Sidecar actions")}),F.assignConfigurations.promise(P)}}))},"Rs/36W+w":(L,B,e)=>{var t=e("8ltHcpdL"),a=e("pSuustBB"),A=e("yvNqE1Lg"),d=e("4FGLTY2N"),C=e("Ijh8Dquo"),p=e("fO1Ag3P5"),S=Math.min;function r(F,j,T){for(var D=T?A:a,v=F[0].length,P=F.length,O=P,G=Array(P),H=1/0,J=[];O--;){var X=F[O];O&&j&&(X=d(X,C(j))),H=S(X.length,H),G[O]=!T&&(j||v>=120&&X.length>=120)?new t(O&&X):void 0}X=F[0];var x=-1,rt=G[0];t:for(;++x{var t=e("Ynj+YPJQ");function a(A){return t(A)?A:[]}L.exports=a},tr19tF7z:(L,B,e)=>{var t=e("mKCr8FEe"),a=e("aB24O9M4"),A=Object.prototype,d=A.hasOwnProperty,C=a(function(p,S,r){d.call(p,r)?++p[r]:t(p,r,1)});L.exports=C},"ZyOJ+T1N":(L,B,e)=>{var t=e("4FGLTY2N"),a=e("Rs/36W+w"),A=e("Ce+nMSm/"),d=e("aP7cRxzs"),C=A(function(p){var S=t(p,d);return S.length&&S[0]===p[0]?a(S):[]});L.exports=C},PH5VRLCQ:(L,B,e)=>{var t=e("R+B8SaP1"),a=t(function(A,d,C){return A+(C?" ":"")+d.toLowerCase()});L.exports=a},kZOSo4r4:(L,B,e)=>{"use strict";e.d(B,{A:()=>G});var t=e("dFpwyWHg"),a=e.n(t),A=e("C2ikvoS0"),d=e.n(A),C=e("1IntWRSu"),p=e.n(C),S=e("8nGWeFnd"),r=e.n(S),F=e("TeAcaicX"),j=e.n(F),T=e("eE3+5goe"),D=e.n(T),v=e("lxV/WNDc"),P={};P.styleTagTransform=D(),P.setAttributes=r(),P.insert=p().bind(null,"head"),P.domAPI=d(),P.insertStyleElement=j();var O=a()(v.A,P);const G=v.A&&v.A.locals?v.A.locals:void 0}}]);})();
//# sourceMappingURL=bb8c8232-1320.b35b8a794ed0a972125d.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy