web-interface.assets.1255d548-5912.39fbec2fb46ad33fb816.js Maven / Gradle / Ivy
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-5912"],{"lxV/WNDc":(S,C,e)=>{"use strict";e.d(C,{Z:()=>_});var u=e("pmX897Fv"),n=e.n(u),t=e("DjJvgDaP"),i=e.n(t),d=i()(n());d.push([S.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:""}]),d.locals={deflist:"zL2vwyqmPLuE_eSRQt1q",topMargin:"m4So8k7QXl39uuSoP2WS",greyedOut:"Bfhoisypey7je2baSbGs"};const _=d},SfPIQIJE:(S,C,e)=>{"use strict";e.d(C,{Z:()=>D});var u=e("Z7aTuO5B"),n=e("J6y4/h8P"),t=e("uZqmR+ju"),i=e("ty2gyrHp"),d=e("/GOzvPf6"),_=e("NV1/EHMi");const c=(0,n.default)(t.ButtonToolbar)`
margin-bottom: 10px;
`,v=(0,n.default)(t.Button)(({theme:r})=>(0,n.css)`
font-family: ${r.fonts.family.navigation};
font-size: ${r.fonts.size.navigation};
&&&& {
color: ${r.colors.variant.darker.default};
&:hover,
&:focus {
text-decoration: none;
}
> div {
&:hover,
&:focus {
color: ${r.colors.variant.darker.default};
}
}
&:hover {
${(0,_.RF)(r)}
}
&.active {
color: ${r.colors.global.textDefault};
${(0,_.A7)(r)}
&:hover,
&:focus {
${(0,_.A7)(r)}
}
}
}
`);v.displayName="Button";const D=({items:r})=>u.createElement(c,null,r.map(({path:g,title:o,permissions:a,exactPathMatch:l})=>g?u.createElement(d.AE,{permissions:a!=null?a:[],key:g},u.createElement(i.J,{to:g,relativeActive:!l},u.createElement(v,{bsStyle:"link"},u.createElement(_.ZP,null,o)))):null))},tBcsAR17:(S,C,e)=>{"use strict";e.d(C,{Z:()=>c});var u=e("Z7aTuO5B"),n=e("SfPIQIJE"),t=e("d4kzUuQm"),i=e("uZqmR+ju");const d=[{title:"Overview",path:t.ZP.SYSTEM.SIDECARS.OVERVIEW,exactPathMatch:!0},{title:"Administration",path:t.ZP.SYSTEM.SIDECARS.ADMINISTRATION},{title:"Configuration",path:t.ZP.SYSTEM.SIDECARS.CONFIGURATION},{title:"Failure Tracking",path:t.ZP.SYSTEM.SIDECARS.FAILURE_TRACKING}],c=()=>u.createElement(i.Row,null,u.createElement(n.Z,{items:d}))},GIeTfzK9:(S,C,e)=>{"use strict";e.d(C,{Z:()=>h});var u=e("ii0bleBb"),n=e.n(u),t=e("Z7aTuO5B"),i=e("J6y4/h8P"),d=e("uZqmR+ju"),_=e("gqVHlIxA");const c=i.default.div`
word-break: break-all;
overflow-wrap: break-word;
white-space: pre-wrap;
max-height: 500px;
`,v=({showModal:D,onHide:r,collectorName:g,collectorVerbose:o})=>t.createElement(_.Z,{showModal:D,onHide:r,bsSize:"large"},t.createElement(d.Modal.Header,{closeButton:!0},t.createElement(d.Modal.Title,null,t.createElement("span",null,"Error Details for ",t.createElement("em",null,g)))),t.createElement(d.Modal.Body,null,t.createElement("pre",null,t.createElement(c,null,o||""))),t.createElement(d.Modal.Footer,null,t.createElement(d.Button,{type:"button",onClick:r},"Close")));v.propTypes={showModal:n().bool.isRequired,onHide:n().func.isRequired,collectorName:n().string.isRequired,collectorVerbose:n().string.isRequired};const h=v},Y7XN0VBN:(S,C,e)=>{"use strict";e.d(C,{Z:()=>_});var u=e("PH5VRLCQ"),n=e.n(u),t=e("ueJll2OF"),i=e.n(t);const _={RUNNING:0,UNKNOWN:1,FAILING:2,STOPPED:3,properties:{0:{name:"running"},1:{name:"unknown"},2:{name:"failing"},3:{name:"stopped"}},isValidStatusCode(c){return Object.keys(this.properties).includes(String(c))},toStatusCode(c){const v=n()(c);return v===this.properties[this.RUNNING].name?this.RUNNING:v===this.properties[this.FAILING].name?this.FAILING:v===this.properties[this.STOPPED].name?this.STOPPED:this.UNKNOWN},toString(c){switch(i()(c)){case this.RUNNING:return"running";case this.FAILING:return"failing";case this.STOPPED:return"stopped";default:return"unknown"}}}},"qgOA+rtT":(S,C,e)=>{"use strict";e.r(C),e.d(C,{default:()=>z});var u=e("ii0bleBb"),n=e.n(u),t=e("Z7aTuO5B"),i=e("/GOzvPf6"),d=e("E+CaPsQD"),_=e("d4kzUuQm"),c=e("D4SbLiE/"),v=e.n(c),h=e("WgCNywL/"),D=e.n(h),r=e("P5NcJT2c"),g=e.n(r),o=e("uZqmR+ju"),a=e("Y7XN0VBN"),l=e("kZOSo4r4"),m=Object.defineProperty,f=(E,s,P)=>s in E?m(E,s,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[s]=P,A=(E,s,P)=>(f(E,typeof s!="symbol"?s+"":s,P),P);class R extends t.Component{constructor(){super(...arguments),A(this,"_headerCellFormatter",s=>t.createElement("th",null,s)),A(this,"_activityFormatter",s=>{const P=new Date().getTime();return new Date(s).getTime()>P-6e4?"info":""}),A(this,"_dirFormatter",s=>s.is_dir?t.createElement("span",null,t.createElement(i.JO,{name:"folder-open"}),"\xA0\xA0",s.path):t.createElement("span",null,t.createElement(i.JO,{name:"file",type:"regular"}),"\xA0\xA0",s.path)),A(this,"_fileListFormatter",s=>t.createElement("tr",{key:s.path,className:this._activityFormatter(s.mod_time)},t.createElement("td",{className:"limited"},t.createElement(i.EK,{dateTime:s.mod_time})),t.createElement("td",{className:"limited"},s.size),t.createElement("td",null,this._dirFormatter(s))))}render(){const s=[],P=["Modified","Size","Path"];return t.createElement("div",null,t.createElement(i.wQ,{id:"log-file-list",className:"table-hover",headers:P,headerCellFormatter:this._headerCellFormatter,rows:this.props.files,dataRowFormatter:this._fileListFormatter,filterLabel:"Filter Files",filterKeys:s}))}}A(R,"propTypes",{files:n().array.isRequired});const p=R;var N=e("GIeTfzK9");const Z=v()({propTypes:{sidecar:n().object.isRequired,collectors:n().array.isRequired},getInitialState(){return{collectorName:"",collectorVerbose:"",showVerboseModal:!1}},formatNodeDetails(E){if(!E)return t.createElement("p",null,"Node details are currently unavailable. Please wait a moment and ensure the sidecar is correctly connected to the server.");const s=E.metrics||{};return t.createElement("dl",{className:`${l.Z.deflist} ${l.Z.topMargin}`},t.createElement("dt",null,"IP Address"),t.createElement("dd",null,D()(E.ip,"Not available")),t.createElement("dt",null,"Operating System"),t.createElement("dd",null,D()(E.operating_system,"Not available")),t.createElement("dt",null,"CPU Idle"),t.createElement("dd",null,g()(s.cpu_idle)?`${s.cpu_idle}%`:"Not available"),t.createElement("dt",null,"Load"),t.createElement("dd",null,D()(s.load_1,"Not available")),t.createElement("dt",null,"Volumes > 75% full"),s.disks_75===void 0?t.createElement("dd",null,"Not available"):t.createElement("dd",null,s.disks_75.length>0?s.disks_75.join(", "):"None"))},formatCollectorStatus(E,s){if(!E||!s)return t.createElement("p",null,"Collectors status are currently unavailable. Please wait a moment and ensure the sidecar is correctly connected to the server.");if(!E.status)return t.createElement("p",null,"Did not receive collectors status, set the option ",t.createElement("code",null,"send_status: true")," in the sidecar configuration to see this information.");const P=E.status.collectors;if(P.length===0)return t.createElement("p",null,"There are no collectors configured in this sidecar.");const O=[];return P.forEach(M=>{const y=s.find(b=>b.id===M.collector_id);let I,U,T,W;switch(M.status){case a.Z.RUNNING:I="Collector is running.",T="text-success",U=t.createElement(i.JO,{name:"play",fixedWidth:!0});break;case a.Z.FAILING:I=M.message,T="text-danger",U=t.createElement(i.JO,{name:"exclamation-triangle",fixedWidth:!0}),M.verbose_message&&(W=t.createElement(o.Button,{bsStyle:"link",bsSize:"xs",onClick:()=>this._onShowVerbose(y.name,M.verbose_message)},"Show Details"));break;case a.Z.STOPPED:I=M.message,T="text-danger",U=t.createElement(i.JO,{name:"stop",fixedWidth:!0});break;default:I="Collector status is currently unknown.",T="text-info",U=t.createElement(i.JO,{name:"question-circle",fixedWidth:!0})}y&&O.push(t.createElement("dt",{key:`${y.id}-key`,className:T},y.name),t.createElement("dd",{key:`${y.id}-description`,className:T},U,"\u2002",I,"\u2002",W))}),t.createElement("dl",{className:l.Z.deflist},O)},_onShowVerbose(E,s){this.setState({collectorName:E,collectorVerbose:s,showVerboseModal:!0})},_onHideVerbose(){this.setState({showVerboseModal:!1})},render(){const{sidecar:E}=this.props,s=E.node_details.log_file_list||[];return t.createElement("div",null,t.createElement(o.Row,{className:"content"},t.createElement(o.Col,{md:12},t.createElement("h2",null,"Node details"),this.formatNodeDetails(E.node_details))),t.createElement(o.Row,{className:"content"},t.createElement(o.Col,{md:12},t.createElement("h2",null,"Collectors status"),t.createElement("div",{className:l.Z.topMargin},this.formatCollectorStatus(E.node_details,this.props.collectors)))),t.createElement(o.Row,{className:"content",hidden:s.length===0},t.createElement(o.Col,{md:12},t.createElement("h2",null,"Log Files"),t.createElement("p",{className:l.Z.topMargin},"Recently modified files will be highlighted in blue."),t.createElement("div",null,t.createElement(p,{files:s})))),t.createElement(N.Z,{showModal:this.state.showVerboseModal,onHide:this._onHideVerbose,collectorName:this.state.collectorName,collectorVerbose:this.state.collectorVerbose}))}});var K=e("c9JM82dZ"),$=e("kHvj/lAD"),F=e("r6oYOZXJ"),x=e("tBcsAR17"),j=e("N6x7vnl1"),V=Object.defineProperty,G=(E,s,P)=>s in E?V(E,s,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[s]=P,B=(E,s,P)=>(G(E,typeof s!="symbol"?s+"":s,P),P);class L extends t.Component{constructor(s){super(s),B(this,"reloadSidecar",P=>{F.V.getSidecar(this.props.params.sidecarId).then(O=>this.setState({sidecar:O}),O=>{O.status===404&&P.push(_.ZP.SYSTEM.SIDECARS.OVERVIEW)})}),B(this,"reloadCollectors",()=>{$.v.all().then(P=>this.setState({collectors:P.collectors}))}),this.state={sidecar:void 0}}componentDidMount(){const s=()=>this.reloadSidecar(this.props.history);s(),this.reloadCollectors(),this.interval=setInterval(s,5e3)}componentWillUnmount(){this.interval&&clearInterval(this.interval)}render(){const{sidecar:s}=this.state,{collectors:P}=this.state;return!s||!P?t.createElement(i.$4,{title:"Sidecar status"},t.createElement(i.$j,null)):t.createElement(i.$4,{title:`Sidecar ${s.node_name} status`},t.createElement(x.Z,null),t.createElement(i.mr,{title:t.createElement("span",null,"Sidecar ",t.createElement("em",null,s.node_name," status")),documentationLink:{title:"Sidecars documentation",path:d.Z.PAGES.COLLECTOR_STATUS}},t.createElement("span",null,"A status overview of the Graylog Sidecar.")),t.createElement(Z,{sidecar:s,collectors:P}))}}B(L,"propTypes",{params:n().object.isRequired,history:n().object.isRequired});const z=(0,j.Z)((0,K.Z)(L))},N6x7vnl1:(S,C,e)=>{"use strict";e.d(C,{Z:()=>i});var u=e("Z7aTuO5B"),n=e("/7OuCFNo");const i=d=>_=>{const c=(0,n.Z)();return u.createElement(d,{..._,history:c})}},c9JM82dZ:(S,C,e)=>{"use strict";e.d(C,{Z:()=>i});var u=e("Z7aTuO5B"),n=e("yAXMqwrl");const i=d=>_=>{const c=(0,n.useParams)();return u.createElement(d,{..._,params:c})}},"kHvj/lAD":(S,C,e)=>{"use strict";e.d(C,{d:()=>g,v:()=>r});var u=e("JnTtTRmZ"),n=e.n(u),t=e("oCSEoDew"),i=e.n(t),d=e("wXrUUKFq"),_=e.n(d),c=e("MdYBRjRJ"),v=e("eFxcQyPT"),h=e("jAGDuYSC"),D=e("IA3Ku5lS");const r=(0,D.ei)("core.Collectors",()=>n().createActions({getCollector:{asyncResult:!0},all:{asyncResult:!0},list:{asyncResult:!0},create:{asyncResult:!0},update:{asyncResult:!0},delete:{asyncResult:!0},copy:{asyncResult:!0},validate:{asyncResult:!0}})),g=(0,D.dS)("core.Collectors",()=>n().createStore({listenables:[r],sourceUrl:"/sidecar",collectors:void 0,query:void 0,pagination:{page:void 0,pageSize:void 0,total:void 0},total:void 0,paginatedCollectors:void 0,getInitialState(){return{collectors:this.collectors}},propagateChanges(){this.trigger({collectors:this.collectors,paginatedCollectors:this.paginatedCollectors,query:this.query,total:this.total,pagination:this.pagination})},getCollector(o){const a=(0,v.ZP)("GET",c.DC(`${this.sourceUrl}/collectors/${o}`));a.catch(l=>{let m=`Fetching Collector failed with status: ${l}`;l.status===404&&(m=`Unable to find a collector with ID <${o}>, please ensure it was not deleted.`),h.Z.error(m,"Could not retrieve Collector")}),r.getCollector.promise(a)},_fetchCollectors({query:o,page:a,pageSize:l}){const m={query:o,page:a,per_page:l},f=i()(`${this.sourceUrl}/collectors/summary`).search(m).toString();return(0,v.ZP)("GET",c.DC(f))},all(){const o=this._fetchCollectors({pageSize:0});o.then(a=>(this.collectors=a.collectors,this.propagateChanges(),a.collectors),a=>{h.Z.error(`Fetching collectors failed with status: ${a}`,"Could not retrieve collectors")}),r.all.promise(o)},list({query:o="",page:a=1,pageSize:l=10}){const m=this._fetchCollectors({query:o,page:a,pageSize:l});m.then(f=>(this.query=f.query,this.pagination={page:f.pagination.page,pageSize:f.pagination.per_page,total:f.pagination.total},this.total=f.total,this.paginatedCollectors=f.collectors,this.propagateChanges(),f.collectors),f=>{h.Z.error(`Fetching collectors failed with status: ${f}`,"Could not retrieve collectors")}),r.list.promise(m)},refreshList(){this.list({query:this.query,page:this.pagination.page,pageSize:this.pagination.pageSize})},create(o){const a=(0,v.ZP)("POST",c.DC(`${this.sourceUrl}/collectors`),o);a.then(l=>(h.Z.success("","Collector successfully created"),this.collectors=l.collectors,this.propagateChanges(),this.collectors),l=>{h.Z.error(`Fetching collectors failed with status: ${l}`,"Could not retrieve collectors")}),r.create.promise(a)},update(o){const a=(0,v.ZP)("PUT",c.DC(`${this.sourceUrl}/collectors/${o.id}`),o);a.then(l=>(h.Z.success("","Collector successfully updated"),this.collectors=l.collectors,this.propagateChanges(),this.collectors),l=>{h.Z.error(`Fetching collectors failed with status: ${l}`,"Could not retrieve collectors")}),r.update.promise(a)},delete(o){const a=c.DC(`${this.sourceUrl}/collectors/${o.id}`),l=(0,v.ZP)("DELETE",a);l.then(m=>(h.Z.success("",`Collector "${o.name}" successfully deleted`),this.refreshList(),m),m=>{h.Z.error(`Deleting Collector failed: ${m.status===400?m.responseMessage:m.message}`,`Could not delete Collector "${o.name}"`)}),r.delete.promise(l)},copy(o,a){const l=c.DC(`${this.sourceUrl}/collectors/${o}/${a}`),m="POST",f=(0,v.ZP)(m,l);f.then(A=>(h.Z.success("",`Collector "${a}" successfully copied`),this.refreshList(),A),A=>{h.Z.error(`Saving collector "${a}" failed with status: ${A.message}`,"Could not save Collector")}),r.copy.promise(f)},validate(o){const a={id:" ",service_type:"exec",executable_path:" ",default_template:" "};_()(a,o);const l=(0,v.ZP)("POST",c.DC(`${this.sourceUrl}/collectors/validate`),a);l.then(m=>m,m=>h.Z.error(`Validating collector "${a.name}" failed with status: ${m.message}`,"Could not validate collector")),r.validate.promise(l)}}))},r6oYOZXJ:(S,C,e)=>{"use strict";e.d(C,{V:()=>h,b:()=>D});var u=e("JnTtTRmZ"),n=e.n(u),t=e("oCSEoDew"),i=e.n(t),d=e("MdYBRjRJ"),_=e("jAGDuYSC"),c=e("eFxcQyPT"),v=e("IA3Ku5lS");const h=(0,v.ei)("core.Sidecars",()=>n().createActions({listPaginated:{asyncResult:!0},getSidecar:{asyncResult:!0},getSidecarActions:{asyncResult:!0},restartCollector:{asyncResult:!0},assignConfigurations:{asyncResult:!0}})),D=(0,v.dS)("core.Sidecars",()=>n().createStore({listenables:[h],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:r="",page:g=1,pageSize:o=50,onlyActive:a=!1,sortField:l="node_name",order:m="asc"}){const f={query:r,page:g,per_page:o,only_active:a,sort:l,order:m},A=i()(this.sourceUrl).search(f).toString(),R=(0,c.vl)("GET",d.DC(A));R.then(p=>(this.sidecars=p.sidecars,this.query=p.query,this.onlyActive=p.only_active,this.pagination={total:p.pagination.total,count:p.pagination.count,page:p.pagination.page,pageSize:p.pagination.per_page},this.sort={field:p.sort,order:p.order},this.propagateChanges(),p),p=>{_.Z.error(p.status===400?p.responseMessage:`Fetching Sidecars failed with status: ${p.message}`,"Could not retrieve Sidecars")}),h.listPaginated.promise(R)},getSidecar(r){const g=(0,c.vl)("GET",d.DC(`${this.sourceUrl}/${r}`));g.catch(o=>{let a=`Fetching Sidecar failed with status: ${o}`;o.status===404&&(a=`Unable to find a sidecar with ID <${r}>, maybe it was inactive for too long.`),_.Z.error(a,"Could not retrieve Sidecar")}),h.getSidecar.promise(g)},restartCollector(r,g){const o={};o.collector=g,o.properties={},o.properties.restart=!0;const a=(0,c.ZP)("PUT",d.DC(`${this.sourceUrl}/${r}/action`),[o]);a.catch(l=>{_.Z.error(`Restarting Sidecar failed with status: ${l}`,"Could not restart Sidecar")}),h.restartCollector.promise(a)},getSidecarActions(r){const g=(0,c.vl)("GET",d.DC(`${this.sourceUrl}/${r}/action`));g.catch(o=>{_.Z.error(`Fetching Sidecar actions failed with status: ${o}`,"Could not retrieve Sidecar actions")}),h.getSidecarActions.promise(g)},toConfigurationAssignmentDto(r,g,o){return{node_id:r,collector_id:g,configuration_id:o}},assignConfigurations(r,g){const o=r.map(({sidecar:l,collector:m})=>{const f=l.assignments.filter(A=>A.collector_id!==m.id);return g.forEach(A=>{f.push({collector_id:m.id,configuration_id:A.id})}),{node_id:l.node_id,assignments:f}}),a=(0,c.ZP)("PUT",d.DC(`${this.sourceUrl}/configurations`),{nodes:o});a.then(l=>(_.Z.success("",`Configuration change for ${r.length} collectors requested`),l),l=>{_.Z.error(`Fetching Sidecar actions failed with status: ${l}`,"Could not retrieve Sidecar actions")}),h.assignConfigurations.promise(a)}}))},PH5VRLCQ:(S,C,e)=>{var u=e("R+B8SaP1"),n=u(function(t,i,d){return t+(d?" ":"")+i.toLowerCase()});S.exports=n},kZOSo4r4:(S,C,e)=>{"use strict";e.d(C,{Z:()=>m});var u=e("dFpwyWHg"),n=e.n(u),t=e("C2ikvoS0"),i=e.n(t),d=e("1IntWRSu"),_=e.n(d),c=e("8nGWeFnd"),v=e.n(c),h=e("TeAcaicX"),D=e.n(h),r=e("eE3+5goe"),g=e.n(r),o=e("lxV/WNDc"),a={};a.styleTagTransform=g(),a.setAttributes=v(),a.insert=_().bind(null,"head"),a.domAPI=i(),a.insertStyleElement=D();var l=n()(o.Z,a);const m=o.Z&&o.Z.locals?o.Z.locals:void 0}}]);})();
//# sourceMappingURL=1255d548-5912.39fbec2fb46ad33fb816.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy