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

web-interface.assets.1255d548-4126.ae16095afd6da8fc577d.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-4126"],{AS1FUYVz:(T,C,e)=>{e.d(C,{Z:()=>E});var t=e("pmX897Fv"),p=e.n(t),a=e("DjJvgDaP"),_=e.n(a),i=_()(p());i.push([T.id,`/* The context menu from the last drop down button in the list
   was hidden behind the table since the overflow was set to auto
   and the context menu could not overflow outside. For this
   table we show the overflow event though it might make problems
   with responsiveness (but no problems could be found). */
#content-packs-versions {
    overflow-x: visible;
}`,"",{version:3,sources:["webpack://./src/components/content-packs/ContentPackVersions.css"],names:[],mappings:"AAAA;;;;0DAI0D;AAC1D;IACI,mBAAmB;AACvB",sourcesContent:[`/* The context menu from the last drop down button in the list
   was hidden behind the table since the overflow was set to auto
   and the context menu could not overflow outside. For this
   table we show the overflow event though it might make problems
   with responsiveness (but no problems could be found). */
#content-packs-versions {
    overflow-x: visible;
}`],sourceRoot:""}]),i.locals={};const E=i},sizY2aoJ:(T,C,e)=>{e.d(C,{Z:()=>E});var t=e("pmX897Fv"),p=e.n(t),a=e("DjJvgDaP"),_=e.n(a),i=_()(p());i.push([T.id,`.ssxRSo3IWHMBKchTQ8jK {
    margin-left: 8px;
    margin-right: 8px;
    padding-left: 8px;
    padding-right: 8px;
}
`,"",{version:3,sources:["webpack://./src/pages/ShowContentPackPage.css"],names:[],mappings:"AAAA;IACI,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;AACtB",sourcesContent:[`:local(.leftRow) {
    margin-left: 8px;
    margin-right: 8px;
    padding-left: 8px;
    padding-right: 8px;
}
`],sourceRoot:""}]),i.locals={leftRow:"ssxRSo3IWHMBKchTQ8jK"};const E=i},tDHZr5uI:(T,C,e)=>{e.d(C,{Z:()=>R});var t=e("Z7aTuO5B"),p=e("ii0bleBb"),a=e.n(p),_=e("MdYBRjRJ"),i=e("U1Iufsob"),E=e("uZqmR+ju"),r=e("/GOzvPf6"),S=e("gqVHlIxA");const o=({contentPackId:f,revision:v,show:I,onHide:g})=>{const[c,P]=(0,t.useState)(I),d=()=>(0,_.DC)(i.Z.ContentPacksController.downloadRev(f,v).url),m=()=>{P(!1),g()},h='Please right click the download link below and choose "Save Link As..." to download the JSON file.',M="Download Content Pack";return t.createElement(S.Z,{showModal:c,onHide:m,bsSize:"large"},t.createElement(E.Modal.Header,{closeButton:!0},t.createElement(E.Modal.Title,null,M)),t.createElement(E.Modal.Body,null,t.createElement("p",null,h),t.createElement("p",null,t.createElement("a",{href:d(),target:"_blank",rel:"noopener noreferrer"},t.createElement(r.JO,{name:"cloud-download-alt"})," ","Download"))),t.createElement(E.Modal.Footer,null,t.createElement(E.Button,{onClick:m},"Close")))};o.propTypes={contentPackId:a().string.isRequired,revision:a().number.isRequired,show:a().bool,onHide:a().func},o.defaultProps={show:!1,onHide:()=>{}};const R=o},KfDYZOy6:(T,C,e)=>{e.d(C,{Z:()=>I});var t=e("ii0bleBb"),p=e.n(t),a=e("Z7aTuO5B"),_=e("rbG+3kLS"),i=e("uZqmR+ju"),E=e("EHQ1CSeg"),r=e("iAkLQLhv"),S=e("vyEB9hoZ"),o=Object.defineProperty,R=(g,c,P)=>c in g?o(g,c,{enumerable:!0,configurable:!0,writable:!0,value:P}):g[c]=P,f=(g,c,P)=>(R(g,typeof c!="symbol"?c+"":c,P),P);class v extends a.Component{constructor(c){super(c),f(this,"onInstall",()=>{if(this._validateInput()){const d=this.props.contentPack.id,m=this.props.contentPack.rev,h=this._convertedParameters();this.props.onInstall(d,m,{parameters:h,comment:this.state.comment})}}),f(this,"_convertedParameters",()=>Object.keys(this.state.parameterInput).reduce((d,m)=>{const h=d,M=this.props.contentPack.parameters.find(Z=>Z.name===m).type,y=r.Z.convertValue(M,this.state.parameterInput[m]);return h[m]=E.Z.createValueRef(M,y),h},{})),f(this,"_getValue",(d,m)=>{const h=this.state.parameterInput;h[d]=m,this.setState({parameterInput:h})}),f(this,"_getComment",d=>{this.setState({comment:d.target.value})}),f(this,"_validateInput",()=>{const{parameterInput:d}=this.state,m=this.props.contentPack.parameters.reduce((h,M)=>{if(d[M.name]&&d[M.name].length>0)return h;const y=h;return y[M.name]="Needs to be filled.",y},{});return this.setState({errorMessages:m}),Object.keys(m).length<=0});const P=c.contentPack.parameters.reduce((d,m)=>{if(m.default_value){const h=d;return h[m.name]=r.Z.convertToString(m),h}return d},{});this.state={parameterInput:P,comment:"",errorMessages:{}}}renderParameter(c){const P=this.state.errorMessages[c.name];return a.createElement(i.Input,{name:c.name,id:c.name,key:c.name,type:"text",maxLength:250,value:this.state.parameterInput[c.name]||"",onChange:d=>{this._getValue(c.name,d.target.value)},labelClassName:"col-sm-3",wrapperClassName:"col-sm-7",label:c.title,help:P||c.description,bsStyle:P?"error":void 0,required:!0})}render(){const c=this.props.contentPack.parameters.map(d=>this.renderParameter(d)),P=_.Z.fromJSON(this.props.contentPack);return a.createElement("div",null,a.createElement(i.Row,null,a.createElement(i.Col,{smOffset:1,sm:10},a.createElement("h2",null,"Install comment"),a.createElement("br",null),a.createElement("br",null),a.createElement(i.Input,{name:"comment",id:"comment",type:"text",maxLength:512,value:this.state.comment,onChange:this._getComment,labelClassName:"col-sm-3",wrapperClassName:"col-sm-7",label:"Comment"}))),c.length>0&&a.createElement(i.Row,null,a.createElement(i.Col,{smOffset:1,sm:10},a.createElement("h2",null,"Configure Parameter"),a.createElement("br",null),a.createElement("br",null),c)),a.createElement(i.Row,null,a.createElement(i.Col,{smOffset:1,sm:10},a.createElement(S.Z,{contentPack:P,readOnly:!0}))))}}f(v,"propTypes",{contentPack:p().object.isRequired,onInstall:p().func}),f(v,"defaultProps",{onInstall:()=>{}});const I=v},"lm35p+IR":(T,C,e)=>{e.r(C),e.d(C,{default:()=>Et});var t=e("Z7aTuO5B"),p=e("JnTtTRmZ"),a=e.n(p),_=e("D4SbLiE/"),i=e.n(_),E=e("ii0bleBb"),r=e.n(E),S=e("ty2gyrHp"),o=e("uZqmR+ju"),R=e("dsvqAVKU"),f=e("d4kzUuQm"),v=e("jAGDuYSC"),I=e("/GOzvPf6"),g=e("G9zy4OD/"),c=e("tDHZr5uI"),P=e("KfDYZOy6");const d=({pack:n,contentPackRevisions:l,onChange:s,onDeletePack:u,onInstall:D})=>{const[k,O]=(0,t.useState)(!1),[K,Q]=(0,t.useState)(!1),[ht,Pt]=(0,t.useState)(l.latestRevision),V=(0,t.useRef)(null),vt=()=>O(!0),Ct=()=>Q(!0),$=()=>O(!1),pt=W=>{const q=W.target.value;Pt(q),s(q)},ft=()=>{var W;V.current!==null&&((W=V.current)==null||W.onInstall()),O(!1)};return t.createElement("tr",{key:n.id+n.rev},t.createElement("td",null,t.createElement("input",{type:"radio",value:n.rev,onChange:pt,checked:ht===n.rev})),t.createElement("td",null,n.rev),t.createElement("td",{className:"text-right"},t.createElement(o.ButtonToolbar,{className:"pull-right"},t.createElement(o.Button,{bsStyle:"success",bsSize:"small",onClick:()=>Ct()},"Download"),t.createElement(o.DropdownButton,{id:`action-${n.rev}`,title:"Actions",bsSize:"small"},t.createElement(o.MenuItem,{onClick:()=>vt()},"Install"),t.createElement(S.J,{to:f.ZP.SYSTEM.CONTENTPACKS.edit(encodeURIComponent(n.id),encodeURIComponent(n.rev))},t.createElement(o.MenuItem,null,"Create New From Revision")),t.createElement(o.MenuItem,{divider:!0}),t.createElement(o.MenuItem,{onClick:()=>{u(n.id,n.rev)}},"Delete")))),k&&t.createElement(o.BootstrapModalWrapper,{showModal:k,onHide:$,bsSize:"large"},t.createElement(o.Modal.Header,{closeButton:!0},t.createElement(o.Modal.Title,null,"Install Content Pack")),t.createElement(o.Modal.Body,null,t.createElement(P.Z,{ref:V,contentPack:n,onInstall:D})),t.createElement(o.Modal.Footer,null,t.createElement(I.os,{submitButtonText:"Install",onSubmit:ft,onCancel:$}))),K&&t.createElement(c.Z,{show:K,onHide:()=>Q(!1),contentPackId:n.id,revision:n.rev}))};d.propTypes={pack:r().object.isRequired,contentPackRevisions:r().object.isRequired,onChange:r().func,onDeletePack:r().func,onInstall:r().func},d.defaultProps={onChange:()=>{},onDeletePack:()=>{},onInstall:()=>{}};const m=d;var h=e("dFpwyWHg"),M=e.n(h),y=e("C2ikvoS0"),Z=e.n(y),tt=e("1IntWRSu"),j=e.n(tt),et=e("8nGWeFnd"),H=e.n(et),nt=e("TeAcaicX"),z=e.n(nt),ot=e("eE3+5goe"),Y=e.n(ot),U=e("AS1FUYVz"),B={};B.styleTagTransform=Y(),B.setAttributes=H(),B.insert=j().bind(null,"head"),B.domAPI=Z(),B.insertStyleElement=z();var _t=M()(U.Z,B);const It=U.Z&&U.Z.locals?U.Z.locals:void 0,st=n=>n==="Action"?t.createElement("th",{className:"text-right"},n):t.createElement("th",null,n),F=({onDeletePack:n,contentPackRevisions:l,onInstall:s,onChange:u})=>{const{contentPacks:D}=l,k=["Select","Revision","Action"],O=K=>t.createElement(m,{pack:K,contentPackRevisions:l,onDeletePack:n,onChange:u,onInstall:s});return t.createElement(I.wQ,{id:"content-packs-versions",headers:k,headerCellFormatter:st,useNumericSort:!0,sortBy:K=>K.rev.toString(),dataRowFormatter:O,rows:D,filterKeys:[]})};F.propTypes={contentPackRevisions:r().object.isRequired,onChange:r().func,onDeletePack:r().func,onInstall:r().func},F.defaultProps={onChange:()=>{},onDeletePack:()=>{},onInstall:()=>{}};const lt=F;var Mt=e("snvX9lMq");const N=n=>{const l=D=>t.createElement("tr",null,t.createElement("td",null,D.title),t.createElement("td",null,D.type.name)),s=["Title","Type"],u=n.uninstall?"Entites to be uninstalled":"Installed Entities";return n.entities?t.createElement("div",null,t.createElement("h3",null,u),t.createElement(I.wQ,{id:"installed-entities",headers:s,sortByKey:"title",dataRowFormatter:l,rows:n.entities,filterKeys:[]})):t.createElement(R.Z,null)};N.propTypes={entities:r().array,uninstall:r().bool},N.defaultProps={entities:void 0,uninstall:!1};const J=N,X=n=>{const{comment:l}=n.install,s=n.install.created_at,u=n.install.created_by;return t.createElement("div",null,t.createElement(o.Row,null,t.createElement(o.Col,{smOffset:1,sm:10},t.createElement("h3",null,"General information"),t.createElement("dl",{className:"deflist"},t.createElement("dt",null,"Comment:"),t.createElement("dd",null,l),t.createElement("dt",null,"Installed by:"),t.createElement("dd",null,u,"\xA0"),t.createElement("dt",null,"Installed at:"),t.createElement("dd",null,t.createElement(I.EK,{dateTime:s}))))),t.createElement(o.Row,null,t.createElement(o.Col,{smOffset:1,sm:10},t.createElement(J,{entities:n.install.entities}))))};X.propTypes={install:r().object.isRequired};const at=X;var rt=Object.defineProperty,ct=(n,l,s)=>l in n?rt(n,l,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[l]=s,L=(n,l,s)=>(ct(n,typeof l!="symbol"?l+"":l,s),s);class x extends t.Component{constructor(l){super(l),L(this,"rowFormatter",s=>{const{onUninstall:u}=this.props,D=()=>{this.setState({showInstallModal:!1})},k=()=>{this.setState({showInstallModal:!0})},O=t.createElement(o.BootstrapModalWrapper,{showModal:this.state.showInstallModal,onHide:D,bsSize:"large"},t.createElement(o.Modal.Header,{closeButton:!0},t.createElement(o.Modal.Title,null,"View Installation")),t.createElement(o.Modal.Body,null,t.createElement(at,{install:s})),t.createElement(o.Modal.Footer,null,t.createElement(o.Button,{onClick:D},"Close")));return t.createElement("tr",{key:s},t.createElement("td",null,s.comment),t.createElement("td",null,s.content_pack_revision),t.createElement("td",null,t.createElement("div",{className:"pull-right"},t.createElement(o.ButtonToolbar,null,t.createElement(o.Button,{bsStyle:"primary",bsSize:"small",onClick:()=>{u(s.content_pack_id,s._id)}},"Uninstall"),t.createElement(o.Button,{bsStyle:"info",bsSize:"small",onClick:k},"View"),O))))}),L(this,"headerFormater",s=>s==="Action"?t.createElement("th",{className:"text-right"},s):t.createElement("th",null,s)),this.state={showInstallModal:!1}}render(){const{installations:l}=this.props;if(!l)return t.createElement(R.Z,null);const s=["Comment","Version","Action"];return t.createElement(I.wQ,{id:"content-packs-versions",headers:s,headerCellFormatter:this.headerFormater,useNumericSort:!0,sortBy:u=>u.content_pack_revision.toString(),dataRowFormatter:this.rowFormatter,rows:l,filterKeys:[]})}}L(x,"propTypes",{installations:r().arrayOf(r().object),onUninstall:r().func}),L(x,"defaultProps",{installations:[],onUninstall:()=>{}});const it=x;var dt=e("c9JM82dZ"),A=e("nPaY1a0P"),mt=e("N6x7vnl1"),b=e("sizY2aoJ"),w={};w.styleTagTransform=Y(),w.setAttributes=H(),w.insert=j().bind(null,"head"),w.domAPI=Z(),w.insertStyleElement=z();var gt=M()(b.Z,w);const G=b.Z&&b.Z.locals?b.Z.locals:void 0,ut=i()({displayName:"ShowContentPackPage",propTypes:{history:r().object.isRequired,params:r().object.isRequired},mixins:[a().connect(A.V)],getInitialState(){return{showModal:!1,selectedVersion:void 0,uninstallEntities:void 0,uninstallContentPackId:void 0,uninstallInstallId:void 0}},componentDidMount(){A.K.get(this.props.params.contentPackId).catch(n=>{n.status===404?v.Z.error(`Cannot find Content Pack with the id ${this.props.params.contentPackId} and may have been deleted.`):v.Z.error("An internal server error occurred. Please check your logfiles for more information");const{history:l}=this.props;l.push(f.ZP.SYSTEM.CONTENTPACKS.LIST)}),A.K.installList(this.props.params.contentPackId)},_onVersionChanged(n){this.setState({selectedVersion:n})},_deleteContentPackRev(n,l){window.confirm("You are about to delete this content pack revision, are you sure?")&&A.K.deleteRev(n,l).then(()=>{v.Z.success("Content pack revision deleted successfully.","Success"),A.K.get(n).catch(s=>{s.status!==404&&v.Z.error("An internal server error occurred. Please check your logfiles for more information");const{history:u}=this.props;u.push(f.ZP.SYSTEM.CONTENTPACKS.LIST)})},s=>{let u=s.message;s.responseMessage&&(u=s.responseMessage),v.Z.error(`Deleting content pack failed: ${u}`,"Error")})},_onUninstallContentPackRev(n,l){A.K.uninstallDetails(n,l).then(s=>{this.setState({uninstallEntities:s.entities})}),this.setState({showModal:!0,uninstallContentPackId:n,uninstallInstallId:l})},_clearUninstall(){this.setState({showModal:!1,uninstallContentPackId:void 0,uninstallInstallId:void 0,uninstallEntities:void 0})},_uninstallContentPackRev(){const n=this.state.uninstallContentPackId;A.K.uninstall(this.state.uninstallContentPackId,this.state.uninstallInstallId).then(()=>{v.Z.success("Content Pack uninstalled successfully.","Success"),A.K.installList(n),this._clearUninstall()},()=>{v.Z.error("Uninstall content pack failed, please check your logs for more information.","Error")})},_installContentPack(n,l,s){A.K.install(n,l,s).then(()=>{v.Z.success("Content Pack installed successfully.","Success"),A.K.installList(n)},u=>{v.Z.error(`Installing content pack failed with status: ${u}.
         Could not install content pack with ID: ${n}`)})},render(){if(!this.state.contentPackRevisions)return t.createElement(R.Z,null);const{contentPackRevisions:n,selectedVersion:l,constraints:s}=this.state;return t.createElement(I.$4,{title:"Content packs"},t.createElement("span",null,t.createElement(I.mr,{title:"Content packs",topActions:t.createElement(o.ButtonToolbar,null,t.createElement(S.J,{to:f.ZP.SYSTEM.CONTENTPACKS.LIST},t.createElement(o.Button,{bsStyle:"info"},"Content Packs")))},t.createElement("span",null,"Content packs accelerate the set up process for a specific data source. A content pack can include inputs/extractors, streams, and dashboards.",t.createElement("br",null),"Find more content packs in "," ",t.createElement("a",{href:"https://marketplace.graylog.org/",target:"_blank",rel:"noopener noreferrer"},"the Graylog Marketplace"),".")),t.createElement(o.Row,null,t.createElement(o.Col,{md:4,className:"content"},t.createElement("div",{id:"content-pack-versions"},t.createElement(o.Row,{className:G.leftRow},t.createElement(o.Col,null,t.createElement("h2",null,"Versions"),t.createElement(lt,{contentPackRevisions:n,onInstall:this._installContentPack,onChange:this._onVersionChanged,onDeletePack:this._deleteContentPackRev}))),t.createElement(o.Row,{className:G.leftRow},t.createElement(o.Col,null,t.createElement("h2",null,"Installations"),t.createElement(it,{installations:this.state.installations,onUninstall:this._onUninstallContentPackRev}))))),t.createElement(o.Col,{md:8,className:"content"},t.createElement(g.Z,{contentPack:n.contentPack(l),constraints:s[l],showConstraints:!0,verbose:!0})))),t.createElement(o.BootstrapModalConfirm,{showModal:this.state.showModal,title:"Do you really want to uninstall this Content Pack?",onConfirm:this._uninstallContentPackRev,onCancel:this._clearUninstall},t.createElement(J,{uninstall:!0,entities:this.state.uninstallEntities})))}}),Et=(0,mt.Z)((0,dt.Z)(ut))},N6x7vnl1:(T,C,e)=>{e.d(C,{Z:()=>_});var t=e("Z7aTuO5B"),p=e("/7OuCFNo");const _=i=>E=>{const r=(0,p.Z)();return t.createElement(i,{...E,history:r})}},c9JM82dZ:(T,C,e)=>{e.d(C,{Z:()=>_});var t=e("Z7aTuO5B"),p=e("yAXMqwrl");const _=i=>E=>{const r=(0,p.useParams)();return t.createElement(i,{...E,params:r})}}}]);})();

//# sourceMappingURL=1255d548-4126.ae16095afd6da8fc577d.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy