web-interface.assets.07ba022f-8579.38586df959b2a9d16148.js Maven / Gradle / Ivy
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["07ba022f-8579"],{ETE5k4rC:(T,C,e)=>{"use strict";e.d(C,{Z:()=>s});var t=e("pmX897Fv"),E=e.n(t),c=e("DjJvgDaP"),o=e.n(c),h=o()(E());h.push([T.id,`.popover.i3CKk4UXmnkyBYYZ5r2x {
max-width: 500px;
}`,"",{version:3,sources:["webpack://./src/components/sidecars/common/SidecarSearchForm.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB",sourcesContent:[`.popover:local(.popoverWide) {
max-width: 500px;
}`],sourceRoot:""}]),h.locals={popoverWide:"i3CKk4UXmnkyBYYZ5r2x"};const s=h},"TsXT+bAI":(T,C,e)=>{"use strict";e.d(C,{Z:()=>s});var t=e("pmX897Fv"),E=e.n(t),c=e("DjJvgDaP"),o=e.n(c),h=o()(E());h.push([T.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:""}]),h.locals={indicator:"xUMQPeRwYREG_QMMJHzD"};const s=h},POojUUcb:(T,C,e)=>{"use strict";e.d(C,{Z:()=>s});var t=e("pmX897Fv"),E=e.n(t),c=e("DjJvgDaP"),o=e.n(c),h=o()(E());h.push([T.id,`.HhN_MIs88hGyrJ9d3fGo {
margin-top: 15px;
margin-bottom: 0;
}
.X3aV_WfTsy4PgoEPh7qV {
margin-top: 5px;
display: inline-block;
}
.XxLkD37ugJdsOziizyQC {
width: 230px;
}
.fn84_KNI34D5Bb61NCwy {
margin-left: 5px;
}
`,"",{version:3,sources:["webpack://./src/components/sidecars/sidecars/SidecarList.css"],names:[],mappings:"AAAA;IACI,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,eAAe;IACf,qBAAqB;AACzB;;AAEA;IACI,YAAY;AAChB;;AAEA;IACI,gBAAgB;AACpB",sourcesContent:[`:local(.sidecarList) {
margin-top: 15px;
margin-bottom: 0;
}
:local(.sidecarsFilter) {
margin-top: 5px;
display: inline-block;
}
:local(.actions) {
width: 230px;
}
:local(.inactiveSidecarsButton) {
margin-left: 5px;
}
`],sourceRoot:""}]),h.locals={sidecarList:"HhN_MIs88hGyrJ9d3fGo",sidecarsFilter:"X3aV_WfTsy4PgoEPh7qV",actions:"XxLkD37ugJdsOziizyQC",inactiveSidecarsButton:"fn84_KNI34D5Bb61NCwy"};const s=h},d1DhBDs2:(T,C,e)=>{"use strict";e.d(C,{Z:()=>s});var t=e("pmX897Fv"),E=e.n(t),c=e("DjJvgDaP"),o=e.n(c),h=o()(E());h.push([T.id,`.iYXK7cmO8Zc91rNID2zz {
word-break: break-all;
}
`,"",{version:3,sources:["webpack://./src/components/sidecars/sidecars/SidecarRow.css"],names:[],mappings:"AAAA;IACI,qBAAqB;AACzB",sourcesContent:[`:local(.sidecarName) {
word-break: break-all;
}
`],sourceRoot:""}]),h.locals={sidecarName:"iYXK7cmO8Zc91rNID2zz"};const s=h},SfPIQIJE:(T,C,e)=>{"use strict";e.d(C,{Z:()=>y});var t=e("Z7aTuO5B"),E=e("J6y4/h8P"),c=e("uZqmR+ju"),o=e("ty2gyrHp"),h=e("/GOzvPf6"),s=e("NV1/EHMi");const S=(0,E.default)(c.ButtonToolbar)`
margin-bottom: 10px;
`,m=(0,E.default)(c.Button)(({theme:l})=>(0,E.css)`
font-family: ${l.fonts.family.navigation};
font-size: ${l.fonts.size.navigation};
&&&& {
color: ${l.colors.variant.darker.default};
&:hover,
&:focus {
text-decoration: none;
}
> div {
&:hover,
&:focus {
color: ${l.colors.variant.darker.default};
}
}
&:hover {
${(0,s.RF)(l)}
}
&.active {
color: ${l.colors.global.textDefault};
${(0,s.A7)(l)}
&:hover,
&:focus {
${(0,s.A7)(l)}
}
}
}
`);m.displayName="Button";const y=({items:l})=>t.createElement(S,null,l.map(({path:P,title:f,permissions:p,exactPathMatch:v})=>P?t.createElement(h.AE,{permissions:p!=null?p:[],key:P},t.createElement(o.J,{to:P,relativeActive:!v},t.createElement(m,{bsStyle:"link"},t.createElement(s.ZP,null,f)))):null))},XyJ0Mvpg:(T,C,e)=>{"use strict";e.d(C,{Z:()=>o});var t=e("Z7aTuO5B"),E=e("rVdVsuGH");const o=(h,s)=>function(m){const d=(0,E.ZP)(s==null?void 0:s.pageSizes);return t.createElement(h,{...m,paginationQueryParameter:d})}},"UXJZ+NkS":(T,C,e)=>{"use strict";e.d(C,{Z:()=>d});var t=e("Z7aTuO5B"),E=e("ii0bleBb"),c=e.n(E),o=e("J6y4/h8P"),h=e("/GOzvPf6");const s=(0,o.default)(h.JO)`
margin-right: 5px;
margin-left: 2px;
`,S=y=>y.includes("darwin")||y.includes("mac os")?{iconName:"apple",iconType:"brand"}:y.includes("linux")?{iconName:"linux",iconType:"brand"}:y.includes("win")?{iconName:"windows",iconType:"brand"}:y.includes("freebsd")?{iconName:"freebsd",iconType:"brand"}:{iconName:"question-circle",iconType:"solid"},m=({operatingSystem:y})=>{const{iconName:l,iconType:P}=S(y.trim().toLowerCase());return t.createElement(s,{name:l,type:P,fixedWidth:!0})};m.propTypes={operatingSystem:c().string},m.defaultProps={operatingSystem:void 0};const d=m},vUZx0iZy:(T,C,e)=>{"use strict";e.d(C,{Z:()=>J});var t=e("Z7aTuO5B"),E=e("ii0bleBb"),c=e.n(E),o=e("/GOzvPf6"),h=e("uZqmR+ju"),s=e("dFpwyWHg"),S=e.n(s),m=e("C2ikvoS0"),d=e.n(m),y=e("1IntWRSu"),l=e.n(y),P=e("8nGWeFnd"),f=e.n(P),p=e("TeAcaicX"),v=e.n(p),i=e("eE3+5goe"),n=e.n(i),a=e("ETE5k4rC"),r={};r.styleTagTransform=n(),r.setAttributes=f(),r.insert=l().bind(null,"head"),r.domAPI=d(),r.insertStyleElement=v();var u=S()(a.Z,r);const R=a.Z&&a.Z.locals?a.Z.locals:void 0,I=t.createElement(h.Popover,{id:"search-query-help",className:R.popoverWide,title:"Search Syntax Help"},t.createElement("p",null,t.createElement("strong",null,"Available search fields")),t.createElement(h.Table,{condensed:!0},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"Field"),t.createElement("th",null,"Description"))),t.createElement("tbody",null,t.createElement("tr",null,t.createElement("td",null,"name"),t.createElement("td",null,"Sidecar name")),t.createElement("tr",null,t.createElement("td",null,"status"),t.createElement("td",null,"Status of the sidecar as it appears in the list, i.e. running, failing, or unknown")),t.createElement("tr",null,t.createElement("td",null,"operating_system"),t.createElement("td",null,"Operating system the sidecar is running on")),t.createElement("tr",null,t.createElement("td",null,"last_seen"),t.createElement("td",null,"Date and time when the sidecar last communicated with Graylog")),t.createElement("tr",null,t.createElement("td",null,"node_id"),t.createElement("td",null,"Identifier of the sidecar")),t.createElement("tr",null,t.createElement("td",null,"sidecar_version"),t.createElement("td",null,"Sidecar version")))),t.createElement("p",null,t.createElement("strong",null,"Examples")),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))),M=t.createElement(o.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:I},t.createElement(h.Button,{bsStyle:"link"},t.createElement(o.JO,{name:"question-circle"}))),U=({query:$,onSearch:N,onReset:G,children:F})=>t.createElement(o.UI,{query:$,onSearch:N,onReset:G,placeholder:"Find sidecars",queryHelpComponent:M,topMargin:0,useLoadingState:!0},F);U.propTypes={query:c().string.isRequired,onSearch:c().func.isRequired,onReset:c().func.isRequired,children:c().element},U.defaultProps={children:void 0};const J=U},tBcsAR17:(T,C,e)=>{"use strict";e.d(C,{Z:()=>S});var t=e("Z7aTuO5B"),E=e("SfPIQIJE"),c=e("d4kzUuQm"),o=e("uZqmR+ju");const h=[{title:"Overview",path:c.ZP.SYSTEM.SIDECARS.OVERVIEW,exactPathMatch:!0},{title:"Administration",path:c.ZP.SYSTEM.SIDECARS.ADMINISTRATION},{title:"Configuration",path:c.ZP.SYSTEM.SIDECARS.CONFIGURATION},{title:"Failure Tracking",path:c.ZP.SYSTEM.SIDECARS.FAILURE_TRACKING}],S=()=>t.createElement(o.Row,null,t.createElement(E.Z,{items:h}))},"nP+JCm88":(T,C,e)=>{"use strict";e.d(C,{Z:()=>G});var t=e("Z7aTuO5B"),E=e("ii0bleBb"),c=e.n(E),o=e("Dg7SLLbb"),h=e.n(o),s=e("uZqmR+ju"),S=e("/GOzvPf6"),m=e("Y7XN0VBN"),d=e("IZYxBTgT"),y=e("O/XpfGnR"),l=e("dFpwyWHg"),P=e.n(l),f=e("C2ikvoS0"),p=e.n(f),v=e("1IntWRSu"),i=e.n(v),n=e("8nGWeFnd"),a=e.n(n),r=e("TeAcaicX"),u=e.n(r),R=e("eE3+5goe"),I=e.n(R),M=e("TsXT+bAI"),U={};U.styleTagTransform=I(),U.setAttributes=a(),U.insert=i().bind(null,"head"),U.domAPI=p(),U.insertStyleElement=u();var J=P()(M.Z,U);const $=M.Z&&M.Z.locals?M.Z.locals:void 0,N=({message:F,status:z,lastSeen:Q,id:Y})=>{const{toUserTimezone:H}=(0,y.Z)();let W=F;const B=h()(m.Z.toString(z)),te=H(Q);let K,x;switch(z){case m.Z.RUNNING:x="text-success",K="play";break;case m.Z.FAILING:x="text-danger",K="exclamation-triangle";break;case m.Z.STOPPED:x="text-danger",K="stop";break;default:x="text-info",K="question-circle",W+=` (${(0,d.Qc)(te)})`}if(W&&Y){const q=t.createElement(s.Popover,{id:`${Y}-status-tooltip`},W);return t.createElement(S.Ox,{placement:"top",overlay:q,rootClose:!0,trigger:"hover"},t.createElement("span",{className:`${x} ${$.indicator}`},t.createElement(S.JO,{name:K,fixedWidth:!0})," ",B))}return t.createElement("span",{className:`${x} ${$.indicator}`},t.createElement(S.JO,{name:K,fixedWidth:!0})," ",B)};N.propTypes={id:c().string,lastSeen:c().string,message:c().string,status:c().number},N.defaultProps={id:"",lastSeen:void 0,message:"",status:-1};const G=N},"92lPlKXC":(T,C,e)=>{"use strict";e.d(C,{Z:()=>v});var t=e("cSDA0Pof"),E=e("lDGobrly");const c=(0,E.Z)({action:t.X.create,success:i=>({message:`User "${i==null?void 0:i.first_name} ${i==null?void 0:i.last_name}" was created successfully`}),error:(i,n)=>({message:`Creating user "${n==null?void 0:n.first_name} ${n==null?void 0:n.last_name}" failed with status: ${i}`})}),o=(0,E.Z)({action:t.X.load,error:(i,n)=>({message:`Loading user with id "${n}" failed with status: ${i}`}),notFoundRedirect:!0}),h=(0,E.Z)({action:t.X.loadByUsername,error:(i,n)=>({message:`Loading user with username "${n}" failed with status: ${i}`}),notFoundRedirect:!0}),s=(0,E.Z)({action:t.X.update,success:(i,n,a)=>({message:`User "${a}" was updated successfully`}),error:(i,n,a,r)=>({message:`Updating user "${r}" failed with status: ${i}`})}),S=(0,E.Z)({action:t.X.delete,success:(i,n)=>({message:`User "${n}" was deleted successfully`}),error:(i,n,a)=>({message:`Deleting user "${a}" failed with status: ${i}`})}),m=(0,E.Z)({action:t.X.changePassword,success:()=>({message:"Password was changed successfully "}),error:(i,n)=>({message:`Changing password for user with id "${n}" failed with status: ${i}`})}),d=(0,E.Z)({action:t.X.createToken,success:(i,n)=>({message:`Token "${n}" created successfully`}),error:(i,n,a)=>({message:`Creating token "${a}" for user with id "${n}" failed with status: ${i}`})}),y=(0,E.Z)({action:t.X.loadTokens,error:(i,n)=>({message:`Loading tokens for user with id "${n}" failed with status: ${i}`})}),l=(0,E.Z)({action:t.X.deleteToken,success:(i,n,a)=>({message:`Token "${a}" deleted successfully`}),error:(i,n,a,r)=>({message:`Deleting token "${r}" for user with id "${n}" failed with status: ${i}`})}),P=(0,E.Z)({action:t.X.loadUsers,error:i=>({message:`Loading users failed with status: ${i}`})}),f=(0,E.Z)({action:t.X.loadUsersPaginated,error:i=>({message:`Loading users failed with status: ${i}`})}),p=(0,E.Z)({action:t.X.setStatus,success:(i,n)=>({message:`User "${i}" was set to ${n}`}),error:(i,n,a)=>({message:`Updating user ("${n}") to ${a} failed with status: ${i}`})}),v={create:c,load:o,loadByUsername:h,update:s,delete:S,changePassword:m,createToken:d,loadTokens:y,deleteToken:l,loadUsers:P,loadUsersPaginated:f,setStatus:p}},Y7XN0VBN:(T,C,e)=>{"use strict";e.d(C,{Z:()=>s});var t=e("PH5VRLCQ"),E=e.n(t),c=e("ueJll2OF"),o=e.n(c);const s={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 m=E()(S);return m===this.properties[this.RUNNING].name?this.RUNNING:m===this.properties[this.FAILING].name?this.FAILING:m===this.properties[this.STOPPED].name?this.STOPPED:this.UNKNOWN},toString(S){switch(o()(S)){case this.RUNNING:return"running";case this.FAILING:return"failing";case this.STOPPED:return"stopped";default:return"unknown"}}}},"nmSm+aR9":(T,C,e)=>{"use strict";e.d(C,{Z:()=>c});var t=e("VPaD/Np4"),E=e.n(t);class c{constructor(s,S,m,d,y,l,P,f,p,v,i,n,a,r,u){this._value={id:s,username:S,fullName:m,email:d,roles:y,readOnly:l,external:P,sessionActive:f,clientAddress:p,lastActivity:v,enabled:i,authServiceId:n,authServiceUid:a,authServiceEnabled:r,accountStatus:u}}get id(){return this._value.id}get username(){return this._value.username}get name(){return this._value.username}get fullName(){return this._value.fullName}get description(){return this._value.fullName}get email(){return this._value.email}get roles(){return this._value.roles}get readOnly(){return this._value.readOnly}get external(){return this._value.external}get sessionActive(){return this._value.sessionActive}get clientAddress(){return this._value.clientAddress}get lastActivity(){return this._value.lastActivity}get enabled(){return this._value.enabled}get authServiceId(){return this._value.authServiceId}get authServiceUid(){return this._value.authServiceUid}get authServiceEnabled(){return this._value.authServiceEnabled}get accountStatus(){return this._value.accountStatus}toBuilder(){const{id:s,username:S,fullName:m,email:d,roles:y,readOnly:l,external:P,sessionActive:f,clientAddress:p,lastActivity:v,enabled:i,authServiceId:n,authServiceUid:a,authServiceEnabled:r,accountStatus:u}=this._value;return new o(t.Map({id:s,username:S,fullName:m,email:d,roles:y,readOnly:l,external:P,sessionActive:f,clientAddress:p,lastActivity:v,enabled:i,authServiceId:n,authServiceUid:a,authServiceEnabled:r,accountStatus:u}))}static create(s,S,m,d,y,l,P,f,p,v,i,n,a,r,u){return new c(s,S,m,d,y,l,P,f,p,v,i,n,a,r,u)}toJSON(){const{id:s,username:S,fullName:m,email:d,roles:y,readOnly:l,external:P,sessionActive:f,clientAddress:p,lastActivity:v,enabled:i,authServiceId:n,authServiceUid:a,authServiceEnabled:r,accountStatus:u}=this._value;return{id:s,username:S,full_name:m,email:d,roles:y.toArray(),read_only:l,external_user:P,session_active:f,client_address:p,last_activity:v,enabled:i,auth_service_id:n,auth_service_uid:a,auth_service_enabled:r,account_status:u}}static fromJSON(s){const{id:S,username:m,full_name:d,email:y,roles:l,read_only:P,external_user:f,session_active:p,client_address:v,last_activity:i,enabled:n,auth_service_id:a,auth_service_uid:r,auth_service_enabled:u,account_status:R}=s;return c.create(S,m,d,y,t.Set(l),P!=null?P:!1,f!=null?f:!1,p!=null?p:!1,v,i,n,a,r,u,R)}static builder(){return new o}}class o{constructor(s=t.Map()){this.value=s}id(s){return new o(this.value.set("id",s))}username(s){return new o(this.value.set("username",s))}fullName(s){return new o(this.value.set("fullName",s))}email(s){return new o(this.value.set("email",s))}roles(s){return new o(this.value.set("roles",s))}readOnly(s){return new o(this.value.set("readOnly",s))}external(s){return new o(this.value.set("external",s))}sessionActive(s){return new o(this.value.set("sessionActive",s))}clientAddress(s){return new o(this.value.set("clientAddress",s))}lastActivity(s){return new o(this.value.set("lastActivity",s))}enabled(s){return new o(this.value.set("enabled",s))}authServiceId(s){return new o(this.value.set("authServiceId",s))}authServiceUid(s){return new o(this.value.set("authServiceUid",s))}authServiceEnabled(s){return new o(this.value.set("authServiceEnabled",s))}accountStatus(s){return new o(this.value.set("accountStatus",s))}build(){const{id:s,username:S,fullName:m,email:d,roles:y,readOnly:l,external:P,sessionActive:f,clientAddress:p,lastActivity:v,enabled:i,authServiceId:n,authServiceUid:a,authServiceEnabled:r,accountStatus:u}=this.value.toObject();return new c(s,S,m,d,y,l,P,f,p,v,i,n,a,r,u)}}},A0QLPFdm:(T,C,e)=>{"use strict";e.r(C),e.d(C,{default:()=>Pe});var t=e("Z7aTuO5B"),E=e("ty2gyrHp"),c=e("uZqmR+ju"),o=e("/GOzvPf6"),h=e("0TVxnHwi"),s=e("q2j1bVbz"),S=e("92lPlKXC"),m=e("ii0bleBb"),d=e.n(m),y=e("D4SbLiE/"),l=e.n(y),P=e("JnTtTRmZ"),f=e.n(P),p=e("XyJ0Mvpg"),v=e("r6oYOZXJ"),i=e("J6y4/h8P"),n=e("vUZx0iZy"),a=e("d4kzUuQm"),r=e("UXJZ+NkS"),u=e("nP+JCm88"),R=e("Y7XN0VBN"),I=e("dFpwyWHg"),M=e.n(I),U=e("C2ikvoS0"),J=e.n(U),$=e("1IntWRSu"),N=e.n($),G=e("8nGWeFnd"),F=e.n(G),z=e("TeAcaicX"),Q=e.n(z),Y=e("eE3+5goe"),H=e.n(Y),W=e("d1DhBDs2"),B={};B.styleTagTransform=H(),B.setAttributes=F(),B.insert=N().bind(null,"head"),B.domAPI=J(),B.insertStyleElement=Q();var te=M()(W.Z,B);const K=W.Z&&W.Z.locals?W.Z.locals:void 0;var x=Object.defineProperty,q=(_,A,g)=>A in _?x(_,A,{enumerable:!0,configurable:!0,writable:!0,value:g}):_[A]=g,ie=(_,A,g)=>(q(_,typeof A!="symbol"?A+"":A,g),g);const le=i.default.tr(({inactive:_,theme:A})=>(0,i.css)`
color: ${_?A.utils.contrastingColor(A.colors.table.background,"AA"):"currentColor"};
opacity: ${_?.9:1};
&:nth-of-type(2n+1) {
color: ${_?A.utils.contrastingColor(A.colors.table.backgroundAlt,"AA"):"currentColor"};
}
td:not(:last-child) {
font-style: ${_?"italic":"normal"};
}
`);class se extends t.Component{constructor(A){super(A),this.state={showRelativeTime:!0}}render(){const{showRelativeTime:A}=this.state,{sidecar:g}=this.props,D=g.active?"":" (inactive)";let O={status:null,message:null,id:null};return g.node_details.status&&R.Z.isValidStatusCode(g.node_details.status.status)&&(O={status:g.node_details.status.status,message:g.node_details.status.message,id:g.node_id}),t.createElement(le,{inactive:!g.active},t.createElement("td",{className:K.sidecarName},t.createElement(E.r,{to:a.ZP.SYSTEM.SIDECARS.STATUS(g.node_id)},g.node_name)),t.createElement("td",null,t.createElement(u.Z,{status:O.status,message:O.message,id:O.id,lastSeen:g.last_seen})),t.createElement("td",null,t.createElement(r.Z,{operatingSystem:g.node_details.operating_system}),"\u2002",g.node_details.operating_system),t.createElement("td",null,A?t.createElement(o.ij,{dateTime:g.last_seen}):t.createElement(o.EK,{dateTime:g.last_seen})),t.createElement("td",null,g.node_id,D),t.createElement("td",null,g.sidecar_version),t.createElement("td",null,t.createElement(c.ButtonToolbar,null,t.createElement(E.J,{to:`${a.ZP.SYSTEM.SIDECARS.ADMINISTRATION}?node_id=${g.node_id}`},t.createElement(c.Button,{bsSize:"xsmall",bsStyle:"info"},"Manage sidecar")),t.createElement(E.J,{to:a.ZP.search_with_query(`gl2_source_collector:${g.node_id}`,"relative",{relative:604800})},t.createElement(c.Button,{bsSize:"xsmall",bsStyle:"info"},"Show messages")))))}}ie(se,"propTypes",{sidecar:d().object.isRequired});const ce=se;var V=e("POojUUcb"),X={};X.styleTagTransform=H(),X.setAttributes=F(),X.insert=N().bind(null,"head"),X.domAPI=J(),X.insertStyleElement=Q();var Ae=M()(V.Z,X);const b=V.Z&&V.Z.locals?V.Z.locals:void 0;var de=Object.defineProperty,ue=(_,A,g)=>A in _?de(_,A,{enumerable:!0,configurable:!0,writable:!0,value:g}):_[A]=g,w=(_,A,g)=>(ue(_,typeof A!="symbol"?A+"":A,g),g);const me=(0,i.default)(o.fz)`
&& {
width: 12px;
margin-left: 5px;
line-height: 1;
}
`,ne=[10,25,50,100];class ae extends t.Component{constructor(){super(...arguments),w(this,"formatSidecarList",A=>{const{onSortChange:g,sort:D}=this.props,O={node_name:"Name","node_details.status.status":"Status","node_details.operating_system":"Operating System",last_seen:"Last Seen",node_id:"Node Id",sidecar_version:"Sidecar Version"};return t.createElement(c.Table,{striped:!0,responsive:!0,className:b.sidecarList},t.createElement("thead",null,t.createElement("tr",null,Object.keys(O).map(Z=>t.createElement("th",{key:Z},O[Z],t.createElement(me,{activeDirection:D.field===Z?D.order:null,onChange:g(Z),ascId:"asc",descId:"desc"}))),t.createElement("th",{className:b.actions},"\xA0"))),t.createElement("tbody",null,A))}),w(this,"formatNoMatchingListAlert",()=>{const{onlyActive:A}=this.props,g=A?' and/or click on "Include inactive sidecars"':null;return t.createElement(o.pJ,null,t.createElement(o.JO,{name:"info-circle"}),"\xA0There are no sidecars matching the search criteria. Try adjusting your search filter",g,".")}),w(this,"renderEmptyList",()=>{const{query:A}=this.props;return A?this.formatNoMatchingListAlert():t.createElement(o.dX,null,"There are no sidecars configured.")})}render(){const{sidecars:A,onlyActive:g,pagination:D,query:O,onQueryChange:Z,onPageChange:re,toggleShowInactive:L}=this.props,j=A.map(oe=>t.createElement(ce,{key:oe.node_id,sidecar:oe})),ee=g?"Include":"Hide",k=j.length>0?this.formatSidecarList(j):this.renderEmptyList();return t.createElement("div",null,t.createElement("div",{className:b.sidecarsFilter},t.createElement(n.Z,{query:O,onSearch:Z,onReset:Z},t.createElement(c.Button,{bsStyle:"primary",onClick:L,className:b.inactiveSidecarsButton},ee," inactive sidecars"))),t.createElement(o.l9,{pageSizes:ne,totalItems:D.total,onChange:re},t.createElement(c.Row,null,t.createElement(c.Col,{md:12},k))))}}w(ae,"propTypes",{sidecars:d().array.isRequired,onlyActive:d().bool.isRequired,pagination:d().object.isRequired,query:d().string.isRequired,sort:d().object.isRequired,onPageChange:d().func.isRequired,onQueryChange:d().func.isRequired,onSortChange:d().func.isRequired,toggleShowInactive:d().func.isRequired});const Ee=ae,ve=l()({propTypes:{paginationQueryParameter:d().object.isRequired},mixins:[f().connect(v.b)],componentDidMount(){this._reloadSidecars({}),this.interval=setInterval(()=>this._reloadSidecars({}),this.SIDECAR_DATA_REFRESH)},componentWillUnmount(){this.interval&&clearInterval(this.interval)},handleSortChange(_){return()=>{this._reloadSidecars({sortField:_,order:this.state.sort.field===_&&this.state.sort.order==="asc"?"desc":"asc"})}},handlePageChange(_,A){this._reloadSidecars({page:_,pageSize:A})},handleQueryChange(_="",A=()=>{}){const{resetPage:g}=this.props.paginationQueryParameter;g(),this._reloadSidecars({query:_}).finally(A)},toggleShowInactive(){const{resetPage:_}=this.props.paginationQueryParameter;_(),this._reloadSidecars({onlyActive:!this.state.onlyActive})},_reloadSidecars({query:_,page:A,pageSize:g,onlyActive:D,sortField:O,order:Z}){const L={query:_===void 0?this.state.query:_,onlyActive:"true"};this.state.sort&&(L.sortField=O||this.state.sort.field,L.order=Z||this.state.sort.order);const{paginationQueryParameter:j}=this.props;L.pageSize=g||j.pageSize,L.onlyActive=D===void 0?this.state.onlyActive:D;const ee=L.pageSize===j.pageSize&&L.onlyActive===this.state.onlyActive&&L.query===this.state.query;let k=1;return ee&&(k=A||j.page),L.page=k,v.V.listPaginated(L)},SIDECAR_DATA_REFRESH:5*1e3,render(){const{sidecars:_,onlyActive:A,pagination:g,query:D,sort:O}=this.state;return _?t.createElement(Ee,{sidecars:_,onlyActive:A,pagination:g,query:D,sort:O,onPageChange:this.handlePageChange,onQueryChange:this.handleQueryChange,onSortChange:this.handleSortChange,toggleShowInactive:this.toggleShowInactive}):t.createElement(o.$j,null)}}),ge=(0,p.Z)(ve,{pageSizes:ne});var he=e("E+CaPsQD"),Se=e("tBcsAR17");const Pe=()=>{const[_,A]=(0,t.useState)(),g=(0,s.Z)(),D=(0,h.rq)(g==null?void 0:g.permissions,["users:tokenlist:graylog-sidecar"]);return(0,t.useEffect)(()=>{D&&S.Z.loadByUsername("graylog-sidecar").then(O=>A(O))},[D]),t.createElement(o.$4,{title:"Sidecars"},t.createElement(Se.Z,null),t.createElement(o.mr,{title:"Sidecars Overview",documentationLink:{title:"Sidecar documentation",path:he.Z.PAGES.COLLECTOR_SIDECAR}},t.createElement("span",null,"The Graylog sidecars can reliably forward contents of log files or Windows EventLog from your servers.",D&&(_?t.createElement("span",null,t.createElement("br",null),"Do you need an API token for a sidecar?\u2002",t.createElement(E.r,{to:a.ZP.SYSTEM.USERS.TOKENS.edit(_.id)},"Create or reuse a token for the ",t.createElement("em",null,"graylog-sidecar")," user")):t.createElement(o.$j,null)))),t.createElement(c.Row,{className:"content"},t.createElement(c.Col,{md:12},t.createElement(ge,null))))}},r6oYOZXJ:(T,C,e)=>{"use strict";e.d(C,{V:()=>d,b:()=>y});var t=e("JnTtTRmZ"),E=e.n(t),c=e("oCSEoDew"),o=e.n(c),h=e("MdYBRjRJ"),s=e("jAGDuYSC"),S=e("eFxcQyPT"),m=e("IA3Ku5lS");const d=(0,m.ei)("core.Sidecars",()=>E().createActions({listPaginated:{asyncResult:!0},getSidecar:{asyncResult:!0},getSidecarActions:{asyncResult:!0},restartCollector:{asyncResult:!0},assignConfigurations:{asyncResult:!0}})),y=(0,m.dS)("core.Sidecars",()=>E().createStore({listenables:[d],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:l="",page:P=1,pageSize:f=50,onlyActive:p=!1,sortField:v="node_name",order:i="asc"}){const n={query:l,page:P,per_page:f,only_active:p,sort:v,order:i},a=o()(this.sourceUrl).search(n).toString(),r=(0,S.vl)("GET",h.DC(a));r.then(u=>(this.sidecars=u.sidecars,this.query=u.query,this.onlyActive=u.only_active,this.pagination={total:u.pagination.total,count:u.pagination.count,page:u.pagination.page,pageSize:u.pagination.per_page},this.sort={field:u.sort,order:u.order},this.propagateChanges(),u),u=>{s.Z.error(u.status===400?u.responseMessage:`Fetching Sidecars failed with status: ${u.message}`,"Could not retrieve Sidecars")}),d.listPaginated.promise(r)},getSidecar(l){const P=(0,S.vl)("GET",h.DC(`${this.sourceUrl}/${l}`));P.catch(f=>{let p=`Fetching Sidecar failed with status: ${f}`;f.status===404&&(p=`Unable to find a sidecar with ID <${l}>, maybe it was inactive for too long.`),s.Z.error(p,"Could not retrieve Sidecar")}),d.getSidecar.promise(P)},restartCollector(l,P){const f={};f.collector=P,f.properties={},f.properties.restart=!0;const p=(0,S.ZP)("PUT",h.DC(`${this.sourceUrl}/${l}/action`),[f]);p.catch(v=>{s.Z.error(`Restarting Sidecar failed with status: ${v}`,"Could not restart Sidecar")}),d.restartCollector.promise(p)},getSidecarActions(l){const P=(0,S.vl)("GET",h.DC(`${this.sourceUrl}/${l}/action`));P.catch(f=>{s.Z.error(`Fetching Sidecar actions failed with status: ${f}`,"Could not retrieve Sidecar actions")}),d.getSidecarActions.promise(P)},toConfigurationAssignmentDto(l,P,f){return{node_id:l,collector_id:P,configuration_id:f}},assignConfigurations(l,P){const f=l.map(({sidecar:v,collector:i})=>{const n=v.assignments.filter(a=>a.collector_id!==i.id);return P.forEach(a=>{n.push({collector_id:i.id,configuration_id:a.id})}),{node_id:v.node_id,assignments:n}}),p=(0,S.ZP)("PUT",h.DC(`${this.sourceUrl}/configurations`),{nodes:f});p.then(v=>(s.Z.success("",`Configuration change for ${l.length} collectors requested`),v),v=>{s.Z.error(`Fetching Sidecar actions failed with status: ${v}`,"Could not retrieve Sidecar actions")}),d.assignConfigurations.promise(p)}}))},cSDA0Pof:(T,C,e)=>{"use strict";e.d(C,{X:()=>v});var t=e("JnTtTRmZ"),E=e.n(t),c=e("VPaD/Np4"),o=e.n(c),h=e("oCSEoDew"),s=e.n(h),S=e("nmSm+aR9"),m=e("eFxcQyPT"),d=e("U1Iufsob"),y=e("IA3Ku5lS"),l=e("MdYBRjRJ"),P=e("gyRmhZSW"),f=e("vMorKP/N");const p=({url:n="",query:a={}})=>{const r=new(s())(n);return r.query(a),(0,l.DC)(r.resource())},v=(0,y.ei)("core.Users",()=>E().createActions({create:{asyncResult:!0},load:{asyncResult:!0},loadByUsername:{asyncResult:!0},update:{asyncResult:!0},delete:{asyncResult:!0},changePassword:{asyncResult:!0},createToken:{asyncResult:!0},loadTokens:{asyncResult:!0},deleteToken:{asyncResult:!0},loadUsersPaginated:{asyncResult:!0},loadUsers:{asyncResult:!0},setStatus:{asyncResult:!0}})),i=(0,y.dS)("core.Users",()=>E().createStore({listenables:[v],create(n){const a=(0,l.DC)(d.Z.UsersApiController.create().url),r=(0,m.ZP)("POST",a,n);return v.create.promise(r),r},load(n){const a=(0,l.DC)(d.Z.UsersApiController.load(encodeURIComponent(n)).url),r=(0,m.ZP)("GET",a).then(f.Z.fromJSON);return v.load.promise(r),r},loadByUsername(n){const a=(0,l.DC)(d.Z.UsersApiController.loadByUsername(encodeURIComponent(n)).url),r=(0,m.ZP)("GET",a).then(f.Z.fromJSON);return v.loadByUsername.promise(r),r},update(n,a){const r=(0,l.DC)(d.Z.UsersApiController.update(encodeURIComponent(n)).url),u=(0,m.ZP)("PUT",r,a);return v.update.promise(u),u},delete(n){const a=(0,l.DC)(d.Z.UsersApiController.delete(encodeURIComponent(n)).url),r=(0,m.ZP)("DELETE",a);return v.delete.promise(r),r},changePassword(n,a){const r=(0,l.DC)(d.Z.UsersApiController.changePassword(encodeURIComponent(n)).url),u=(0,m.ZP)("PUT",r,a);return v.changePassword.promise(u),u},createToken(n,a){const r=(0,l.DC)(d.Z.UsersApiController.create_token(encodeURIComponent(n),encodeURIComponent(a)).url),u=(0,m.ZP)("POST",r);return v.createToken.promise(u),u},loadTokens(n){const a=(0,l.DC)(d.Z.UsersApiController.list_tokens(encodeURIComponent(n)).url),r=(0,m.ZP)("GET",a).then(u=>u.tokens);return v.loadTokens.promise(r),r},deleteToken(n,a){const r=(0,l.DC)(d.Z.UsersApiController.delete_token(encodeURIComponent(n),encodeURIComponent(a)).url),u=(0,m.ZP)("DELETE",r);return v.deleteToken.promise(u),u},loadUsers(n={}){const a=p({url:d.Z.UsersApiController.list().url,query:n}),r=(0,m.ZP)("GET",a).then(({users:u})=>c.List(u.map(R=>S.Z.fromJSON(R))));return v.loadUsers.promise(r),r},loadUsersPaginated({page:n,perPage:a,query:r}){const u=(0,P.Z)(d.Z.UsersApiController.paginated().url,n,a,r),R=(0,m.ZP)("GET",(0,l.DC)(u)).then(I=>({adminUser:I.context.admin_user?S.Z.fromJSON(I.context.admin_user):void 0,list:c.List(I.users.map(M=>S.Z.fromJSON(M))),pagination:{page:I.page,perPage:I.per_page,query:I.query,count:I.count,total:I.total}}));return v.loadUsersPaginated.promise(R),R},setStatus(n,a){const r=(0,l.DC)(d.Z.UsersApiController.setStatus(n,a).url),u=(0,m.ZP)("PUT",r);return v.setStatus.promise(u),u}}))},PH5VRLCQ:(T,C,e)=>{var t=e("R+B8SaP1"),E=t(function(c,o,h){return c+(h?" ":"")+o.toLowerCase()});T.exports=E}}]);})();
//# sourceMappingURL=07ba022f-8579.38586df959b2a9d16148.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy