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

web-interface.assets.bb8c8232-408.fdc5256fb7803ab51840.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([["bb8c8232-408"],{orZs56L0:(O,v,t)=>{t.d(v,{A:()=>o});var f=t("pmX897Fv"),s=t.n(f),e=t("DjJvgDaP"),u=t.n(e),_=u()(s());_.push([O.id,`.deflist {
    margin-top: 10px;
}

.deflist dt {
    float: left;
    clear: left;
}

.deflist dd {
    margin-left: 160px;
}
`,"",{version:3,sources:["webpack://./src/components/content-packs/ContentPackDetails.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB;;AAEA;IACI,WAAW;IACX,WAAW;AACf;;AAEA;IACI,kBAAkB;AACtB",sourcesContent:[`.deflist {
    margin-top: 10px;
}

.deflist dt {
    float: left;
    clear: left;
}

.deflist dd {
    margin-left: 160px;
}
`],sourceRoot:""}]),_.locals={};const o=_},"Rk/JpmFK":(O,v,t)=>{t.d(v,{A:()=>o});var f=t("pmX897Fv"),s=t.n(f),e=t("DjJvgDaP"),u=t.n(e),_=u()(s());_.push([O.id,`.ZgR74ksb6mj0t6nhIdAa tbody {
    max-height: 300px;
    overflow: hidden;
    overflow-y: auto;
    display:block;
}

.ZgR74ksb6mj0t6nhIdAa thead, .ZgR74ksb6mj0t6nhIdAa tbody tr {
    display:table;
    width:100%;
    table-layout:fixed;
}

.gvap9SNPgrZJANw2FHrt {
    word-wrap: break-word;
}
`,"",{version:3,sources:["webpack://./src/components/content-packs/ContentPackParameterList.css"],names:[],mappings:"AAAA;IACI,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;AACjB;;AAEA;IACI,aAAa;IACb,UAAU;IACV,kBAAkB;AACtB;;AAEA;IACI,qBAAqB;AACzB",sourcesContent:[`:local(.scrollable) tbody {
    max-height: 300px;
    overflow: hidden;
    overflow-y: auto;
    display:block;
}

:local(.scrollable) thead, :local(.scrollable) tbody tr {
    display:table;
    width:100%;
    table-layout:fixed;
}

:local(.bigColumns) {
    word-wrap: break-word;
}
`],sourceRoot:""}]),_.locals={scrollable:"ZgR74ksb6mj0t6nhIdAa",bigColumns:"gvap9SNPgrZJANw2FHrt"};const o=_},tq3qR0En:(O,v,t)=>{t.d(v,{A:()=>D});var f=t("ii0bleBb"),s=t.n(f),e=t("Z7aTuO5B"),u=t("VPaD/Np4"),_=t.n(u),o=t("IOI9nV80"),y=t("rIl5IEuP"),T=Object.defineProperty,M=(c,l,n)=>l in c?T(c,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[l]=n,p=(c,l,n)=>(M(c,typeof l!="symbol"?l+"":l,n),n);class C extends e.Component{constructor(){super(...arguments),p(this,"_rowFormatter",l=>{const{isFulfilled:n}=this.props,i=l.constraint||l;i.fulfilled=n||i.fulfilled;const d=i.type==="server-version"?"Graylog":i.plugin;return e.createElement("tr",{key:i.id},e.createElement("td",null,d),e.createElement("td",null,i.type),e.createElement("td",null,i.version),e.createElement("td",null,e.createElement(y.Badge,{bsStyle:i.fulfilled?"success":"danger"},e.createElement(o.In,{name:i.fulfilled?"check_circle":"cancel"}))))})}render(){const{constraints:l}=this.props,n=["Name","Type","Version","Fulfilled"];let i=l.map(d=>{const B=d.constraint||d;return B.fulfilled=d.fulfilled,B});return typeof i.toArray=="function"&&(i=i.toArray()),e.createElement("div",null,e.createElement("h2",null,"Constraints"),e.createElement("br",null),e.createElement("br",null),e.createElement(o.bQ,{id:"content-packs-constraints",headers:n,headerCellFormatter:d=>e.createElement("th",null,d),sortBy:d=>d.constraint?d.constraint.type:d.type,dataRowFormatter:this._rowFormatter,rows:i,filterKeys:[]}))}}p(C,"propTypes",{constraints:s().oneOfType([s().object,s().array]),isFulfilled:s().bool}),p(C,"defaultProps",{constraints:(0,u.Set)(),isFulfilled:!1});const D=C},"G9zy4OD/":(O,v,t)=>{t.d(v,{A:()=>c});var f=t("ii0bleBb"),s=t.n(f),e=t("Z7aTuO5B"),u=t("rIl5IEuP"),_=t("EL/SQmS6"),o=t("tq3qR0En"),y=t("vyEB9hoZ"),T=t("4Bzr8nEu"),M=t("snvX9lMq"),p=t("MdYBRjRJ"),C=t("s14Hze4o");const D=l=>{const{contentPack:n,offset:i,verbose:d,constraints:B,showConstraints:W}=l;let S=n.url;try{(0,p.uH)(n.url)&&(S=e.createElement("a",{href:n.url},n.url))}catch{}return e.createElement(u.Row,null,e.createElement(u.Col,{smOffset:i,sm:9},e.createElement("div",{id:"content-pack-details"},e.createElement("h2",null,"Details"),e.createElement("br",null),e.createElement("div",null,e.createElement("dl",{className:"deflist"},e.createElement("dt",null,"Version:")," ",e.createElement("dd",null,n.rev),e.createElement("dt",null,"Name:")," ",e.createElement("dd",null,n.name,"\xA0"),e.createElement("dt",null,"Summary:")," ",e.createElement("dd",null,n.summary,"\xA0"),e.createElement("dt",null,"Vendor:")," ",e.createElement("dd",null,n.vendor,"\xA0"),e.createElement("dt",null,"URL:")," ",e.createElement("dd",null,S,"\xA0"),n.id&&e.createElement("span",null,e.createElement("dt",null,"ID:")," ",e.createElement("dd",null,e.createElement("code",null,n.id))),n.parameters&&!d&&e.createElement("span",null,e.createElement("dt",null,"Parameters:")," ",e.createElement("dd",null,n.parameters.length)),n.entities&&!d&&e.createElement("span",null,e.createElement("dt",null,"Entities:")," ",e.createElement("dd",null,n.entities.length)))),n.description&&e.createElement("div",null,e.createElement("h2",null,"Description"),e.createElement("br",null),e.createElement(u.Well,null,e.createElement(C.A,{text:n.description}))),e.createElement("br",null),n.status&&e.createElement(_.A,{states:n.states}),e.createElement("br",null),e.createElement("br",null),n.constraints&&W&&e.createElement("div",null,e.createElement(o.A,{constraints:B}),e.createElement("br",null)),n.entities&&n.entities.length>0&&d&&e.createElement(y.A,{contentPack:n,readOnly:!0}),n.parameters&&n.parameters.length>0&&d&&e.createElement(T.A,{contentPack:n,readOnly:!0}))))};D.propTypes={contentPack:s().object.isRequired,constraints:s().arrayOf(s().object),verbose:s().bool,offset:s().number,showConstraints:s().bool},D.defaultProps={offset:1,verbose:!1,showConstraints:!1,constraints:[]};const c=D},"4Bzr8nEu":(O,v,t)=>{t.d(v,{A:()=>Q});var f=t("ii0bleBb"),s=t.n(f),e=t("Z7aTuO5B"),u=t("lhAGFr4h"),_=t.n(u),o=t("rIl5IEuP"),y=t("IOI9nV80"),T=t("gqVHlIxA"),M=t("S6FuRS7B"),p=t("QdZ7Yq43"),C=t("iAkLQLhv"),D=Object.defineProperty,c=(P,r,a)=>r in P?D(P,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):P[r]=a,l=(P,r,a)=>(c(P,typeof r!="symbol"?r+"":r,a),a);const n=class x extends e.Component{constructor(r){super(r),l(this,"addNewParameter",a=>{if(a&&a.preventDefault(),!this._validateParameter())return;const m=C.A.convertValue(this.state.newParameter.type,this.state.newParameter.default_value),E=p.A.clone(this.state.newParameter);E.default_value=m,this.props.onUpdateParameter(E),this.titleInput.getInputDOMNode().focus(),this.setState({newParameter:p.A.clone(x.emptyParameter)})}),l(this,"_updateField",(a,m)=>{const E=p.A.clone(this.state.newParameter);E[a]=m,this.setState({newParameter:E})}),l(this,"_bindValue",a=>{this._updateField(a.target.name,M.yG(a.target))}),l(this,"_validateName",()=>{const a=this.state.newParameter.name;return a.match(/\W/)?(this.setState({nameError:"The parameter name must only contain A-Z, a-z, 0-9 and _"}),!1):(this.props.parameterToEdit||{}).name!==a&&this.props.parameters.findIndex(m=>m.name===a)>=0?(this.setState({nameError:"The parameter name must be unique."}),!1):(this.setState({nameError:void 0}),!0)}),l(this,"_validateDefaultValue",()=>{const a=this.state.newParameter.default_value;if(a)switch(this.state.newParameter.type){case"integer":{if(`${parseInt(a,10)}`!==a)return this.setState({defaultValueError:"This is not an integer value."}),!1;break}case"double":{if(isNaN(a))return this.setState({defaultValueError:"This is not a double value."}),!1;break}case"boolean":{if(a!=="true"&&a!=="false")return this.setState({defaultValueError:"This is not a boolean value. It must be either true or false."}),!1;break}default:break}return this.setState({defaultValueError:void 0}),!0}),this.state={newParameter:r.parameterToEdit||p.A.clone(x.emptyParameter),defaultValueError:void 0,nameError:void 0,titleError:void 0,descrError:void 0}}_validateParameter(){const r=this.state.newParameter;return r.name?(this.setState({nameError:void 0}),r.title?(this.setState({titleError:void 0}),r.description?(this.setState({descrError:void 0}),this._validateDefaultValue()&&this._validateName()):(this.setState({descrError:"Description must be set."}),!1)):(this.setState({titleError:"Title must be set."}),!1)):(this.setState({nameError:"Name must be set."}),!1)}render(){const r=this.props.parameterToEdit?"Edit parameter":"Create parameter",a=!!this.props.parameterToEdit;return e.createElement("div",null,e.createElement("h2",null,r),e.createElement("br",null),e.createElement("form",{className:"parameter-form",id:"parameter-form",onSubmit:this.addNewParameter},e.createElement("fieldset",null,e.createElement(o.Input,{ref:m=>{this.titleInput=m},name:"title",id:"title",type:"text",maxLength:250,value:this.state.newParameter.title,onChange:this._bindValue,bsStyle:this.state.titleError?"error":null,label:"Title",help:this.state.titleError?this.state.titleError:"Give a descriptive title for this content pack.",required:!0}),e.createElement(o.Input,{name:"name",id:"name",type:"text",maxLength:250,bsStyle:this.state.nameError?"error":null,value:this.state.newParameter.name,onChange:this._bindValue,label:"Name",help:this.state.nameError?this.state.nameError:"This is used as the parameter reference and must not contain a space.",required:!0}),e.createElement(o.Input,{name:"description",id:"description",type:"text",bsStyle:this.state.descrError?"error":null,maxLength:250,value:this.state.newParameter.description,onChange:this._bindValue,label:"Description",help:this.state.descrError?this.state.descrError:"Give a description explaining what will be done with this parameter.",required:!0}),e.createElement(o.Input,{name:"type",id:"type",type:"select",disabled:a,value:this.state.newParameter.type,onChange:this._bindValue,label:"Value Type",help:"Give the type of the parameter.",required:!0},e.createElement("option",{value:"string"},"String"),e.createElement("option",{value:"integer"},"Integer"),e.createElement("option",{value:"double"},"Double"),e.createElement("option",{value:"boolean"},"Boolean")),e.createElement(o.Input,{name:"default_value",id:"default_value",type:"text",maxLength:250,bsStyle:this.state.defaultValueError?"error":null,value:this.state.newParameter.default_value,onChange:this._bindValue,label:"Default value",help:this.state.defaultValueError?this.state.defaultValueError:"Give a default value if the parameter is not optional."}))))}};l(n,"propTypes",{onUpdateParameter:s().func,parameters:s().array,parameterToEdit:s().object}),l(n,"defaultProps",{onUpdateParameter:()=>{},parameters:[],parameterToEdit:void 0}),l(n,"emptyParameter",{name:"",title:"",description:"",type:"string",default_value:""});const d=n;var B=t("dFpwyWHg"),W=t.n(B),S=t("C2ikvoS0"),F=t.n(S),N=t("1IntWRSu"),V=t.n(N),X=t("8nGWeFnd"),Z=t.n(X),k=t("TeAcaicX"),z=t.n(k),G=t("eE3+5goe"),H=t.n(G),L=t("Rk/JpmFK"),b={};b.styleTagTransform=H(),b.setAttributes=Z(),b.insert=V().bind(null,"head"),b.domAPI=F(),b.insertStyleElement=z();var te=W()(L.A,b);const U=L.A&&L.A.locals?L.A.locals:void 0;var w=Object.defineProperty,J=(P,r,a)=>r in P?w(P,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):P[r]=a,g=(P,r,a)=>(J(P,typeof r!="symbol"?r+"":r,a),a);class K extends e.Component{constructor(r){super(r),g(this,"_parameterApplied",a=>{const{appliedParameter:m}=this.props,E=Object.keys(m);for(const A in E){const h=m[E[A]];if(_()(h,{paramName:a})>=0)return!0}return!1}),g(this,"_parameterRowFormatter",a=>{const{onDeleteParameter:m,readOnly:E}=this.props,A=this._parameterApplied(a.name),h=A?"Still in use":"Delete Parameter",R=A?"check_circle":"cancel",I=A?"success":"failure";return e.createElement("tr",{key:a.title},e.createElement("td",{className:U.bigColumns},a.title),e.createElement("td",null,a.name),e.createElement("td",{className:U.bigColumns},a.description),e.createElement("td",null,a.type),e.createElement("td",null,C.A.convertToString(a)),e.createElement("td",null,e.createElement(o.Badge,{className:I},e.createElement(y.In,{name:R}))),!E&&e.createElement("td",null,e.createElement(o.ButtonToolbar,null,e.createElement(o.Button,{bsStyle:"primary",bsSize:"xs",title:h,disabled:A,onClick:()=>{m(a)}},"Delete"),this._parameterModal(a))))}),g(this,"_filterParameters",(a,m)=>{const{contentPack:E}=this.props,A=p.A.clone(m||E.parameters);if(!a||a.length<=0){this.setState({filteredParameters:A,filter:void 0});return}const h=RegExp(a,"i"),R=A.filter(I=>h.test(I.title)||h.test(I.description)||h.test(I.name));this.setState({filteredParameters:R,filter:a})}),this.state={showModal:!1,filteredParameters:r.contentPack.parameters||[],filter:void 0}}UNSAFE_componentWillReceiveProps(r){const{filter:a}=this.state;this._filterParameters(a,r.contentPack.parameters)}_parameterModal(r){let a;const{contentPack:m,onAddParameter:E}=this.props,{showModal:A}=this.state,h=()=>{this.setState({showModal:!1})},R=()=>{this.setState({showModal:!0})},I=()=>{a.addNewParameter()},Y=r?"xsmall":"small",$=r?"Edit parameter":"Create parameter",q=r?"Edit":"Create parameter",ee=e.createElement(T.A,{showModal:A,onHide:h,bsSize:"large"},e.createElement(o.Modal.Header,{closeButton:!0},e.createElement(o.Modal.Title,null,"Parameter")),e.createElement(o.Modal.Body,null,e.createElement(d,{ref:j=>{a=j},parameters:m.parameters,onUpdateParameter:j=>{E(j,r),h()},parameterToEdit:r})),e.createElement(o.Modal.Footer,null,e.createElement(y.E6,{onSubmit:I,onCancel:h,submitButtonText:$})));return e.createElement(e.Fragment,null,e.createElement(o.Button,{bsStyle:"info",bsSize:Y,title:"Edit Modal",onClick:R},q),ee)}render(){const{readOnly:r}=this.props,{filteredParameters:a}=this.state,m=r?["Title","Name","Description","Value Type","Default Value","Used"]:["Title","Name","Description","Value Type","Default Value","Used","Action"];return e.createElement("div",null,e.createElement("h2",null,"Parameters list"),e.createElement("br",null),!r&&this._parameterModal(),!r&&e.createElement("span",null,e.createElement("br",null),e.createElement("br",null)),e.createElement(y.B9,{onSearch:this._filterParameters,onReset:()=>{this._filterParameters("")}}),e.createElement(y.bQ,{id:"parameter-list",headers:m,className:U.scrollable,sortByKey:"title",noDataText:"To use parameters for content packs, at first a parameter must be created and can then be applied to a entity.",filterKeys:[],rows:a,dataRowFormatter:this._parameterRowFormatter}))}}g(K,"propTypes",{contentPack:s().object.isRequired,readOnly:s().bool,onDeleteParameter:s().func,onAddParameter:s().func,appliedParameter:s().object}),g(K,"defaultProps",{readOnly:!1,onDeleteParameter:()=>{},onAddParameter:()=>{},appliedParameter:{}});const Q=K},snvX9lMq:(O,v,t)=>{var f=t("dFpwyWHg"),s=t.n(f),e=t("C2ikvoS0"),u=t.n(e),_=t("1IntWRSu"),o=t.n(_),y=t("8nGWeFnd"),T=t.n(y),M=t("TeAcaicX"),p=t.n(M),C=t("eE3+5goe"),D=t.n(C),c=t("orZs56L0"),l={};l.styleTagTransform=D(),l.setAttributes=T(),l.insert=o().bind(null,"head"),l.domAPI=u(),l.insertStyleElement=p();var n=s()(c.A,l),i=c.A&&c.A.locals?c.A.locals:void 0}}]);})();

//# sourceMappingURL=bb8c8232-408.fdc5256fb7803ab51840.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy