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

web-interface.assets.325e2d4b-6781.2c1df8921aac52345db1.js Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
"use strict";(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["325e2d4b-6781"],{nlWYhBAP:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n("Z7aTuO5B"),l=n("ii0bleBb"),r=n.n(l),o=n("J6y4/h8P"),i=n("oibC5Fgm"),s=n("F9olzlTR");const c=o.default.span.withConfig({displayName:"ColorLabel__ColorLabelWrap",componentId:"sc-6mampg-0"})((e=>{let{size:t,theme:n}=e;const{body:a,small:l,tiny:r}=n.fonts.size,i="small"===t?l:a;return(0,o.css)(["vertical-align:middle;font-size:",";"],"xsmall"===t?r:i)})),u=e=>{let{color:t,size:n,text:l,theme:r}=e;const o=r.utils.colorLevel(t,5),i=r.utils.contrastingColor(t);return a.createElement(c,{size:n,className:"color-label-wrapper"},a.createElement(s.__,{style:{backgroundColor:t,border:`1px solid ${o}`,color:i,overflow:"hidden",textOverflow:"ellipsis",maxWidth:"128px",marginRight:"4px",marginBottom:"4px"}},l))};u.propTypes={color:r().string.isRequired,text:r().oneOfType([r().string,r().element]),size:r().oneOf(["normal","small","xsmall"]),theme:i.rG.isRequired},u.defaultProps={text:a.createElement("span",null," "),size:"normal"};const m=(0,o.withTheme)(u)},"fk9z+aLZ":(e,t,n)=>{n.d(t,{Z:()=>re});var a=n("ii0bleBb"),l=n.n(a),r=n("Z7aTuO5B"),o=n("nHcjWeCO"),i=n.n(o),s=n("BSHS2nUH"),c=n("0zTRKSqx"),u=n("F9olzlTR"),m=n("DeVaSktS"),d=n("nlWYhBAP"),p=n("NVA6hUPo"),h=n("dfn/QTgc");const g=()=>{const e=e=>`\${sidecar.${e}}`;return r.createElement("div",null,r.createElement(u.iA,{responsive:!0},r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Name"),r.createElement("th",null,"Description"))),r.createElement("tbody",null,r.createElement("tr",null,r.createElement("td",null,r.createElement("code",null,e("operatingSystem"))),r.createElement("td",null,"Name of the operating system the sidecar is running on, e.g. ",r.createElement("code",null,'"Linux", "Windows"'))),r.createElement("tr",null,r.createElement("td",null,r.createElement("code",null,e("nodeName"))),r.createElement("td",null,"The name of the sidecar, defaults to hostname if not set.")),r.createElement("tr",null,r.createElement("td",null,r.createElement("code",null,e("nodeId"))),r.createElement("td",null,"UUID of the sidecar.")),r.createElement("tr",null,r.createElement("td",null,r.createElement("code",null,e("sidecarVersion"))),r.createElement("td",null,"Version string of the running sidecar.")),r.createElement("tr",null,r.createElement("td",null,r.createElement("code",null,e("spoolDir"))),r.createElement("td",null,"A directory that is unique per configuration and can be used to store collector data.")),r.createElement("tr",null,r.createElement("td",null,r.createElement("code",null,e("tags."))),r.createElement("td",null,"A map of tags that are set for the sidecar. This can be used to render conditional configuration snippets. e.g.: ",r.createElement("br",null),r.createElement("code",null," <#if sidecar.tags.webserver??>",r.createElement("br",null),"  - /var/log/apache/*.log",r.createElement("br",null),"  "))))))};var f=n("JnTtTRmZ"),E=n.n(f),b=n("0wQfx7YJ"),C=n("4af3+9mh"),v=n("OqsMdpSm"),y=n("xc00RsLr");const _=(0,y.ei)("core.ConfigurationVariable",(()=>E().createActions({all:{asyncResult:!0},save:{asyncResult:!0},delete:{asyncResult:!0},validate:{asyncResult:!0},getConfigurations:{asyncResult:!0}})));(0,y.dS)("core.ConfigurationVariable",(()=>E().createStore({listenables:[_],sourceUrl:"/sidecar/configuration_variables",all(){const e=(0,v.ZP)("GET",b.DC(this.sourceUrl));e.catch((e=>{C.Z.error(`Fetching configuration variables failed with status: ${e}`,"Could not retrieve configuration variables")})),_.all.promise(e)},save(e){const t={id:e.id,name:e.name,description:e.description,content:e.content};let n,a,l=b.DC(`${this.sourceUrl}`);""===e.id?(n="POST",a="created"):(l+=`/${e.id}`,n="PUT",a="updated");const r=(0,v.ZP)(n,l,t);r.then((()=>{C.Z.success(`Configuration variable "${e.name}" successfully ${a}`)}),(t=>{C.Z.error(`Saving variable "${e.name}" failed with status: ${t.message}`,"Could not save variable")})),_.save.promise(r)},getConfigurations(e){const t=b.DC(`${this.sourceUrl}/${e.id}/configurations`),n=(0,v.ZP)("GET",t);n.catch((e=>{C.Z.error(`Fetching configurations for this variable failed with status: ${e}`)})),_.getConfigurations.promise(n)},delete(e){const t=b.DC(`${this.sourceUrl}/${e.id}`),n=(0,v.ZP)("DELETE",t);n.then((()=>{C.Z.success(`Configuration variable "${e.name}" successfully deleted`)}),(t=>{C.Z.error(`Deleting variable "${e.name}" failed with status: ${t.message}`,"Could not delete variable")})),_.delete.promise(n)},validate(e){const t={id:" ",name:" ",content:" "};i().merge(t,e);const n=(0,v.ZP)("POST",b.DC(`${this.sourceUrl}/validate`),t);n.catch((t=>{C.Z.error(`Validating variable "${e.name}" failed with status: ${t.message}`,"Could not validate variable")})),_.validate.promise(n)}})));var S=n("dFpwyWHg"),A=n.n(S),x=n("C2ikvoS0"),w=n.n(x),I=n("1IntWRSu"),T=n.n(I),D=n("8nGWeFnd"),B=n.n(D),R=n("TeAcaicX"),k=n.n(R),V=n("eE3+5goe"),M=n.n(V),F=n("fBELat8x"),P={};P.styleTagTransform=M(),P.setAttributes=B(),P.insert=T().bind(null,"head"),P.domAPI=w(),P.insertStyleElement=k();A()(F.Z,P);const N=F.Z&&F.Z.locals?F.Z.locals:void 0;function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Z extends r.Component{constructor(e){super(e),q(this,"_cleanState",(()=>{const{name:e,id:t,description:n,content:a}=this.props;return{error:!1,validation_errors:{},savedName:e,formData:{id:t,name:e,description:n,content:a}}})),q(this,"_hasErrors",(()=>{const{error:e}=this.state;return e})),q(this,"openModal",(()=>{this.setState(this._cleanState()),this.modal.open()})),q(this,"_getId",(e=>{const{id:t}=this.state;return`${e} ${t}`||"new"})),q(this,"_saved",(()=>{this.modal.close()})),q(this,"_validateFormData",(e=>{_.validate(e).then((e=>{this.setState({validation_errors:e.errors,error:e.failed})}))})),q(this,"_debouncedValidateFormData",(0,o.debounce)(this._validateFormData,200)),q(this,"_formDataUpdate",(e=>{const{formData:t}=this.state;return n=>{const a=(0,o.cloneDeep)(t);a[e]=n,this._debouncedValidateFormData(a),this.setState({formData:a})}})),q(this,"_save",(()=>{const{formData:e,savedName:t}=this.state,{saveConfigurationVariable:n}=this.props;this._hasErrors()?this._validateFormData(e):n(e,t,this._saved)})),q(this,"_handleInputChange",(e=>{this._formDataUpdate(e.target.name)(e.target.value)})),q(this,"_formatValidationMessage",((e,t)=>{const{validation_errors:n}=this.state;return n[e]?r.createElement("span",null,n[e][0]):r.createElement("span",null,t)})),q(this,"_validationState",(e=>{const{validation_errors:t}=this.state;return t[e]?"error":null})),this.state=this._cleanState()}render(){const{create:e}=this.props,{formData:t}=this.state;let n;return n=e?"Create Variable":r.createElement("span",null,"Edit"),r.createElement(r.Fragment,null,r.createElement(u.zx,{onClick:this.openModal,bsStyle:e?"success":"info",bsSize:e?"small":"xsmall",className:e?"pull-right":""},n),r.createElement(u.K$,{ref:e=>{this.modal=e},title:r.createElement(r.Fragment,null,e?"Create":"Edit"," Variable ${user.",t.name,"}"),onSubmitForm:this._save,onModalClose:this._cleanState,submitButtonDisabled:this._hasErrors(),submitButtonText:"Save"},r.createElement("fieldset",null,r.createElement(u.II,{type:"text",id:this._getId("variable-name"),label:"Name",name:"name",defaultValue:t.name,onChange:this._handleInputChange,bsStyle:this._validationState("name"),help:this._formatValidationMessage("name","Type a name for this variable"),autoFocus:!0,spellCheck:!1,required:!0}),r.createElement(u.II,{type:"text",id:this._getId("variable-description"),label:r.createElement("span",null,"Description ",r.createElement("small",{className:"text-muted"},"(Optional)")),name:"description",defaultValue:t.description,onChange:this._handleInputChange,help:"Type a description for this variable",spellCheck:!1}),r.createElement(u.II,{type:"textarea",id:this._getId("variable-content"),label:"Content",name:"content",rows:"10",className:N.monoSpaceFont,defaultValue:t.content,onChange:this._handleInputChange,bsStyle:this._validationState("content"),help:this._formatValidationMessage("content","Write your variable content"),spellCheck:!1,required:!0}))))}}q(Z,"propTypes",{create:l().bool,id:l().string,name:l().string,description:l().string,content:l().string,saveConfigurationVariable:l().func.isRequired}),q(Z,"defaultProps",{create:!1,id:"",name:"",description:"",content:""});const z=Z;function U(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class O extends r.Component{constructor(){super(...arguments),U(this,"state",{configurationVariables:void 0,errorModalContent:{},variableToDelete:{}}),U(this,"_reloadVariables",(()=>{_.all().then((e=>{this.setState({configurationVariables:e})}))})),U(this,"_closeErrorModal",(()=>{this.errorModal.close()})),U(this,"_renderConfigList",(e=>r.createElement("ul",{className:N.ulStyle},e.map((e=>r.createElement("li",{key:e.id},r.createElement("a",{href:m.ZP.SYSTEM.SIDECARS.EDIT_CONFIGURATION(e.id)},e.name))))))),U(this,"_handleDeleteConfirm",(()=>{const{variableToDelete:e}=this.state;_.delete(e).then((()=>this._onSuccessfulUpdate((()=>this.deleteConfirmModal.close()))))})),U(this,"_handleDeleteCheck",(e=>()=>{this.setState({variableToDelete:e}),_.getConfigurations(e).then((e=>{e.length>0?(this.setState({errorModalContent:this._renderConfigList(e)}),this.errorModal.open()):this.deleteConfirmModal.open()}))})),U(this,"_configurationVariableListBuilder",(()=>{const e=[],{configurationVariables:t}=this.state;return Object.values(t).forEach((t=>{const n=`\${user.${t.name}}`;e.push(r.createElement("tr",{key:t.id},r.createElement("td",null,r.createElement("code",null,n)),r.createElement("td",null,t.description),r.createElement("td",null,r.createElement(u.zx,{bsStyle:"primary",bsSize:"xsmall",onClick:this._handleDeleteCheck(t)},"Delete")," ",r.createElement(z,{id:t.id,name:t.name,description:t.description,content:t.content,create:!1,saveConfigurationVariable:this._saveConfigurationVariable}))))})),e})),U(this,"_isLoading",(()=>{const{configurationVariables:e}=this.state;return!e})),U(this,"_saveConfigurationVariable",((e,t,n)=>{const{onVariableRename:a}=this.props;_.save.triggerPromise(e).then((()=>this._onSuccessfulUpdate((()=>{a(t,e.name),n()}))))})),U(this,"_onSuccessfulUpdate",(e=>{"function"==typeof e&&e(),this._reloadVariables()}))}componentDidMount(){this._reloadVariables()}render(){if(this._isLoading())return r.createElement(c.$j,null);const{variableToDelete:e,errorModalContent:t}=this.state;return r.createElement("div",null,r.createElement(z,{create:!0,saveConfigurationVariable:this._saveConfigurationVariable}),r.createElement("div",{className:"clearfix"}),r.createElement("div",{className:`table-responsive ${N.tableMaxHeight}`},r.createElement(u.iA,{responsive:!0},r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Name"),r.createElement("th",null,"Description"),r.createElement("th",{className:N.actionsColumn},"Actions"))),r.createElement("tbody",null,this._configurationVariableListBuilder()))),r.createElement(u.uD,{ref:e=>{this.errorModal=e}},r.createElement(u.u_.Header,null,r.createElement(u.u_.Title,null,"Error deleting configuration variable ",r.createElement("strong",null,"${user.",e.name,"}"))),r.createElement(u.u_.Body,null,r.createElement(u.bZ,{bsStyle:"warning"},r.createElement("p",null,"Cannot delete this configuration variable as it is still in use. Please remove the variable from the following configurations and try again.",t))),r.createElement(u.u_.Footer,null,r.createElement(u.zx,{onClick:this._closeErrorModal},"Close"))),r.createElement(u.BF,{ref:e=>{this.deleteConfirmModal=e},title:"Delete Configuration Variable?",onConfirm:this._handleDeleteConfirm,onCancel:this._closeErrorModal},r.createElement("p",null,"Are you sure you want to remove the configuration variable ",r.createElement("strong",null,e.name),"?")))}}U(O,"propTypes",{onVariableRename:l().func.isRequired});const j=O;function L(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class J extends r.Component{constructor(){super(...arguments),L(this,"_getId",((e,t)=>e+(void 0!==t?`. ${t}`:"")))}render(){const{onVariableRename:e}=this.props;return r.createElement(u.s_,{header:"Collector Configuration Reference"},r.createElement(u.X2,{className:"row-sm"},r.createElement(u.JX,{md:12},r.createElement(u.mQ,{id:"configurationsHelper",defaultActiveKey:1,animation:!1},r.createElement(u.OK,{eventKey:1,title:"Runtime Variables"},r.createElement("p",{className:N.marginQuickReferenceText},"These variables will be filled with the runtime information from each Sidecar"),r.createElement(g,null)),r.createElement(u.OK,{eventKey:2,title:"Variables"},r.createElement("p",{className:N.marginQuickReferenceText},"Use variables to share text snippets across multiple configurations.",r.createElement("br",null),"If your configuration format needs to use literals like ",r.createElement("code",null,"${foo}"),", which shall not act as a variable, you will have to write it as",r.createElement("code",null,"${'$'}{foo}"),"."),r.createElement(j,{onVariableRename:e})),r.createElement(u.OK,{eventKey:3,title:"Reference"},r.createElement(u.X2,{className:"row-sm"},r.createElement(u.JX,{md:12},r.createElement("p",{className:N.marginQuickReferenceText},"We provide collector configuration templates to get you started.",r.createElement("br",null),"For further information please refer to the official documentation of your collector."),r.createElement("ul",{className:N.ulStyle},r.createElement("li",null,r.createElement("a",{href:"https://www.elastic.co/guide/en/beats/filebeat/current/index.html",target:"_blank",rel:"noopener noreferrer"},"Filebeat Reference")," "),r.createElement("li",null,r.createElement("a",{href:"https://www.elastic.co/guide/en/beats/winlogbeat/current/index.html",target:"_blank",rel:"noopener noreferrer"},"Winlogbeat Reference")," "),r.createElement("li",null,r.createElement("a",{href:"https://nxlog.co/docs/nxlog-ce/nxlog-reference-manual.html",target:"_blank",rel:"noopener noreferrer"},"NXLog Reference Manual")," ")))))))))}}L(J,"propTypes",{onVariableRename:l().func.isRequired});const W=J;function X(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class H extends r.Component{constructor(e){super(e),X(this,"resetState",(()=>{this.setState(H.initialState)})),X(this,"open",(()=>{this._loadConfiguration(),this.sourceModal.open()})),X(this,"hide",(()=>{this.sourceModal.close()})),X(this,"_loadConfiguration",(()=>{(this.props.templateString||this.props.configurationId)&&(this.props.templateString?p.Z.renderPreview(this.props.templateString).then((e=>{this.setState({source:e.preview,name:"preview"})}),(e=>{this.setState({source:`Error rendering preview: ${e.responseMessage?e.responseMessage:e}`})})):p.Z.getConfiguration(this.props.configurationId).then((e=>{this.setState({source:e.template,name:e.name})}),(e=>{this.setState({source:`Error fetching configuration: ${e.responseMessage||e}`})})))})),this.state=H.initialState}componentDidUpdate(e){i().isEqual(this.state,H.initialState)||i().isEqual(e,this.props)||this.resetState()}render(){return r.createElement(u.uD,{ref:e=>{this.sourceModal=e}},r.createElement(u.u_.Header,{closeButton:!0},r.createElement(u.u_.Title,null,r.createElement("span",null,"Configuration ",r.createElement("em",null,this.state.name)))),r.createElement(u.u_.Body,null,r.createElement("div",{className:"configuration"},r.createElement("pre",null,this.state.source||""))),r.createElement(u.u_.Footer,null,r.createElement(u.zx,{type:"button",onClick:this.hide},"Close")))}}X(H,"propTypes",{configurationId:l().string,templateString:l().string}),X(H,"defaultProps",{configurationId:void 0,templateString:void 0}),X(H,"initialState",{source:void 0,name:void 0});const K=H;var Q=n("UQF3Dyqs");function Y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class G extends r.Component{constructor(e){super(e),Y(this,"PAGE_SIZE",10),Y(this,"open",(()=>{this._loadUploads(this.state.pagination.page),this.uploadsModal.open()})),Y(this,"hide",(()=>{this.uploadsModal.close()})),Y(this,"_isLoading",(()=>!this.state.uploads)),Y(this,"_loadUploads",(e=>{p.Z.listUploads({page:e}).then((e=>{this.setState({uploads:e.uploads,totalUploads:e.total})}),(e=>{this.setState({uploads:[],totalUploads:0}),C.Z.error(`Fetching uploads failed with error: ${e}`,"Could not get configuration uploads")}))})),Y(this,"_onApplyButton",(e=>{this.props.onApply(e)})),Y(this,"_buildVariableName",(e=>`\${sidecar.${e}}`)),this.state=G.initialState}_formatUpload(e){const t=r.createElement(u.u,{id:`${e.id}-status-tooltip`},e.collector_id);return r.createElement("tr",{key:e.id},r.createElement("td",null,r.createElement(c.Ox,{placement:"top",overlay:t,rootClose:!0},r.createElement("span",null,e.node_id))),r.createElement("td",null,e.collector_name),r.createElement("td",null,r.createElement(c.EK,{dateTime:e.created})),r.createElement("td",null,r.createElement(u.zx,{bsStyle:"info",bsSize:"xsmall",onClick:()=>this._onApplyButton(e.rendered_configuration)},"Apply")))}_formatModalBody(){if(this._isLoading())return r.createElement(c.$j,null);const e=this.PAGE_SIZE,{uploads:t,totalUploads:n}=this.state,a=t.map((e=>this._formatUpload(e)));return 0===n?r.createElement(u.bZ,{bsStyle:"info"},r.createElement(c.JO,{name:"info-circle"}),"  There are no configuration uploads available. Please go to ",r.createElement("strong",null,"System -> Collectors (legacy) -> Details -> Import Configuration")," and import your first configuration. You need at least Sidecar version 0.1.8 to make this feature available."):r.createElement(c.l9,{totalItems:n,pageSize:e,showPageSizeSelect:!1,onChange:this._loadUploads,useQueryParameter:!1},r.createElement("table",{className:"table"},r.createElement("thead",null,r.createElement("tr",null,r.createElement("th",null,"Sidecar"),r.createElement("th",null,"Collector"),r.createElement("th",null,"Created"),r.createElement("th",null,"Action"))),r.createElement("tbody",null,a)))}render(){return r.createElement(Q.Z,{bsSize:"large",ref:e=>{this.uploadsModal=e}},r.createElement(u.u_.Header,{closeButton:!0},r.createElement(u.u_.Title,null,r.createElement("span",null,"Imports from the old Collector system")),"Edit the imported configuration after pressing the Apply button by hand. Dynamic values like the node ID can be replaced with the variables system, e.g. ",r.createElement("code",null,this._buildVariableName("nodeId"))),r.createElement(u.u_.Body,null,this._formatModalBody()),r.createElement(u.u_.Footer,null,r.createElement(u.zx,{type:"button",onClick:this.hide},"Close")))}}Y(G,"propTypes",{onApply:l().func.isRequired}),Y(G,"initialState",{uploads:void 0,totalUploads:0,pagination:{page:1}});const ee=G;var te=n("z+TeHMTq");const ne=e=>{let{tags:t,availableTags:n,onChange:a}=e;const l=t.join(","),o=n.map((e=>({value:e.name,label:e.name})));return r.createElement(te.Z,{options:o,value:l,onChange:a,placeholder:"Choose tags...",allowCreate:!0})};ne.propTypes={tags:l().arrayOf(l().string).isRequired,availableTags:l().array.isRequired,onChange:l().func.isRequired};const ae=ne,le=e=>{let{action:t,configuration:n,configurationSidecars:a}=e;const l={id:n.id,name:n.name,color:n.color,collector_id:n.collector_id,template:n.template||"",tags:n.tags||[]},[o,g]=(0,r.useState)([]),[f,E]=(0,r.useState)(l),[b,C]=(0,r.useState)(!1),[v,y]=(0,r.useState)({}),_=(0,r.useRef)(null),S=(0,r.useRef)(null),A=(0,r.useRef)({});(0,r.useEffect)((()=>{h.v.all().then((e=>g(e.collectors)))}),[]);const x=e=>void 0!==e&&""!==e,w=()=>b||!x(f.template),I=(e,t)=>{p.Z.validate(e).then((n=>{const a=i().clone(n);t&&!x(e.template)&&(a.errors.template=["Please fill out the configuration field."],a.failed=!0),y(a.errors),C(a.failed)}))},T=i().debounce(I,200),D=e=>(t,n,a)=>{const l=i().cloneDeep(f);l[e]=t,T(l,!1),E(l),a&&a()},B=e=>{D("template")(e)},R=async e=>{const t=await(e=>{const t=A.current[e];return void 0!==t?new Promise((e=>e(t))):h.v.getCollector(e).then((t=>(A.current[e]=t.default_template,t.default_template)))})(e),n=i().cloneDeep(f);n.collector_id=e,n.template&&!window.confirm("Do you want to use the default template for the selected Configuration?")||(B(t),n.template=t),E(n)},k=e=>e?`${e.name} on ${i().upperFirst(e.node_operating_system)}`:"Unknown collector",V=()=>{const e=[];return o?o.forEach((t=>{e.push({value:t.id,label:k(t)})})):e.push({value:"none",label:"Loading collector list...",disable:!0}),e},M=(e,t)=>v[e]?r.createElement("span",null,v[e][0]):r.createElement("span",null,t),F=e=>v[e]?"error":null;return r.createElement(u.X2,{className:"content"},r.createElement(u.JX,{md:6},r.createElement("div",null,r.createElement("form",{onSubmit:e=>{e.preventDefault(),w()?I(f,!0):"create"===t?p.Z.createConfiguration(f).then((()=>s.Z.push(m.ZP.SYSTEM.SIDECARS.CONFIGURATION))):p.Z.updateConfiguration(f)}},r.createElement("fieldset",null,r.createElement(u.II,{type:"text",id:"name",label:"Name",onChange:e=>{const t=e.target.value;D("name")(t)},bsStyle:F("name"),help:M("name","Required. Name for this configuration"),value:f.name||"",autoFocus:!0,required:!0}),r.createElement(u.cw,{controlId:"color"},r.createElement(u.J$,null,"Configuration color"),r.createElement("div",null,r.createElement(d.Z,{color:f.color}),r.createElement("div",{style:{display:"inline-block",marginLeft:15}},r.createElement(c.h4,{id:"color",placement:"right",color:f.color,triggerNode:r.createElement(u.zx,{bsSize:"xsmall"},"Change color"),onChange:D("color")}))),r.createElement(u.Qb,null,"Choose a color to use for this configuration.")),r.createElement(u.cw,{controlId:"tags"},r.createElement(u.J$,null,"Configuration Assignment Tags"),r.createElement("div",null,r.createElement(ae,{availableTags:f.tags.map((e=>({name:e}))),tags:f.tags,onChange:e=>{const t=e.split(",");D("tags")(t)}})),r.createElement(u.Qb,null,"Sidecars which are configured with a matching tag will automatically receive this configuration.")),r.createElement(u.cw,{controlId:"collector_id"},r.createElement(u.J$,null,"Collector"),((e,t,n)=>{if(n.sidecar_ids&&n.sidecar_ids.length>0){const n=t?t.find((t=>t.id===e)):void 0;return r.createElement("span",null,r.createElement(u.NI.Static,null,k(n)),r.createElement(u.Qb,{bsClass:"warning"},r.createElement("b",null,"Note:")," Log Collector cannot change while the Configuration is in use. Clone the Configuration to test it using another Collector."))}return r.createElement("span",null,r.createElement(c.Ph,{inputId:"collector_id",options:V(),value:e,onChange:R,placeholder:"Collector",required:!0}),r.createElement(u.Qb,null,"Choose the log collector this configuration is meant for."))})(f.collector_id,o,a)),r.createElement(u.cw,{controlId:"template",validationState:F("template")},r.createElement(u.J$,null,"Configuration"),r.createElement(c.KB,{id:"template",height:400,value:f.template||"",onChange:B}),r.createElement(u.zx,{className:"pull-right",bsStyle:"link",bsSize:"sm",onClick:()=>{_.current.open()}},"Preview"),r.createElement(u.zx,{className:"pull-right",bsStyle:"link",bsSize:"sm",onClick:()=>{S.current.open()}},"Migrate"),r.createElement(u.Qb,null,M("template","Required. Collector configuration, see quick reference for more information.")))),r.createElement(u.X2,null,r.createElement(u.JX,{md:12},r.createElement(c.Ow,{submitButtonText:("create"===t?"Create":"Update")+" configuration",disabledSubmit:w(),onCancel:()=>{s.Z.goBack()}})))),r.createElement(K,{ref:_,templateString:f.template}),r.createElement(ee,{ref:S,onApply:e=>{i().cloneDeep(f).template&&!window.confirm("Do you want to overwrite your current work with this Configuration?")||B(e)}}))),r.createElement(u.JX,{md:6},r.createElement(W,{onVariableRename:(e,t)=>{if(""===e||e===t)return;const n=f.template.split(`\${user.${e}}`).join(`\${user.${t}}`);B(n)}})))};le.propTypes={action:l().oneOf(["create","edit"]),configuration:l().shape({id:l().string.isRequired,name:l().string.isRequired,color:l().string.isRequired,collector_id:l().string.isRequired,template:l().string.isRequired,tags:l().array.isRequired}),configurationSidecars:l().object},le.defaultProps={action:"edit",configuration:{color:"#FFFFFF",template:""},configurationSidecars:{}};const re=le},fBELat8x:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n("pmX897Fv"),l=n.n(a),r=n("DjJvgDaP"),o=n.n(r)()(l());o.push([e.id,'.xPV2VE7mx5w5RbxBVwcf {\n    margin-top: 20px;\n}\n\n.vjxO58xdx2DWfSbCtDqn {\n    margin-top: 10px;\n}\n\n.nV67tChjqzGMJgFSXjEh {\n    white-space: pre-wrap;\n}\n\n.panel-body h3 {\n    margin-bottom: 5px;\n}\n\n.Ljky5PvbEjtFMEvWjPom {\n\tmax-height: 400px;\n}\n\n.cqjNB6UHuqa0fd42yYFA {\n    font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n\n.heyPYufeKzilLrTBlkcz {\n    list-style-type: disc;\n    padding-left: 20px;\n    padding-top: 20px;\n}\n\n.IukKgOWYiWDLjEX1JJif {\n    width: 120px;\n}\n',"",{version:3,sources:["webpack://./src/components/sidecars/configuration-forms/ConfigurationHelper.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB;;AAEA;IACI,gBAAgB;AACpB;;AAEA;IACI,qBAAqB;AACzB;;AAEA;IACI,kBAAkB;AACtB;;AAEA;CACC,iBAAiB;AAClB;;AAEA;IACI,6EAA6E;AACjF;;AAEA;IACI,qBAAqB;IACrB,kBAAkB;IAClB,iBAAiB;AACrB;;AAEA;IACI,YAAY;AAChB",sourcesContent:[':local(.marginQuickReferenceText) {\n    margin-top: 20px;\n}\n\n:local(.marginTab) {\n    margin-top: 10px;\n}\n\n:local(.exampleFunction) {\n    white-space: pre-wrap;\n}\n\n.panel-body h3 {\n    margin-bottom: 5px;\n}\n\n:local(.tableMaxHeight) {\n\tmax-height: 400px;\n}\n\n:local(.monoSpaceFont) {\n    font-family: "Roboto Mono", Menlo, Monaco, Consolas, "Courier New", monospace;\n}\n\n:local(.ulStyle) {\n    list-style-type: disc;\n    padding-left: 20px;\n    padding-top: 20px;\n}\n\n:local(.actionsColumn) {\n    width: 120px;\n}\n'],sourceRoot:""}]),o.locals={marginQuickReferenceText:"xPV2VE7mx5w5RbxBVwcf",marginTab:"vjxO58xdx2DWfSbCtDqn",exampleFunction:"nV67tChjqzGMJgFSXjEh",tableMaxHeight:"Ljky5PvbEjtFMEvWjPom",monoSpaceFont:"cqjNB6UHuqa0fd42yYFA",ulStyle:"heyPYufeKzilLrTBlkcz",actionsColumn:"IukKgOWYiWDLjEX1JJif"};const i=o}}]);
//# sourceMappingURL=325e2d4b-6781.2c1df8921aac52345db1.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy