web-interface.assets.bb8c8232-7807.f0e4580e229c695b8b91.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-7807"],{AS1FUYVz:(D,C,t)=>{t.d(C,{A:()=>P});var e=t("pmX897Fv"),f=t.n(e),a=t("DjJvgDaP"),A=t.n(a),d=A()(f());d.push([D.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:""}]),d.locals={};const P=d},sizY2aoJ:(D,C,t)=>{t.d(C,{A:()=>P});var e=t("pmX897Fv"),f=t.n(e),a=t("DjJvgDaP"),A=t.n(a),d=A()(f());d.push([D.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:""}]),d.locals={leftRow:"ssxRSo3IWHMBKchTQ8jK"};const P=d},tDHZr5uI:(D,C,t)=>{t.d(C,{A:()=>R});var e=t("Z7aTuO5B"),f=t("ii0bleBb"),a=t.n(f),A=t("MdYBRjRJ"),d=t("U1Iufsob"),P=t("rIl5IEuP"),c=t("IOI9nV80"),y=t("gqVHlIxA");const l=({contentPackId:v,revision:p,show:I,onHide:_})=>{const[r,E]=(0,e.useState)(I),i=()=>(0,A.H3)(d.A.ContentPacksController.downloadRev(v,p).url),m=()=>{E(!1),_()};return e.createElement(y.A,{showModal:r,onHide:m,bsSize:"large"},e.createElement(P.Modal.Header,{closeButton:!0},e.createElement(P.Modal.Title,null,"Download Content Pack")),e.createElement(P.Modal.Body,null,e.createElement("p",null,'Please right click the download link below and choose "Save Link As..." to download the JSON file.'),e.createElement("p",null,e.createElement("a",{href:i(),target:"_blank",rel:"noopener noreferrer"},e.createElement(c.In,{name:"download"})," ","Download"))),e.createElement(P.Modal.Footer,null,e.createElement(P.Button,{onClick:m},"Close")))};l.propTypes={contentPackId:a().string.isRequired,revision:a().number.isRequired,show:a().bool,onHide:a().func},l.defaultProps={show:!1,onHide:()=>{}};const R=l},KfDYZOy6:(D,C,t)=>{t.d(C,{A:()=>I});var e=t("ii0bleBb"),f=t.n(e),a=t("Z7aTuO5B"),A=t("rbG+3kLS"),d=t("rIl5IEuP"),P=t("EHQ1CSeg"),c=t("iAkLQLhv"),y=t("vyEB9hoZ"),l=Object.defineProperty,R=(_,r,E)=>r in _?l(_,r,{enumerable:!0,configurable:!0,writable:!0,value:E}):_[r]=E,v=(_,r,E)=>(R(_,typeof r!="symbol"?r+"":r,E),E);class p extends a.Component{constructor(r){super(r),v(this,"onInstall",()=>{if(this._validateInput()){const i=this.props.contentPack.id,m=this.props.contentPack.rev,h=this._convertedParameters();this.props.onInstall(i,m,{parameters:h,comment:this.state.comment})}}),v(this,"_convertedParameters",()=>Object.keys(this.state.parameterInput).reduce((i,m)=>{const h=i,M=this.props.contentPack.parameters.find(b=>b.name===m).type,O=c.A.convertValue(M,this.state.parameterInput[m]);return h[m]=P.A.createValueRef(M,O),h},{})),v(this,"_getValue",(i,m)=>{const h=this.state.parameterInput;h[i]=m,this.setState({parameterInput:h})}),v(this,"_getComment",i=>{this.setState({comment:i.target.value})}),v(this,"_validateInput",()=>{const{parameterInput:i}=this.state,m=this.props.contentPack.parameters.reduce((h,M)=>{if(i[M.name]&&i[M.name].length>0)return h;const O=h;return O[M.name]="Needs to be filled.",O},{});return this.setState({errorMessages:m}),Object.keys(m).length<=0});const E=r.contentPack.parameters.reduce((i,m)=>{if(m.default_value){const h=i;return h[m.name]=c.A.convertToString(m),h}return i},{});this.state={parameterInput:E,comment:"",errorMessages:{}}}renderParameter(r){const E=this.state.errorMessages[r.name];return a.createElement(d.Input,{name:r.name,id:r.name,key:r.name,type:"text",maxLength:250,value:this.state.parameterInput[r.name]||"",onChange:i=>{this._getValue(r.name,i.target.value)},labelClassName:"col-sm-3",wrapperClassName:"col-sm-7",label:r.title,help:E||r.description,bsStyle:E?"error":void 0,required:!0})}render(){const r=this.props.contentPack.parameters.map(i=>this.renderParameter(i)),E=A.A.fromJSON(this.props.contentPack);return a.createElement("div",null,a.createElement(d.Row,null,a.createElement(d.Col,{smOffset:1,sm:10},a.createElement("h2",null,"Install comment"),a.createElement("br",null),a.createElement("br",null),a.createElement(d.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"}))),r.length>0&&a.createElement(d.Row,null,a.createElement(d.Col,{smOffset:1,sm:10},a.createElement("h2",null,"Configure Parameter"),a.createElement("br",null),a.createElement("br",null),r)),a.createElement(d.Row,null,a.createElement(d.Col,{smOffset:1,sm:10},a.createElement(y.A,{contentPack:E,readOnly:!0}))))}}v(p,"propTypes",{contentPack:f().object.isRequired,onInstall:f().func}),v(p,"defaultProps",{onInstall:()=>{}});const I=p},"lm35p+IR":(D,C,t)=>{t.r(C),t.d(C,{default:()=>Ee});var e=t("Z7aTuO5B"),f=t("JnTtTRmZ"),a=t.n(f),A=t("D4SbLiE/"),d=t.n(A),P=t("ii0bleBb"),c=t.n(P),y=t("ty2gyrHp"),l=t("rIl5IEuP"),R=t("dsvqAVKU"),v=t("d4kzUuQm"),p=t("jAGDuYSC"),I=t("IOI9nV80"),_=t("G9zy4OD/"),r=t("tDHZr5uI"),E=t("KfDYZOy6");const i=({pack:n,contentPackRevisions:s,onChange:o,onDeletePack:u,onInstall:T})=>{const[w,S]=(0,e.useState)(!1),[U,G]=(0,e.useState)(!1),[he,Pe]=(0,e.useState)(s.latestRevision),j=(0,e.useRef)(null),pe=()=>S(!0),ve=()=>G(!0),$=()=>S(!1),Ce=x=>{const q=x.target.value;Pe(q),o(q)},fe=()=>{var x;j.current!==null&&((x=j.current)==null||x.onInstall()),S(!1)};return e.createElement("tr",{key:n.id+n.rev},e.createElement("td",null,e.createElement("input",{type:"radio",value:n.rev,onChange:Ce,checked:he===n.rev})),e.createElement("td",null,n.rev),e.createElement("td",{className:"text-right"},e.createElement(l.ButtonToolbar,{className:"pull-right"},e.createElement(l.Button,{bsStyle:"success",bsSize:"small",onClick:()=>ve()},"Download"),e.createElement(l.DropdownButton,{id:`action-${n.rev}`,title:"Actions",bsSize:"small"},e.createElement(l.MenuItem,{onClick:()=>pe()},"Install"),e.createElement(y.m,{to:v.Ay.SYSTEM.CONTENTPACKS.edit(encodeURIComponent(n.id),encodeURIComponent(n.rev))},e.createElement(l.MenuItem,null,"Create New From Revision")),e.createElement(l.MenuItem,{divider:!0}),e.createElement(l.MenuItem,{onClick:()=>{u(n.id,n.rev)}},"Delete")))),w&&e.createElement(l.BootstrapModalWrapper,{showModal:w,onHide:$,bsSize:"large"},e.createElement(l.Modal.Header,{closeButton:!0},e.createElement(l.Modal.Title,null,"Install Content Pack")),e.createElement(l.Modal.Body,null,e.createElement(E.A,{ref:j,contentPack:n,onInstall:T})),e.createElement(l.Modal.Footer,null,e.createElement(I.E6,{submitButtonText:"Install",onSubmit:fe,onCancel:$}))),U&&e.createElement(r.A,{show:U,onHide:()=>G(!1),contentPackId:n.id,revision:n.rev}))};i.propTypes={pack:c().object.isRequired,contentPackRevisions:c().object.isRequired,onChange:c().func,onDeletePack:c().func,onInstall:c().func},i.defaultProps={onChange:()=>{},onDeletePack:()=>{},onInstall:()=>{}};const m=i;var h=t("dFpwyWHg"),M=t.n(h),O=t("C2ikvoS0"),b=t.n(O),ee=t("1IntWRSu"),H=t.n(ee),te=t("8nGWeFnd"),Y=t.n(te),ne=t("TeAcaicX"),z=t.n(ne),le=t("eE3+5goe"),X=t.n(le),L=t("AS1FUYVz"),B={};B.styleTagTransform=X(),B.setAttributes=Y(),B.insert=H().bind(null,"head"),B.domAPI=b(),B.insertStyleElement=z();var Ae=M()(L.A,B);const Ie=L.A&&L.A.locals?L.A.locals:void 0,oe=n=>n==="Action"?e.createElement("th",{className:"text-right"},n):e.createElement("th",null,n),F=({onDeletePack:n,contentPackRevisions:s,onInstall:o,onChange:u})=>{const{contentPacks:T}=s,w=["Select","Revision","Action"],S=U=>e.createElement(m,{pack:U,contentPackRevisions:s,onDeletePack:n,onChange:u,onInstall:o});return e.createElement(I.bQ,{id:"content-packs-versions",headers:w,headerCellFormatter:oe,useNumericSort:!0,sortBy:U=>U.rev.toString(),dataRowFormatter:S,rows:T,filterKeys:[]})};F.propTypes={contentPackRevisions:c().object.isRequired,onChange:c().func,onDeletePack:c().func,onInstall:c().func},F.defaultProps={onChange:()=>{},onDeletePack:()=>{},onInstall:()=>{}};const se=F;var _e=t("snvX9lMq");const V=n=>{const s=T=>e.createElement("tr",null,e.createElement("td",null,T.title),e.createElement("td",null,T.type.name)),o=["Title","Type"],u=n.uninstall?"Entites to be uninstalled":"Installed Entities";return n.entities?e.createElement("div",null,e.createElement("h3",null,u),e.createElement(I.bQ,{id:"installed-entities",headers:o,sortByKey:"title",dataRowFormatter:s,rows:n.entities,filterKeys:[]})):e.createElement(R.A,null)};V.propTypes={entities:c().array,uninstall:c().bool},V.defaultProps={entities:void 0,uninstall:!1};const Z=V,J=n=>{const{comment:s}=n.install,o=n.install.created_at,u=n.install.created_by;return e.createElement("div",null,e.createElement(l.Row,null,e.createElement(l.Col,{smOffset:1,sm:10},e.createElement("h3",null,"General information"),e.createElement("dl",{className:"deflist"},e.createElement("dt",null,"Comment:"),e.createElement("dd",null,s),e.createElement("dt",null,"Installed by:"),e.createElement("dd",null,u,"\xA0"),e.createElement("dt",null,"Installed at:"),e.createElement("dd",null,e.createElement(I.Dc,{dateTime:o}))))),e.createElement(l.Row,null,e.createElement(l.Col,{smOffset:1,sm:10},e.createElement(Z,{entities:n.install.entities}))))};J.propTypes={install:c().object.isRequired};const ae=J;var re=Object.defineProperty,ce=(n,s,o)=>s in n?re(n,s,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[s]=o,K=(n,s,o)=>(ce(n,typeof s!="symbol"?s+"":s,o),o);class N extends e.Component{constructor(s){super(s),K(this,"rowFormatter",o=>{const{onUninstall:u}=this.props,T=()=>{this.setState({showInstallModal:!1})},w=()=>{this.setState({showInstallModal:!0})},S=e.createElement(l.BootstrapModalWrapper,{showModal:this.state.showInstallModal,onHide:T,bsSize:"large"},e.createElement(l.Modal.Header,{closeButton:!0},e.createElement(l.Modal.Title,null,"View Installation")),e.createElement(l.Modal.Body,null,e.createElement(ae,{install:o})),e.createElement(l.Modal.Footer,null,e.createElement(l.Button,{onClick:T},"Close")));return e.createElement("tr",{key:o},e.createElement("td",null,o.comment),e.createElement("td",null,o.content_pack_revision),e.createElement("td",null,e.createElement("div",{className:"pull-right"},e.createElement(l.ButtonToolbar,null,e.createElement(l.Button,{bsStyle:"primary",bsSize:"small",onClick:()=>{u(o.content_pack_id,o._id)}},"Uninstall"),e.createElement(l.Button,{bsStyle:"info",bsSize:"small",onClick:w},"View"),S))))}),K(this,"headerFormater",o=>o==="Action"?e.createElement("th",{className:"text-right"},o):e.createElement("th",null,o)),this.state={showInstallModal:!1}}render(){const{installations:s}=this.props;if(!s)return e.createElement(R.A,null);const o=["Comment","Version","Action"];return e.createElement(I.bQ,{id:"content-packs-versions",headers:o,headerCellFormatter:this.headerFormater,useNumericSort:!0,sortBy:u=>u.content_pack_revision.toString(),dataRowFormatter:this.rowFormatter,rows:s,filterKeys:[]})}}K(N,"propTypes",{installations:c().arrayOf(c().object),onUninstall:c().func}),K(N,"defaultProps",{installations:[],onUninstall:()=>{}});const ie=N;var de=t("c9JM82dZ"),g=t("nPaY1a0P"),me=t("N6x7vnl1"),W=t("sizY2aoJ"),k={};k.styleTagTransform=X(),k.setAttributes=Y(),k.insert=H().bind(null,"head"),k.domAPI=b(),k.insertStyleElement=z();var Me=M()(W.A,k);const Q=W.A&&W.A.locals?W.A.locals:void 0,ue=d()({displayName:"ShowContentPackPage",propTypes:{history:c().object.isRequired,params:c().object.isRequired},mixins:[a().connect(g.D)],getInitialState(){return{showModal:!1,selectedVersion:void 0,uninstallEntities:void 0,uninstallContentPackId:void 0,uninstallInstallId:void 0}},componentDidMount(){g.T.get(this.props.params.contentPackId).catch(n=>{n.status===404?p.A.error(`Cannot find Content Pack with the id ${this.props.params.contentPackId} and may have been deleted.`):p.A.error("An internal server error occurred. Please check your logfiles for more information");const{history:s}=this.props;s.push(v.Ay.SYSTEM.CONTENTPACKS.LIST)}),g.T.installList(this.props.params.contentPackId)},_onVersionChanged(n){this.setState({selectedVersion:n})},_deleteContentPackRev(n,s){window.confirm("You are about to delete this content pack revision, are you sure?")&&g.T.deleteRev(n,s).then(()=>{p.A.success("Content pack revision deleted successfully.","Success"),g.T.get(n).catch(o=>{o.status!==404&&p.A.error("An internal server error occurred. Please check your logfiles for more information");const{history:u}=this.props;u.push(v.Ay.SYSTEM.CONTENTPACKS.LIST)})},o=>{let u=o.message;o.responseMessage&&(u=o.responseMessage),p.A.error(`Deleting content pack failed: ${u}`,"Error")})},_onUninstallContentPackRev(n,s){g.T.uninstallDetails(n,s).then(o=>{this.setState({uninstallEntities:o.entities})}),this.setState({showModal:!0,uninstallContentPackId:n,uninstallInstallId:s})},_clearUninstall(){this.setState({showModal:!1,uninstallContentPackId:void 0,uninstallInstallId:void 0,uninstallEntities:void 0})},_uninstallContentPackRev(){const n=this.state.uninstallContentPackId;g.T.uninstall(this.state.uninstallContentPackId,this.state.uninstallInstallId).then(()=>{p.A.success("Content Pack uninstalled successfully.","Success"),g.T.installList(n),this._clearUninstall()},()=>{p.A.error("Uninstall content pack failed, please check your logs for more information.","Error")})},_installContentPack(n,s,o){g.T.install(n,s,o).then(()=>{p.A.success("Content Pack installed successfully.","Success"),g.T.installList(n)},u=>{p.A.error(`Installing content pack failed with status: ${u}.
Could not install content pack with ID: ${n}`)})},render(){if(!this.state.contentPackRevisions)return e.createElement(R.A,null);const{contentPackRevisions:n,selectedVersion:s,constraints:o}=this.state;return e.createElement(I.Qc,{title:"Content packs"},e.createElement("span",null,e.createElement(I.zY,{title:"Content packs",topActions:e.createElement(l.ButtonToolbar,null,e.createElement(y.m,{to:v.Ay.SYSTEM.CONTENTPACKS.LIST},e.createElement(l.Button,{bsStyle:"info"},"Content Packs")))},e.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.",e.createElement("br",null),"Find more content packs in "," ",e.createElement("a",{href:"https://marketplace.graylog.org/",target:"_blank",rel:"noopener noreferrer"},"the Graylog Marketplace"),".")),e.createElement(l.Row,null,e.createElement(l.Col,{md:4,className:"content"},e.createElement("div",{id:"content-pack-versions"},e.createElement(l.Row,{className:Q.leftRow},e.createElement(l.Col,null,e.createElement("h2",null,"Versions"),e.createElement(se,{contentPackRevisions:n,onInstall:this._installContentPack,onChange:this._onVersionChanged,onDeletePack:this._deleteContentPackRev}))),e.createElement(l.Row,{className:Q.leftRow},e.createElement(l.Col,null,e.createElement("h2",null,"Installations"),e.createElement(ie,{installations:this.state.installations,onUninstall:this._onUninstallContentPackRev}))))),e.createElement(l.Col,{md:8,className:"content"},e.createElement(_.A,{contentPack:n.contentPack(s),constraints:o[s],showConstraints:!0,verbose:!0})))),e.createElement(l.BootstrapModalConfirm,{showModal:this.state.showModal,title:"Do you really want to uninstall this Content Pack?",onConfirm:this._uninstallContentPackRev,onCancel:this._clearUninstall},e.createElement(Z,{uninstall:!0,entities:this.state.uninstallEntities})))}}),Ee=(0,me.A)((0,de.A)(ue))},c9JM82dZ:(D,C,t)=>{t.d(C,{A:()=>A});var e=t("Z7aTuO5B"),f=t("yAXMqwrl");const A=d=>P=>{const c=(0,f.useParams)();return e.createElement(d,{...P,params:c})}}}]);})();
//# sourceMappingURL=bb8c8232-7807.f0e4580e229c695b8b91.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy