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

web-interface.assets.1255d548-4594.d318652867b40b12817c.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-4594"],{ETE5k4rC:(O,f,t)=>{"use strict";t.d(f,{Z:()=>g});var e=t("pmX897Fv"),l=t.n(e),a=t("DjJvgDaP"),h=t.n(a),i=h()(l());i.push([O.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:""}]),i.locals={popoverWide:"i3CKk4UXmnkyBYYZ5r2x"};const g=i},"TsXT+bAI":(O,f,t)=>{"use strict";t.d(f,{Z:()=>g});var e=t("pmX897Fv"),l=t.n(e),a=t("DjJvgDaP"),h=t.n(a),i=h()(l());i.push([O.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:""}]),i.locals={indicator:"xUMQPeRwYREG_QMMJHzD"};const g=i},SfPIQIJE:(O,f,t)=>{"use strict";t.d(f,{Z:()=>S});var e=t("Z7aTuO5B"),l=t("J6y4/h8P"),a=t("uZqmR+ju"),h=t("ty2gyrHp"),i=t("/GOzvPf6"),g=t("NV1/EHMi");const c=(0,l.default)(a.ButtonToolbar)`
  margin-bottom: 10px;
`,m=(0,l.default)(a.Button)(({theme:o})=>(0,l.css)`
  font-family: ${o.fonts.family.navigation};
  font-size: ${o.fonts.size.navigation};

  &&&& {
    color: ${o.colors.variant.darker.default};
    
    &:hover,
    &:focus {
      text-decoration: none;
    }

    > div {
      &:hover,
      &:focus {
        color: ${o.colors.variant.darker.default};
      }
    }

    &:hover {
      ${(0,g.RF)(o)}
    }

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

      ${(0,g.A7)(o)}

      &:hover,
      &:focus {
        ${(0,g.A7)(o)}
      }
    }
  }
`);m.displayName="Button";const S=({items:o})=>e.createElement(c,null,o.map(({path:v,title:s,permissions:n,exactPathMatch:r})=>v?e.createElement(i.AE,{permissions:n!=null?n:[],key:v},e.createElement(h.J,{to:v,relativeActive:!r},e.createElement(m,{bsStyle:"link"},e.createElement(g.ZP,null,s)))):null))},vUZx0iZy:(O,f,t)=>{"use strict";t.d(f,{Z:()=>k});var e=t("Z7aTuO5B"),l=t("ii0bleBb"),a=t.n(l),h=t("/GOzvPf6"),i=t("uZqmR+ju"),g=t("dFpwyWHg"),c=t.n(g),m=t("C2ikvoS0"),E=t.n(m),S=t("1IntWRSu"),o=t.n(S),v=t("8nGWeFnd"),s=t.n(v),n=t("TeAcaicX"),r=t.n(n),u=t("eE3+5goe"),p=t.n(u),C=t("ETE5k4rC"),M={};M.styleTagTransform=p(),M.setAttributes=s(),M.insert=o().bind(null,"head"),M.domAPI=E(),M.insertStyleElement=r();var T=c()(C.Z,M);const J=C.Z&&C.Z.locals?C.Z.locals:void 0,V=e.createElement(i.Popover,{id:"search-query-help",className:J.popoverWide,title:"Search Syntax Help"},e.createElement("p",null,e.createElement("strong",null,"Available search fields")),e.createElement(i.Table,{condensed:!0},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Field"),e.createElement("th",null,"Description"))),e.createElement("tbody",null,e.createElement("tr",null,e.createElement("td",null,"name"),e.createElement("td",null,"Sidecar name")),e.createElement("tr",null,e.createElement("td",null,"status"),e.createElement("td",null,"Status of the sidecar as it appears in the list, i.e. running, failing, or unknown")),e.createElement("tr",null,e.createElement("td",null,"operating_system"),e.createElement("td",null,"Operating system the sidecar is running on")),e.createElement("tr",null,e.createElement("td",null,"last_seen"),e.createElement("td",null,"Date and time when the sidecar last communicated with Graylog")),e.createElement("tr",null,e.createElement("td",null,"node_id"),e.createElement("td",null,"Identifier of the sidecar")),e.createElement("tr",null,e.createElement("td",null,"sidecar_version"),e.createElement("td",null,"Sidecar version")))),e.createElement("p",null,e.createElement("strong",null,"Examples")),e.createElement("p",null,"Find sidecars that did not communicate with Graylog since a date:",e.createElement("br",null),e.createElement("kbd",null,"last_seen:<=2018-04-10"),e.createElement("br",null)),e.createElement("p",null,"Find sidecars with ",e.createElement("code",null,"failing")," or ",e.createElement("code",null,"unknown")," status:",e.createElement("br",null),e.createElement("kbd",null,"status:failing status:unknown"),e.createElement("br",null))),W=e.createElement(h.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:V},e.createElement(i.Button,{bsStyle:"link"},e.createElement(h.JO,{name:"question-circle"}))),D=({query:z,onSearch:x,onReset:X,children:Y})=>e.createElement(h.UI,{query:z,onSearch:x,onReset:X,placeholder:"Find sidecars",queryHelpComponent:W,topMargin:0,useLoadingState:!0},Y);D.propTypes={query:a().string.isRequired,onSearch:a().func.isRequired,onReset:a().func.isRequired,children:a().element},D.defaultProps={children:void 0};const k=D},tBcsAR17:(O,f,t)=>{"use strict";t.d(f,{Z:()=>c});var e=t("Z7aTuO5B"),l=t("SfPIQIJE"),a=t("d4kzUuQm"),h=t("uZqmR+ju");const i=[{title:"Overview",path:a.ZP.SYSTEM.SIDECARS.OVERVIEW,exactPathMatch:!0},{title:"Administration",path:a.ZP.SYSTEM.SIDECARS.ADMINISTRATION},{title:"Configuration",path:a.ZP.SYSTEM.SIDECARS.CONFIGURATION},{title:"Failure Tracking",path:a.ZP.SYSTEM.SIDECARS.FAILURE_TRACKING}],c=()=>e.createElement(h.Row,null,e.createElement(l.Z,{items:i}))},"nP+JCm88":(O,f,t)=>{"use strict";t.d(f,{Z:()=>X});var e=t("Z7aTuO5B"),l=t("ii0bleBb"),a=t.n(l),h=t("Dg7SLLbb"),i=t.n(h),g=t("uZqmR+ju"),c=t("/GOzvPf6"),m=t("Y7XN0VBN"),E=t("IZYxBTgT"),S=t("O/XpfGnR"),o=t("dFpwyWHg"),v=t.n(o),s=t("C2ikvoS0"),n=t.n(s),r=t("1IntWRSu"),u=t.n(r),p=t("8nGWeFnd"),C=t.n(p),M=t("TeAcaicX"),T=t.n(M),J=t("eE3+5goe"),V=t.n(J),W=t("TsXT+bAI"),D={};D.styleTagTransform=V(),D.setAttributes=C(),D.insert=u().bind(null,"head"),D.domAPI=n(),D.insertStyleElement=T();var k=v()(W.Z,D);const z=W.Z&&W.Z.locals?W.Z.locals:void 0,x=({message:Y,status:Q,lastSeen:q,id:b})=>{const{toUserTimezone:F}=(0,S.Z)();let Z=Y;const ee=i()(m.Z.toString(Q)),te=F(q);let j,$;switch(Q){case m.Z.RUNNING:$="text-success",j="play";break;case m.Z.FAILING:$="text-danger",j="exclamation-triangle";break;case m.Z.STOPPED:$="text-danger",j="stop";break;default:$="text-info",j="question-circle",Z+=` (${(0,E.Qc)(te)})`}if(Z&&b){const P=e.createElement(g.Popover,{id:`${b}-status-tooltip`},Z);return e.createElement(c.Ox,{placement:"top",overlay:P,rootClose:!0,trigger:"hover"},e.createElement("span",{className:`${$} ${z.indicator}`},e.createElement(c.JO,{name:j,fixedWidth:!0})," ",ee))}return e.createElement("span",{className:`${$} ${z.indicator}`},e.createElement(c.JO,{name:j,fixedWidth:!0})," ",ee)};x.propTypes={id:a().string,lastSeen:a().string,message:a().string,status:a().number},x.defaultProps={id:"",lastSeen:void 0,message:"",status:-1};const X=x},GIeTfzK9:(O,f,t)=>{"use strict";t.d(f,{Z:()=>E});var e=t("ii0bleBb"),l=t.n(e),a=t("Z7aTuO5B"),h=t("J6y4/h8P"),i=t("uZqmR+ju"),g=t("gqVHlIxA");const c=h.default.div`
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  max-height: 500px;
`,m=({showModal:S,onHide:o,collectorName:v,collectorVerbose:s})=>a.createElement(g.Z,{showModal:S,onHide:o,bsSize:"large"},a.createElement(i.Modal.Header,{closeButton:!0},a.createElement(i.Modal.Title,null,a.createElement("span",null,"Error Details for ",a.createElement("em",null,v)))),a.createElement(i.Modal.Body,null,a.createElement("pre",null,a.createElement(c,null,s||""))),a.createElement(i.Modal.Footer,null,a.createElement(i.Button,{type:"button",onClick:o},"Close")));m.propTypes={showModal:l().bool.isRequired,onHide:l().func.isRequired,collectorName:l().string.isRequired,collectorVerbose:l().string.isRequired};const E=m},Y7XN0VBN:(O,f,t)=>{"use strict";t.d(f,{Z:()=>g});var e=t("PH5VRLCQ"),l=t.n(e),a=t("ueJll2OF"),h=t.n(a);const g={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 m=l()(c);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(c){switch(h()(c)){case this.RUNNING:return"running";case this.FAILING:return"failing";case this.STOPPED:return"stopped";default:return"unknown"}}}},"2bMZsp0q":(O,f,t)=>{"use strict";t.r(f),t.d(f,{default:()=>$});var e=t("Z7aTuO5B"),l=t("uZqmR+ju"),a=t("/GOzvPf6"),h=t("E+CaPsQD"),i=t("tBcsAR17"),g=t("r6oYOZXJ"),c=t("rVdVsuGH"),m=t("kHvj/lAD"),E=t("ii0bleBb"),S=t.n(E),o=t("J6y4/h8P"),v=t("vUZx0iZy"),s=t("ty2gyrHp"),n=t("4IfE3Ihm"),r=t("d4kzUuQm"),u=t("nP+JCm88");const p=o.default.div`
  height: 80px;
  overflow: hidden scroll;
  white-space: pre-wrap;
  margin-bottom: 6px;
`,C=o.default.div`
  color: #94979c;
  font-style: italic;
  font-size: 66%;
`,M=(0,o.default)(l.Button)`
  padding-left: 0;
`,T=({sidecar:P,collectors:y,onShowDetails:I})=>{const d=P.active?"":" (inactive)",{node_id:_=null,node_name:A,last_seen:K,node_details:{status:{message:B=null,status:w=void 0,collectors:H}={}}={}}=P,G=R=>y.find(U=>U.id===R);return e.createElement(e.Fragment,null,H==null?void 0:H.filter(R=>R.status===2).map(R=>{const U=G(R.collector_id);return e.createElement("tr",{key:R.collector_id+R.configuration_id},e.createElement("td",null,e.createElement(s.r,{to:r.ZP.SYSTEM.SIDECARS.STATUS(P.node_id)},A),e.createElement(C,null,d),e.createElement(C,null,U==null?void 0:U.node_operating_system),e.createElement(C,null,"v",P.sidecar_version),e.createElement(C,null,P.node_id)),e.createElement("td",null,U==null?void 0:U.name),e.createElement("td",null,e.createElement(n.Z,{dateTime:K})),e.createElement("td",null,e.createElement(u.Z,{status:w,message:B,id:_,lastSeen:K})),e.createElement("td",null,R.message),e.createElement("td",null,e.createElement(p,null,R.verbose_message),e.createElement(M,{bsStyle:"link",bsSize:"xs",onClick:()=>I({name:U==null?void 0:U.name,verbose_message:R.verbose_message})},"Show more")))}))};T.propTypes={sidecar:S().object.isRequired};const J=T;var V=t("GIeTfzK9");const W=(0,o.default)(a.fz)`
  && {
    width: 12px;
    margin-left: 5px;
    line-height: 1;
  }
`,D=o.default.col`
  width: 9%;
`,k=o.default.col`
  width: 14%;
`,z=o.default.col`
  width: 50%;
`,x=({onlyActive:P,query:y})=>{const I=P&&' and/or click on "Include inactive sidecars"';return e.createElement(a.pJ,null,`There are no sidecars with failures matching the search criteria. Try adjusting your search filter: ${y} ${I}`)},X=({rows:P,sort:y,onSortChange:I})=>{const d={node_name:"Sidecar",collector:"Collector",last_seen:"Last Seen","node_details.status.status":"Status",message:"Error Message",verbose_message:"Verbose Message"},_=["node_name","last_seen"];return e.createElement(l.Table,{striped:!0,responsive:!0},e.createElement("colgroup",null,e.createElement(D,null),e.createElement(D,null),e.createElement(D,null),e.createElement(D,null),e.createElement(k,null),e.createElement(z,null)),e.createElement("thead",null,e.createElement("tr",null,Object.keys(d).map(A=>e.createElement("th",{key:A},d[A],_.includes(A)&&e.createElement(W,{activeDirection:y.field===A?y.order:null,onChange:()=>I(A),title:A,ascId:"asc",descId:"desc"}))))),e.createElement("tbody",null,P))},Y=({query:P,onlyActive:y})=>P?e.createElement(x,{onlyActive:y,query:P}):e.createElement(a.dX,null,"There are no sidecars with failures."),Q=({sidecars:P,collectors:y,pagination:I,query:d,sort:_,onlyActive:A,onPageChange:K,onQueryChange:B,onSortChange:w,toggleShowInactive:H})=>{const[G,R]=(0,e.useState)(null),U=P.map(N=>e.createElement(J,{key:N.node_id,sidecar:N,collectors:y,onShowDetails:R})),L=A?"Include":"Hide";return e.createElement("div",null,e.createElement("div",null,e.createElement(v.Z,{query:d,onSearch:B,onReset:B},e.createElement(l.Button,{bsStyle:"primary",onClick:H},L," inactive sidecars"))),e.createElement(a.l9,{showPageSizeSelect:!1,totalItems:I.total,onChange:K},e.createElement(l.Row,null,e.createElement(l.Col,{md:12},U.length>0?e.createElement(X,{rows:U,sort:_,onSortChange:w}):e.createElement(Y,{query:d,onlyActive:A})))),G&&e.createElement(V.Z,{showModal:!0,onHide:()=>R(null),collectorName:G.name,collectorVerbose:G.verbose_message}))};Q.propTypes={sidecars:S().array.isRequired,collectors:S().array.isRequired,pagination:S().object.isRequired,query:S().string.isRequired,sort:S().object.isRequired,onlyActive:S().bool.isRequired,onPageChange:S().func.isRequired,onQueryChange:S().func.isRequired,onSortChange:S().func.isRequired,toggleShowInactive:S().func.isRequired};const q=Q,b=[25],F={page:1,pageSize:b[0],query:"",sortField:"last_seen",order:"desc",onlyActive:!1},Z=(P,y)=>{const{page:I=F.page,pageSize:d=F.pageSize,query:_=F.query,sortField:A=F.sortField,order:K=F.order,onlyActive:B=F.onlyActive}=P;return g.V.listPaginated({page:I,pageSize:d,query:_,sortField:A,order:K,onlyActive:B}).then(y)},te=()=>{const{page:P,pageSize:y,resetPage:I}=(0,c.ZP)(b),[d,_]=(0,e.useState)(null),[A,K]=(0,e.useState)([]);(0,e.useEffect)(()=>{if((d==null?void 0:d.pagination.page)!==P||(d==null?void 0:d.pagination.per_page)!==y){const{query:L,sort:N,order:oe,only_active:ae}=d||{};Z({query:L,page:P,pageSize:y,order:oe,sortField:N,onlyActive:ae},_)}},[P,y,d]),(0,e.useEffect)(()=>{m.v.all().then(L=>K(L.collectors))},[]);const B={page:1,pageSize:y,query:d==null?void 0:d.query,sortField:d==null?void 0:d.sort,order:d==null?void 0:d.order,onlyActive:d==null?void 0:d.only_active},w=(L,N)=>{Z({...B,page:L,pageSize:N},_)},H=(L="",N=()=>{})=>{Z({...B,query:L},_).then(I).finally(N)},G=L=>{Z({...B,sortField:L,order:d.order==="asc"?"desc":"asc"},_).then(I)},R=()=>{Z({...B,onlyActive:!d.only_active},_).then(I)};return d?e.createElement(q,{sidecars:d.sidecars,collectors:A,pagination:d.pagination,query:d.query,onlyActive:d.only_active,sort:{field:d.sort,order:d.order},onPageChange:w,onQueryChange:H,onSortChange:G,toggleShowInactive:R}):e.createElement(a.$j,null)},$=()=>e.createElement(a.$4,{title:"Sidecars"},e.createElement(i.Z,null),e.createElement(a.mr,{title:"Failure Tracking",documentationLink:{title:"Sidecar documentation",path:h.Z.PAGES.COLLECTOR_SIDECAR}},e.createElement("span",null,"The Graylog Sidecar Failure Tracking provides additional useful information about failure reasons, that can help you decrease troubleshooting time and get your collectors back online faster.")),e.createElement(l.Row,{className:"content"},e.createElement(l.Col,{md:12},e.createElement(te,null))))},"kHvj/lAD":(O,f,t)=>{"use strict";t.d(f,{d:()=>v,v:()=>o});var e=t("JnTtTRmZ"),l=t.n(e),a=t("oCSEoDew"),h=t.n(a),i=t("wXrUUKFq"),g=t.n(i),c=t("MdYBRjRJ"),m=t("eFxcQyPT"),E=t("jAGDuYSC"),S=t("IA3Ku5lS");const o=(0,S.ei)("core.Collectors",()=>l().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}})),v=(0,S.dS)("core.Collectors",()=>l().createStore({listenables:[o],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(s){const n=(0,m.ZP)("GET",c.DC(`${this.sourceUrl}/collectors/${s}`));n.catch(r=>{let u=`Fetching Collector failed with status: ${r}`;r.status===404&&(u=`Unable to find a collector with ID <${s}>, please ensure it was not deleted.`),E.Z.error(u,"Could not retrieve Collector")}),o.getCollector.promise(n)},_fetchCollectors({query:s,page:n,pageSize:r}){const u={query:s,page:n,per_page:r},p=h()(`${this.sourceUrl}/collectors/summary`).search(u).toString();return(0,m.ZP)("GET",c.DC(p))},all(){const s=this._fetchCollectors({pageSize:0});s.then(n=>(this.collectors=n.collectors,this.propagateChanges(),n.collectors),n=>{E.Z.error(`Fetching collectors failed with status: ${n}`,"Could not retrieve collectors")}),o.all.promise(s)},list({query:s="",page:n=1,pageSize:r=10}){const u=this._fetchCollectors({query:s,page:n,pageSize:r});u.then(p=>(this.query=p.query,this.pagination={page:p.pagination.page,pageSize:p.pagination.per_page,total:p.pagination.total},this.total=p.total,this.paginatedCollectors=p.collectors,this.propagateChanges(),p.collectors),p=>{E.Z.error(`Fetching collectors failed with status: ${p}`,"Could not retrieve collectors")}),o.list.promise(u)},refreshList(){this.list({query:this.query,page:this.pagination.page,pageSize:this.pagination.pageSize})},create(s){const n=(0,m.ZP)("POST",c.DC(`${this.sourceUrl}/collectors`),s);n.then(r=>(E.Z.success("","Collector successfully created"),this.collectors=r.collectors,this.propagateChanges(),this.collectors),r=>{E.Z.error(`Fetching collectors failed with status: ${r}`,"Could not retrieve collectors")}),o.create.promise(n)},update(s){const n=(0,m.ZP)("PUT",c.DC(`${this.sourceUrl}/collectors/${s.id}`),s);n.then(r=>(E.Z.success("","Collector successfully updated"),this.collectors=r.collectors,this.propagateChanges(),this.collectors),r=>{E.Z.error(`Fetching collectors failed with status: ${r}`,"Could not retrieve collectors")}),o.update.promise(n)},delete(s){const n=c.DC(`${this.sourceUrl}/collectors/${s.id}`),r=(0,m.ZP)("DELETE",n);r.then(u=>(E.Z.success("",`Collector "${s.name}" successfully deleted`),this.refreshList(),u),u=>{E.Z.error(`Deleting Collector failed: ${u.status===400?u.responseMessage:u.message}`,`Could not delete Collector "${s.name}"`)}),o.delete.promise(r)},copy(s,n){const r=c.DC(`${this.sourceUrl}/collectors/${s}/${n}`),u="POST",p=(0,m.ZP)(u,r);p.then(C=>(E.Z.success("",`Collector "${n}" successfully copied`),this.refreshList(),C),C=>{E.Z.error(`Saving collector "${n}" failed with status: ${C.message}`,"Could not save Collector")}),o.copy.promise(p)},validate(s){const n={id:" ",service_type:"exec",executable_path:" ",default_template:" "};g()(n,s);const r=(0,m.ZP)("POST",c.DC(`${this.sourceUrl}/collectors/validate`),n);r.then(u=>u,u=>E.Z.error(`Validating collector "${n.name}" failed with status: ${u.message}`,"Could not validate collector")),o.validate.promise(r)}}))},r6oYOZXJ:(O,f,t)=>{"use strict";t.d(f,{V:()=>E,b:()=>S});var e=t("JnTtTRmZ"),l=t.n(e),a=t("oCSEoDew"),h=t.n(a),i=t("MdYBRjRJ"),g=t("jAGDuYSC"),c=t("eFxcQyPT"),m=t("IA3Ku5lS");const E=(0,m.ei)("core.Sidecars",()=>l().createActions({listPaginated:{asyncResult:!0},getSidecar:{asyncResult:!0},getSidecarActions:{asyncResult:!0},restartCollector:{asyncResult:!0},assignConfigurations:{asyncResult:!0}})),S=(0,m.dS)("core.Sidecars",()=>l().createStore({listenables:[E],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:o="",page:v=1,pageSize:s=50,onlyActive:n=!1,sortField:r="node_name",order:u="asc"}){const p={query:o,page:v,per_page:s,only_active:n,sort:r,order:u},C=h()(this.sourceUrl).search(p).toString(),M=(0,c.vl)("GET",i.DC(C));M.then(T=>(this.sidecars=T.sidecars,this.query=T.query,this.onlyActive=T.only_active,this.pagination={total:T.pagination.total,count:T.pagination.count,page:T.pagination.page,pageSize:T.pagination.per_page},this.sort={field:T.sort,order:T.order},this.propagateChanges(),T),T=>{g.Z.error(T.status===400?T.responseMessage:`Fetching Sidecars failed with status: ${T.message}`,"Could not retrieve Sidecars")}),E.listPaginated.promise(M)},getSidecar(o){const v=(0,c.vl)("GET",i.DC(`${this.sourceUrl}/${o}`));v.catch(s=>{let n=`Fetching Sidecar failed with status: ${s}`;s.status===404&&(n=`Unable to find a sidecar with ID <${o}>, maybe it was inactive for too long.`),g.Z.error(n,"Could not retrieve Sidecar")}),E.getSidecar.promise(v)},restartCollector(o,v){const s={};s.collector=v,s.properties={},s.properties.restart=!0;const n=(0,c.ZP)("PUT",i.DC(`${this.sourceUrl}/${o}/action`),[s]);n.catch(r=>{g.Z.error(`Restarting Sidecar failed with status: ${r}`,"Could not restart Sidecar")}),E.restartCollector.promise(n)},getSidecarActions(o){const v=(0,c.vl)("GET",i.DC(`${this.sourceUrl}/${o}/action`));v.catch(s=>{g.Z.error(`Fetching Sidecar actions failed with status: ${s}`,"Could not retrieve Sidecar actions")}),E.getSidecarActions.promise(v)},toConfigurationAssignmentDto(o,v,s){return{node_id:o,collector_id:v,configuration_id:s}},assignConfigurations(o,v){const s=o.map(({sidecar:r,collector:u})=>{const p=r.assignments.filter(C=>C.collector_id!==u.id);return v.forEach(C=>{p.push({collector_id:u.id,configuration_id:C.id})}),{node_id:r.node_id,assignments:p}}),n=(0,c.ZP)("PUT",i.DC(`${this.sourceUrl}/configurations`),{nodes:s});n.then(r=>(g.Z.success("",`Configuration change for ${o.length} collectors requested`),r),r=>{g.Z.error(`Fetching Sidecar actions failed with status: ${r}`,"Could not retrieve Sidecar actions")}),E.assignConfigurations.promise(n)}}))},PH5VRLCQ:(O,f,t)=>{var e=t("R+B8SaP1"),l=e(function(a,h,i){return a+(i?" ":"")+h.toLowerCase()});O.exports=l}}]);})();

//# sourceMappingURL=1255d548-4594.d318652867b40b12817c.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy