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

web-interface.assets.1255d548-7664.68ab3f580b20c9d96409.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-7664"],{orZs56L0:(M,D,t)=>{t.d(D,{Z:()=>s});var h=t("pmX897Fv"),l=t.n(h),e=t("DjJvgDaP"),_=t.n(e),E=_()(l());E.push([M.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:""}]),E.locals={};const s=E},"Rk/JpmFK":(M,D,t)=>{t.d(D,{Z:()=>s});var h=t("pmX897Fv"),l=t.n(h),e=t("DjJvgDaP"),_=t.n(e),E=_()(l());E.push([M.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:""}]),E.locals={scrollable:"ZgR74ksb6mj0t6nhIdAa",bigColumns:"gvap9SNPgrZJANw2FHrt"};const s=E},tq3qR0En:(M,D,t)=>{t.d(D,{Z:()=>i});var h=t("ii0bleBb"),l=t.n(h),e=t("Z7aTuO5B"),_=t("VPaD/Np4"),E=t.n(_),s=t("J6y4/h8P"),A=t("/GOzvPf6"),B=t("uZqmR+ju"),b=Object.defineProperty,v=(n,o,d)=>o in n?b(n,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):n[o]=d,O=(n,o,d)=>(v(n,typeof o!="symbol"?o+"":o,d),d);const T=(0,s.default)(({isFulfilled:n,theme:o,...d})=>e.createElement(B.Badge,{...d}))`
  background-color: ${({isFulfilled:n,theme:o})=>n?o.colors.variant.success:o.colors.variant.danger};
`;class P extends e.Component{constructor(){super(...arguments),O(this,"_rowFormatter",o=>{const{isFulfilled:d}=this.props,m=o.constraint||o;m.fulfilled=d||m.fulfilled;const u=m.type==="server-version"?"Graylog":m.plugin;return e.createElement("tr",{key:m.id},e.createElement("td",null,u),e.createElement("td",null,m.type),e.createElement("td",null,m.version),e.createElement("td",null,e.createElement(T,{isFulfilled:m.fulfilled},e.createElement(A.JO,{name:m.fulfilled?"check":"times"}))))})}render(){const{constraints:o}=this.props,d=["Name","Type","Version","Fulfilled"];let m=o.map(u=>{const I=u.constraint||u;return I.fulfilled=u.fulfilled,I});return typeof m.toArray=="function"&&(m=m.toArray()),e.createElement("div",null,e.createElement("h2",null,"Constraints"),e.createElement("br",null),e.createElement("br",null),e.createElement(A.wQ,{id:"content-packs-constraints",headers:d,headerCellFormatter:u=>e.createElement("th",null,u),sortBy:u=>u.constraint?u.constraint.type:u.type,dataRowFormatter:this._rowFormatter,rows:m,filterKeys:[]}))}}O(P,"propTypes",{constraints:l().oneOfType([l().object,l().array]),isFulfilled:l().bool}),O(P,"defaultProps",{constraints:(0,_.Set)(),isFulfilled:!1});const i=P},"G9zy4OD/":(M,D,t)=>{t.d(D,{Z:()=>P});var h=t("ii0bleBb"),l=t.n(h),e=t("Z7aTuO5B"),_=t("uZqmR+ju"),E=t("EL/SQmS6"),s=t("tq3qR0En"),A=t("vyEB9hoZ"),B=t("4Bzr8nEu"),b=t("snvX9lMq"),v=t("MdYBRjRJ"),O=t("s14Hze4o");const T=i=>{const{contentPack:n,offset:o,verbose:d,constraints:m,showConstraints:u}=i;let I=n.url;try{(0,v.er)(n.url)&&(I=e.createElement("a",{href:n.url},n.url))}catch{}return e.createElement(_.Row,null,e.createElement(_.Col,{smOffset:o,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,I,"\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(_.Well,null,e.createElement(O.Z,{text:n.description}))),e.createElement("br",null),n.status&&e.createElement(E.Z,{states:n.states}),e.createElement("br",null),e.createElement("br",null),n.constraints&&u&&e.createElement("div",null,e.createElement(s.Z,{constraints:m}),e.createElement("br",null)),n.entities&&n.entities.length>0&&d&&e.createElement(A.Z,{contentPack:n,readOnly:!0}),n.parameters&&n.parameters.length>0&&d&&e.createElement(B.Z,{contentPack:n,readOnly:!0}))))};T.propTypes={contentPack:l().object.isRequired,constraints:l().arrayOf(l().object),verbose:l().bool,offset:l().number,showConstraints:l().bool},T.defaultProps={offset:1,verbose:!1,showConstraints:!1,constraints:[]};const P=T},"4Bzr8nEu":(M,D,t)=>{t.d(D,{Z:()=>Q});var h=t("ii0bleBb"),l=t.n(h),e=t("Z7aTuO5B"),_=t("lhAGFr4h"),E=t.n(_),s=t("uZqmR+ju"),A=t("/GOzvPf6"),B=t("gqVHlIxA"),b=t("S6FuRS7B"),v=t("QdZ7Yq43"),O=t("iAkLQLhv"),T=Object.defineProperty,P=(f,r,a)=>r in f?T(f,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):f[r]=a,i=(f,r,a)=>(P(f,typeof r!="symbol"?r+"":r,a),a);const n=class Z extends e.Component{constructor(r){super(r),i(this,"addNewParameter",a=>{if(a&&a.preventDefault(),!this._validateParameter())return;const c=O.Z.convertValue(this.state.newParameter.type,this.state.newParameter.default_value),p=v.Z.clone(this.state.newParameter);p.default_value=c,this.props.onUpdateParameter(p),this.titleInput.getInputDOMNode().focus(),this.setState({newParameter:v.Z.clone(Z.emptyParameter)})}),i(this,"_updateField",(a,c)=>{const p=v.Z.clone(this.state.newParameter);p[a]=c,this.setState({newParameter:p})}),i(this,"_bindValue",a=>{this._updateField(a.target.name,b.n6(a.target))}),i(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(c=>c.name===a)>=0?(this.setState({nameError:"The parameter name must be unique."}),!1):(this.setState({nameError:void 0}),!0)}),i(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||v.Z.clone(Z.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(s.Input,{ref:c=>{this.titleInput=c},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(s.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(s.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(s.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(s.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."}))))}};i(n,"propTypes",{onUpdateParameter:l().func,parameters:l().array,parameterToEdit:l().object}),i(n,"defaultProps",{onUpdateParameter:()=>{},parameters:[],parameterToEdit:void 0}),i(n,"emptyParameter",{name:"",title:"",description:"",type:"string",default_value:""});const d=n;var m=t("dFpwyWHg"),u=t.n(m),I=t("C2ikvoS0"),F=t.n(I),x=t("1IntWRSu"),N=t.n(x),V=t("8nGWeFnd"),X=t.n(V),k=t("TeAcaicX"),z=t.n(k),G=t("eE3+5goe"),J=t.n(G),W=t("Rk/JpmFK"),R={};R.styleTagTransform=J(),R.setAttributes=X(),R.insert=N().bind(null,"head"),R.domAPI=F(),R.insertStyleElement=z();var te=u()(W.Z,R);const U=W.Z&&W.Z.locals?W.Z.locals:void 0;var w=Object.defineProperty,H=(f,r,a)=>r in f?w(f,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):f[r]=a,S=(f,r,a)=>(H(f,typeof r!="symbol"?r+"":r,a),a);class K extends e.Component{constructor(r){super(r),S(this,"_parameterApplied",a=>{const{appliedParameter:c}=this.props,p=Object.keys(c);for(const y in p){const C=c[p[y]];if(E()(C,{paramName:a})>=0)return!0}return!1}),S(this,"_parameterRowFormatter",a=>{const{onDeleteParameter:c,readOnly:p}=this.props,y=this._parameterApplied(a.name),C=y?"Still in use":"Delete Parameter",L=y?"check":"times",g=y?"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,O.Z.convertToString(a)),e.createElement("td",null,e.createElement(s.Badge,{className:g},e.createElement(A.JO,{name:L}))),!p&&e.createElement("td",null,e.createElement(s.ButtonToolbar,null,e.createElement(s.Button,{bsStyle:"primary",bsSize:"xs",title:C,disabled:y,onClick:()=>{c(a)}},"Delete"),this._parameterModal(a))))}),S(this,"_filterParameters",(a,c)=>{const{contentPack:p}=this.props,y=v.Z.clone(c||p.parameters);if(!a||a.length<=0){this.setState({filteredParameters:y,filter:void 0});return}const C=RegExp(a,"i"),L=y.filter(g=>C.test(g.title)||C.test(g.description)||C.test(g.name));this.setState({filteredParameters:L,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:c,onAddParameter:p}=this.props,{showModal:y}=this.state,C=()=>{this.setState({showModal:!1})},L=()=>{this.setState({showModal:!0})},g=()=>{a.addNewParameter()},Y=r?"xsmall":"small",$=r?"Edit parameter":"Create parameter",q=r?"Edit":"Create parameter",ee=e.createElement(B.Z,{showModal:y,onHide:C,bsSize:"large"},e.createElement(s.Modal.Header,{closeButton:!0},e.createElement(s.Modal.Title,null,"Parameter")),e.createElement(s.Modal.Body,null,e.createElement(d,{ref:j=>{a=j},parameters:c.parameters,onUpdateParameter:j=>{p(j,r),C()},parameterToEdit:r})),e.createElement(s.Modal.Footer,null,e.createElement(A.os,{onSubmit:g,onCancel:C,submitButtonText:$})));return e.createElement(e.Fragment,null,e.createElement(s.Button,{bsStyle:"info",bsSize:Y,title:"Edit Modal",onClick:L},q),ee)}render(){const{readOnly:r}=this.props,{filteredParameters:a}=this.state,c=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(A.UI,{onSearch:this._filterParameters,onReset:()=>{this._filterParameters("")}}),e.createElement(A.wQ,{id:"parameter-list",headers:c,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}))}}S(K,"propTypes",{contentPack:l().object.isRequired,readOnly:l().bool,onDeleteParameter:l().func,onAddParameter:l().func,appliedParameter:l().object}),S(K,"defaultProps",{readOnly:!1,onDeleteParameter:()=>{},onAddParameter:()=>{},appliedParameter:{}});const Q=K},snvX9lMq:(M,D,t)=>{var h=t("dFpwyWHg"),l=t.n(h),e=t("C2ikvoS0"),_=t.n(e),E=t("1IntWRSu"),s=t.n(E),A=t("8nGWeFnd"),B=t.n(A),b=t("TeAcaicX"),v=t.n(b),O=t("eE3+5goe"),T=t.n(O),P=t("orZs56L0"),i={};i.styleTagTransform=T(),i.setAttributes=B(),i.insert=s().bind(null,"head"),i.domAPI=_(),i.insertStyleElement=v();var n=l()(P.Z,i),o=P.Z&&P.Z.locals?P.Z.locals:void 0}}]);})();

//# sourceMappingURL=1255d548-7664.68ab3f580b20c9d96409.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy