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

web-interface.assets.1255d548-2801.ce8662c163526f874c4a.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-2801"],{SfPIQIJE:(U,P,e)=>{e.d(P,{Z:()=>v});var m=e("Z7aTuO5B"),h=e("J6y4/h8P"),r=e("uZqmR+ju"),f=e("ty2gyrHp"),D=e("/GOzvPf6"),C=e("NV1/EHMi");const u=(0,h.default)(r.ButtonToolbar)`
  margin-bottom: 10px;
`,c=(0,h.default)(r.Button)(({theme:n})=>(0,h.css)`
  font-family: ${n.fonts.family.navigation};
  font-size: ${n.fonts.size.navigation};

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

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

    &:hover {
      ${(0,C.RF)(n)}
    }

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

      ${(0,C.A7)(n)}

      &:hover,
      &:focus {
        ${(0,C.A7)(n)}
      }
    }
  }
`);c.displayName="Button";const v=({items:n})=>m.createElement(u,null,n.map(({path:M,title:o,permissions:t,exactPathMatch:s})=>M?m.createElement(D.AE,{permissions:t!=null?t:[],key:M},m.createElement(f.J,{to:M,relativeActive:!s},m.createElement(c,{bsStyle:"link"},m.createElement(C.ZP,null,o)))):null))},tBcsAR17:(U,P,e)=>{e.d(P,{Z:()=>u});var m=e("Z7aTuO5B"),h=e("SfPIQIJE"),r=e("d4kzUuQm"),f=e("uZqmR+ju");const D=[{title:"Overview",path:r.ZP.SYSTEM.SIDECARS.OVERVIEW,exactPathMatch:!0},{title:"Administration",path:r.ZP.SYSTEM.SIDECARS.ADMINISTRATION},{title:"Configuration",path:r.ZP.SYSTEM.SIDECARS.CONFIGURATION},{title:"Failure Tracking",path:r.ZP.SYSTEM.SIDECARS.FAILURE_TRACKING}],u=()=>m.createElement(f.Row,null,m.createElement(h.Z,{items:D}))},"7VnWevY8":(U,P,e)=>{e.d(P,{Z:()=>W});var m=e("ii0bleBb"),h=e.n(m),r=e("Z7aTuO5B"),f=e("IW7priiX"),D=e.n(f),C=e("Mx+G+HdB"),u=e.n(C),c=e("PfG+ecgN"),d=e.n(c),v=e("/GOzvPf6"),n=e("uZqmR+ju"),M=e("d4kzUuQm"),o=e("djwd899R"),t=e("kHvj/lAD"),s=e("N6x7vnl1"),a=e("v4GbOr/o"),i=e("BqxuktKK"),O=e("8fnsnG21"),B=Object.defineProperty,$=(p,E,_)=>E in p?B(p,E,{enumerable:!0,configurable:!0,writable:!0,value:_}):p[E]=_,T=(p,E,_)=>($(p,typeof E!="symbol"?E+"":E,_),_);const S=({validationErrors:p,fieldName:E,defaultText:_})=>p[E]?r.createElement("span",null,p[E][0]):r.createElement("span",null,_);S.propTypes={validationErrors:h().object.isRequired,fieldName:h().string.isRequired,defaultText:h().string.isRequired};const Z=()=>{const p=[];return p.push({value:"exec",label:"Foreground execution"}),p.push({value:"svc",label:"Windows service"}),p},K=()=>{const p=[];return p.push({value:"linux",label:"Linux"}),p.push({value:"windows",label:"Windows"}),p.push({value:"darwin",label:"Darwin"}),p.push({value:"freebsd",label:"FreeBSD"}),p};class A extends r.Component{constructor(E){super(E),T(this,"hasErrors",()=>{const{error:l}=this.state;return l}),T(this,"_save",()=>{const{action:l,history:g,sendTelemetry:y}=this.props,{formData:R}=this.state,L=l==="create";if(!this.hasErrors()){let I;L?I=t.v.create(R).then(()=>g.push(M.ZP.SYSTEM.SIDECARS.CONFIGURATION)):I=t.v.update(R),I.then(()=>{y(a.A.SIDECARS[`LOG_COLLECTOR_${L?"CREATED":"UPDATED"}`],{app_pathname:"sidecars",app_section:"configuration"})})}}),T(this,"handleSelectTelemetry",(l,g)=>{const{sendTelemetry:y}=this.props;(l==="service_type"||l==="node_operating_system")&&y(a.A.SIDECARS[`LOG_COLLECTOR_${d()(l).replace(/\s|\//g,"_")}_CHANGED`],{app_pathname:"sidecars",app_section:"configuration",event_details:{[l]:g}})}),T(this,"_formDataUpdate",l=>{const{formData:g}=this.state;return y=>{const R=D()(g);this.handleSelectTelemetry(l,y),R[l]=y,this._debouncedValidateFormData(R),this.setState({formData:R})}}),T(this,"_validateFormData",l=>{l.name&&l.node_operating_system&&t.v.validate(l).then(g=>this.setState({validation_errors:g.errors,error:g.failed}))}),T(this,"_onNameChange",l=>{const g=l.target.value;this._formDataUpdate("name")(g)}),T(this,"_onInputChange",l=>g=>{this._formDataUpdate(l)(g.target.value)}),T(this,"_onSubmit",l=>{l.preventDefault(),this._save()}),T(this,"_onCancel",()=>{const{history:l}=this.props;l.goBack()}),T(this,"_validationState",l=>{const{validation_errors:g}=this.state;return g[l]?"error":null});const{collector:_}=this.props;this.state={error:!1,validation_errors:{},formData:{id:_.id,name:_.name,service_type:_.service_type,node_operating_system:_.node_operating_system,executable_path:_.executable_path,execute_parameters:_.execute_parameters,validation_parameters:_.validation_parameters,default_template:String(_.default_template)}}}UNSAFE_componentWillMount(){this._debouncedValidateFormData=u()(this._validateFormData,200)}componentDidMount(){t.v.all(),o.Z.all()}render(){const{action:E}=this.props,{formData:_,validation_errors:l}=this.state;let g="",y="";return _.validation_parameters&&(g=_.validation_parameters),_.execute_parameters&&(y=_.execute_parameters),r.createElement("div",null,r.createElement("form",{onSubmit:this._onSubmit},r.createElement("fieldset",null,r.createElement(n.Input,{type:"text",id:"name",label:"Name",onChange:this._onNameChange,bsStyle:this._validationState("name"),help:r.createElement(S,{fieldName:"name",defaultText:"Name for this collector",validationErrors:l}),value:_.name||"",autoFocus:!0,required:!0}),r.createElement(n.FormGroup,{controlId:"service_type",validationState:this._validationState("service_type")},r.createElement(n.ControlLabel,null,"Process management"),r.createElement(v.Ph,{inputId:"service_type",options:Z(),value:_.service_type,onChange:this._formDataUpdate("service_type"),placeholder:"Service Type",required:!0}),r.createElement(n.HelpBlock,null,r.createElement(S,{fieldName:"service_type",defaultText:"Choose the service type this collector is meant for.",validationErrors:l}))),r.createElement(n.FormGroup,{controlId:"node_operating_system",validationState:this._validationState("node_operating_system")},r.createElement(n.ControlLabel,null,"Operating System"),r.createElement(v.Ph,{inputId:"node_operating_system",options:K(),value:_.node_operating_system,onChange:this._formDataUpdate("node_operating_system"),placeholder:"Name",required:!0}),r.createElement(n.HelpBlock,null,r.createElement(S,{fieldName:"node_operating_system",defaultText:"Choose the operating system this collector is meant for.",validationErrors:l}))),r.createElement(n.Input,{type:"text",id:"executablePath",label:"Executable Path",onChange:this._onInputChange("executable_path"),bsStyle:this._validationState("executable_path"),help:r.createElement(S,{fieldName:"executable_path",defaultText:"Path to the collector executable",validationErrors:l}),value:_.executable_path||"",required:!0}),r.createElement(n.Input,{type:"text",id:"executeParameters",label:r.createElement("span",null,"Execute Parameters ",r.createElement("small",{className:"text-muted"},"(Optional)")),onChange:this._onInputChange("execute_parameters"),help:r.createElement("span",null,"Parameters the collector is started with.",r.createElement("strong",null," %s will be replaced by the path to the configuration file.")),value:y||""}),r.createElement(n.Input,{type:"text",id:"validationParameters",label:r.createElement("span",null,"Parameters for Configuration Validation ",r.createElement("small",{className:"text-muted"},"(Optional)")),onChange:this._onInputChange("validation_parameters"),help:r.createElement("span",null,"Parameters that validate the configuration file. ",r.createElement("strong",null," %s will be replaced by the path to the configuration file.")),value:g||""}),r.createElement(n.FormGroup,{controlId:"defaultTemplate"},r.createElement(n.ControlLabel,null,r.createElement("span",null,"Default Template ",r.createElement("small",{className:"text-muted"},"(Optional)"))),r.createElement(v.KB,{id:"template",value:_.default_template||"",onChange:this._formDataUpdate("default_template")}),r.createElement(n.HelpBlock,null,"The default Collector configuration."))),r.createElement(n.Row,null,r.createElement(n.Col,{md:12},r.createElement(v.Ow,{submitButtonText:`${E==="create"?"Create":"Update"} collector`,disabledSubmit:this.hasErrors(),onCancel:this._onCancel})))))}}A.propTypes={action:h().oneOf(["create","edit"]),collector:h().object,history:h().object.isRequired,sendTelemetry:h().func},A.defaultProps={action:"edit",collector:{default_template:""},sendTelemetry:()=>{}};const W=(0,i.Z)((0,s.Z)((0,O.Z)(A,{collectors:t.d})))},N6x7vnl1:(U,P,e)=>{e.d(P,{Z:()=>f});var m=e("Z7aTuO5B"),h=e("/7OuCFNo");const f=D=>C=>{const u=(0,h.Z)();return m.createElement(D,{...C,history:u})}},djwd899R:(U,P,e)=>{e.d(P,{Z:()=>n,m:()=>M});var m=e("JnTtTRmZ"),h=e.n(m),r=e("oCSEoDew"),f=e.n(r),D=e("wXrUUKFq"),C=e.n(D),u=e("MdYBRjRJ"),c=e("jAGDuYSC"),d=e("eFxcQyPT"),v=e("IA3Ku5lS");const n=(0,v.ei)("core.CollectorConfigurations",()=>h().createActions({all:{asyncResult:!0},list:{asyncResult:!0},listUploads:{asyncResult:!0},getConfiguration:{asyncResult:!0},getConfigurationSidecars:{asyncResult:!0},getUploads:{asyncResult:!0},createConfiguration:{asyncResult:!0},updateConfiguration:{asyncResult:!0},renderPreview:{asyncResult:!0},copyConfiguration:{asyncResult:!0},delete:{asyncResult:!0},validate:{asyncResult:!0}})),M=(0,v.dS)("core.CollectorConfigurations",()=>h().createStore({listenables:[n],sourceUrl:"/sidecar",configurations:void 0,pagination:{page:void 0,pageSize:void 0,total:void 0},total:void 0,paginatedConfigurations:void 0,query:void 0,getInitialState(){return{configurations:this.configurations,query:this.query,total:this.total,pagination:this.pagination,paginatedConfigurations:this.paginatedConfigurations}},propagateChanges(){this.trigger({configurations:this.configurations,query:this.query,total:this.total,pagination:this.pagination,paginatedConfigurations:this.paginatedConfigurations})},_fetchConfigurations({query:o,page:t,pageSize:s}){const a=`${this.sourceUrl}/configurations`,i={query:o,page:t,per_page:s},O=f()(a).search(i).toString();return(0,d.ZP)("GET",u.DC(O))},_fetchUploads({page:o}){const t=`${this.sourceUrl}/configurations/uploads`,s={page:o},a=f()(t).search(s).toString();return(0,d.ZP)("GET",u.DC(a))},all(){const o=this._fetchConfigurations({pageSize:0});o.then(t=>(this.configurations=t.configurations,this.propagateChanges(),t.configurations),t=>{c.Z.error(`Fetching collector configurations failed with status: ${t}`,"Could not retrieve configurations")}),n.all.promise(o)},list({query:o="",page:t=1,pageSize:s=10}){const a=this._fetchConfigurations({query:o,page:t,pageSize:s});a.then(i=>(this.query=i.query,this.pagination={page:i.pagination.page,pageSize:i.pagination.per_page,total:i.pagination.total},this.total=i.total,this.paginatedConfigurations=i.configurations,this.propagateChanges(),i.configurations),i=>{c.Z.error(`Fetching collector configurations failed with status: ${i}`,"Could not retrieve configurations")}),n.list.promise(a)},listUploads({page:o=1}){const t=this._fetchUploads({page:o});t.catch(s=>{c.Z.error(`Fetching configuration uploads failed with status: ${s}`,"Could not retrieve configurations")}),n.listUploads.promise(t)},refreshList(){this.list({query:this.query,page:this.page,pageSize:this.pageSize})},getConfiguration(o){const t=(0,d.ZP)("GET",u.DC(`${this.sourceUrl}/configurations/${o}`));t.catch(s=>{let a=`Fetching Configuration failed with status: ${s}`;s.status===404&&(a=`Unable to find a Configuration with ID <${o}>, please ensure it was not deleted.`),c.Z.error(a,"Could not retrieve Configuration")}),n.getConfiguration.promise(t)},getConfigurationSidecars(o){const t=(0,d.ZP)("GET",u.DC(`${this.sourceUrl}/configurations/${o}/sidecars`));t.catch(s=>{let a=`Fetching Configuration failed with status: ${s}`;s.status===404&&(a=`Unable to find a Configuration with ID <${o}>, please ensure it was not deleted.`),c.Z.error(a,"Could not retrieve Configuration")}),n.getConfigurationSidecars.promise(t)},renderPreview(o){const t={template:o},s=(0,d.ZP)("POST",u.DC(`${this.sourceUrl}/configurations/render/preview`),t);s.catch(a=>{c.Z.error(`Fetching configuration preview failed with status: ${a}`,"Could not retrieve preview")}),n.renderPreview.promise(s)},createConfiguration(o){const t=u.DC(`${this.sourceUrl}/configurations`),s="POST",a=(0,d.ZP)(s,t,o);a.then(i=>(c.Z.success("","Configuration successfully created"),i),i=>{c.Z.error(i.status===400?i.responseMessage:`Creating configuration failed with status: ${i.message}`,"Could not save configuration")}),n.createConfiguration.promise(a)},updateConfiguration(o){const t=u.DC(`${this.sourceUrl}/configurations/${o.id}`),s=(0,d.ZP)("PUT",t,o);s.then(a=>(c.Z.success("","Configuration successfully updated"),this.refreshList(),a),a=>{c.Z.error(`Updating Configuration failed: ${a.status===400?a.responseMessage:a.message}`,`Could not update Configuration ${o.name}`)}),n.updateConfiguration.promise(s)},copyConfiguration(o,t){const s=u.DC(`${this.sourceUrl}/configurations/${o}/${t}`),a="POST",i=(0,d.ZP)(a,s);i.then(O=>(c.Z.success("",`Configuration "${t}" successfully copied`),this.refreshList(),O),O=>{c.Z.error(`Saving configuration "${t}" failed with status: ${O.message}`,"Could not save Configuration")}),n.copyConfiguration.promise(i)},delete(o){const t=u.DC(`${this.sourceUrl}/configurations/${o.id}`),s=(0,d.ZP)("DELETE",t);s.then(a=>(c.Z.success("",`Configuration "${o.name}" successfully deleted`),this.refreshList(),a),a=>{c.Z.error(`Deleting Configuration failed: ${a.status===400?a.responseMessage:a.message}`,`Could not delete Configuration ${o.name}`)}),n.delete.promise(s)},validate(o){const t={name:" ",collector_id:" ",color:" ",template:" "};C()(t,o);const s=(0,d.ZP)("POST",u.DC(`${this.sourceUrl}/configurations/validate`),t);s.then(a=>a,a=>c.Z.error(`Validating configuration "${t.name}" failed with status: ${a.message}`,"Could not validate configuration")),n.validate.promise(s)}}))},"kHvj/lAD":(U,P,e)=>{e.d(P,{d:()=>M,v:()=>n});var m=e("JnTtTRmZ"),h=e.n(m),r=e("oCSEoDew"),f=e.n(r),D=e("wXrUUKFq"),C=e.n(D),u=e("MdYBRjRJ"),c=e("eFxcQyPT"),d=e("jAGDuYSC"),v=e("IA3Ku5lS");const n=(0,v.ei)("core.Collectors",()=>h().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}})),M=(0,v.dS)("core.Collectors",()=>h().createStore({listenables:[n],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 t=(0,c.ZP)("GET",u.DC(`${this.sourceUrl}/collectors/${o}`));t.catch(s=>{let a=`Fetching Collector failed with status: ${s}`;s.status===404&&(a=`Unable to find a collector with ID <${o}>, please ensure it was not deleted.`),d.Z.error(a,"Could not retrieve Collector")}),n.getCollector.promise(t)},_fetchCollectors({query:o,page:t,pageSize:s}){const a={query:o,page:t,per_page:s},i=f()(`${this.sourceUrl}/collectors/summary`).search(a).toString();return(0,c.ZP)("GET",u.DC(i))},all(){const o=this._fetchCollectors({pageSize:0});o.then(t=>(this.collectors=t.collectors,this.propagateChanges(),t.collectors),t=>{d.Z.error(`Fetching collectors failed with status: ${t}`,"Could not retrieve collectors")}),n.all.promise(o)},list({query:o="",page:t=1,pageSize:s=10}){const a=this._fetchCollectors({query:o,page:t,pageSize:s});a.then(i=>(this.query=i.query,this.pagination={page:i.pagination.page,pageSize:i.pagination.per_page,total:i.pagination.total},this.total=i.total,this.paginatedCollectors=i.collectors,this.propagateChanges(),i.collectors),i=>{d.Z.error(`Fetching collectors failed with status: ${i}`,"Could not retrieve collectors")}),n.list.promise(a)},refreshList(){this.list({query:this.query,page:this.pagination.page,pageSize:this.pagination.pageSize})},create(o){const t=(0,c.ZP)("POST",u.DC(`${this.sourceUrl}/collectors`),o);t.then(s=>(d.Z.success("","Collector successfully created"),this.collectors=s.collectors,this.propagateChanges(),this.collectors),s=>{d.Z.error(`Fetching collectors failed with status: ${s}`,"Could not retrieve collectors")}),n.create.promise(t)},update(o){const t=(0,c.ZP)("PUT",u.DC(`${this.sourceUrl}/collectors/${o.id}`),o);t.then(s=>(d.Z.success("","Collector successfully updated"),this.collectors=s.collectors,this.propagateChanges(),this.collectors),s=>{d.Z.error(`Fetching collectors failed with status: ${s}`,"Could not retrieve collectors")}),n.update.promise(t)},delete(o){const t=u.DC(`${this.sourceUrl}/collectors/${o.id}`),s=(0,c.ZP)("DELETE",t);s.then(a=>(d.Z.success("",`Collector "${o.name}" successfully deleted`),this.refreshList(),a),a=>{d.Z.error(`Deleting Collector failed: ${a.status===400?a.responseMessage:a.message}`,`Could not delete Collector "${o.name}"`)}),n.delete.promise(s)},copy(o,t){const s=u.DC(`${this.sourceUrl}/collectors/${o}/${t}`),a="POST",i=(0,c.ZP)(a,s);i.then(O=>(d.Z.success("",`Collector "${t}" successfully copied`),this.refreshList(),O),O=>{d.Z.error(`Saving collector "${t}" failed with status: ${O.message}`,"Could not save Collector")}),n.copy.promise(i)},validate(o){const t={id:" ",service_type:"exec",executable_path:" ",default_template:" "};C()(t,o);const s=(0,c.ZP)("POST",u.DC(`${this.sourceUrl}/collectors/validate`),t);s.then(a=>a,a=>d.Z.error(`Validating collector "${t.name}" failed with status: ${a.message}`,"Could not validate collector")),n.validate.promise(s)}}))}}]);})();

//# sourceMappingURL=1255d548-2801.ce8662c163526f874c4a.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy