web-interface.assets.bb8c8232-4752.77d643179b480a221a32.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-4752"],{SfPIQIJE:(ae,U,r)=>{r.d(U,{A:()=>L});var e=r("Z7aTuO5B"),n=r("J6y4/h8P"),d=r("rIl5IEuP"),p=r("ty2gyrHp"),f=r("IOI9nV80"),u=r("NV1/EHMi");const M=(0,n.default)(d.ButtonToolbar)`
margin-bottom: 10px;
`,R=(0,n.default)(d.Button)(({theme:_})=>(0,n.css)`
font-family: ${_.fonts.family.navigation};
font-size: ${_.fonts.size.navigation};
color: ${_.colors.variant.darker.default};
&:hover,
&:focus {
background: inherit;
text-decoration: none;
}
&:hover {
color: inherit;
${(0,u.WS)(_)}
}
&.active {
color: ${_.colors.global.textDefault};
${(0,u.at)(_)}
&:hover,
&:focus {
${(0,u.at)(_)}
}
`);R.displayName="Button";const L=({items:_})=>e.createElement(M,null,_.map(({path:b,title:z,permissions:K,exactPathMatch:oe})=>b?e.createElement(f.Wj,{permissions:K!=null?K:[],key:b},e.createElement(p.m,{to:b,relativeActive:!oe},e.createElement(R,{bsStyle:"link"},e.createElement(u.Ay,null,z)))):null))},orGoq0ZB:(ae,U,r)=>{r.d(U,{A:()=>fe});var e=r("Z7aTuO5B"),n=r("DUKaTDO2"),d=r("UiXZqrDE"),p=r("J6y4/h8P"),f=r("13uboeDm"),u=r.n(f),M=r("9oVghaOd"),R=r.n(M),x=r("rp7UD7rK"),L=r("jAGDuYSC"),_=r("rIl5IEuP"),b=r("ibdPvtmL"),z=r("i+sOEQiN"),K=r("IOI9nV80"),oe=r("8OvTct/Z"),w=r("hhdCSTZj"),m=r("0t7Ye+61"),N=r("MdYBRjRJ"),I=r("v4GbOr/o"),y=r("9GOsZwoo");const Ee=["hours","days","months","years"].map(D=>D.toLocaleUpperCase()),q=p.default.dl.attrs({className:"deflist"})(({theme:D})=>(0,p.css)`
&&.deflist {
dt {
float: left;
}
dd {
padding-left: ${D.spacings.md};
margin-left: 200px;
}
}
`),Q=async D=>b.t.update(z.H.CERTIFICATE_RENEWAL_POLICY_CONFIG,D),Ae=D=>{if(D.endsWith("H"))return"hours";if(D.endsWith("D"))return"days";if(D.endsWith("M"))return"months";if(D.endsWith("Y"))return"years";throw new Error(`Invalid duration specified: ${D}`)},ye=()=>b.t.list(z.H.CERTIFICATE_RENEWAL_POLICY_CONFIG),me=({createPolicy:D})=>e.createElement("span",null,"There is no Certificate Renewal Policy yet. Click\xA0",e.createElement(_.Button,{onClick:D,bsSize:"xsmall",bsStyle:"primary"},"here")," to create one."),ge=["AUTOMATIC","MANUAL"].map(D=>({label:u()(D),value:D})),re={mode:"AUTOMATIC",lifetimeUnit:"days",lifetimeValue:30},le=["config","certificate-renewal-policy"],X='Setting the renewal policy to "Automatic" will renew all expiring certificates without any user interaction. Setting it to "Manual" will create a system notification when one or more certificates are about to expire, allowing you to confirm their renewal.',ie="The certificate lifetime will be used for the length of the validity of newly created certificates.",se=({className:D})=>{const[ce,ue]=(0,e.useState)(!1),{data:V,isLoading:j}=(0,n.useQuery)(le,ye),s=(0,oe.A)(),{pathname:_e}=(0,m.A)(),J=(0,n.useQueryClient)(),{mutateAsync:c}=(0,n.useMutation)(Q,{onSuccess:()=>{J.invalidateQueries(le),J.invalidateQueries(y.A),ue(!1)},onError:T=>{L.A.error(`Error Updating Detector Definition: ${T.toString()}`,"Unable to update detector definition")}}),A=(0,e.useMemo)(()=>{if(j)return;if(!V)return re;const{mode:T,certificate_lifetime:Y}=V,ee=Ae(Y),W=R().duration(Y).as(ee);return{mode:T,lifetimeUnit:ee,lifetimeValue:W}},[V,j]);if(j)return e.createElement(K.y$,null);const G="Configure Certificate Renewal Policy",B=()=>{ue(!1)},Z=T=>{s(I.g.CONFIGURATIONS.CERTIFICATE_RENEWAL_POLICY_UPDATED,{app_pathname:(0,N.i)(_e),app_section:"certificate-renewal-policy",app_action_value:"configuration-save"});const Y={mode:T.mode,certificate_lifetime:R().duration(T.lifetimeValue,T.lifetimeUnit).toJSON()};return c(Y)};return e.createElement("div",{className:D},e.createElement("h2",null,"Certificate Renewal Policy Configuration"),e.createElement("p",null,"These settings will be used when detecting expiration of certificates and/or when renewing them."),V?e.createElement(e.Fragment,null,e.createElement(q,null,e.createElement("dt",null,"Renewal Mode:"),e.createElement("dd",null,u()(V.mode)),e.createElement("dd",null,e.createElement("i",null,X)),e.createElement("dt",null,"Certificate Lifetime:"),e.createElement("dd",null,A.lifetimeValue," ",A.lifetimeUnit),e.createElement("dd",null,e.createElement("i",null,ie))),e.createElement("p",{className:"no-bm"},e.createElement(K.Wj,{permissions:"indices:changestate"},e.createElement(_.Button,{bsStyle:"info",bsSize:"xs",onClick:()=>{ue(!0)}},"Edit configuration")))):e.createElement(me,{createPolicy:()=>ue(!0)}),e.createElement(_.Modal,{show:ce,onHide:B,"aria-modal":"true","aria-labelledby":"dialog_label"},e.createElement(d.Formik,{onSubmit:Z,initialValues:A},({values:T,setFieldValue:Y,isSubmitting:ee,isValid:W,isValidating:Oe})=>e.createElement(d.Form,null,e.createElement(_.Modal.Header,{closeButton:!0},e.createElement(_.Modal.Title,{id:"dialog_label"},G)),e.createElement(_.Modal.Body,null,e.createElement("div",null,e.createElement(_.Row,null,e.createElement(_.Col,{md:12},e.createElement(d.Field,{name:"mode"},({field:{name:te,value:H,onChange:pe}})=>e.createElement(_.Input,{id:te,label:"Certificate Renewal Mode",help:X},e.createElement(w.A,{options:ge,clearable:!1,name:te,value:H!=null?H:"AUTOMATIC","aria-label":"Select certificate renewal mode",size:"small",onChange:Te=>pe({target:{name:te,value:Te}})}))),e.createElement(K.gM,{label:"Certificate Lifetime",help:ie,update:(te,H)=>{Y("lifetimeValue",te),Y("lifetimeUnit",H)},value:T.lifetimeValue,unit:T.lifetimeUnit.toLocaleUpperCase(),enabled:!0,hideCheckbox:!0,units:Ee}))))),e.createElement(_.Modal.Footer,null,e.createElement(x.A,{onCancel:B,disabledSubmit:Oe||!W,isSubmitting:ee,isAsyncSubmit:!0,submitLoadingText:"Updating configuration",submitButtonText:"Update configuration"}))))))};se.defaultProps={className:void 0};const fe=se},pSEhaN5V:(ae,U,r)=>{r.d(U,{A:()=>x});var e=r("Z7aTuO5B"),n=r("RCNj0OY4"),d=r("SfPIQIJE"),p=r("d4kzUuQm"),f=r("rIl5IEuP");const u=n.A.isFeatureEnabled("data_node_migration"),M=[{title:"Data Nodes",path:p.Ay.SYSTEM.DATANODES.LIST,exactPathMatch:!0},{title:"Cluster Management",path:p.Ay.SYSTEM.DATANODES.CLUSTER},{title:"Configuration",path:p.Ay.SYSTEM.DATANODES.CONFIGURATION},u&&{title:"Migration",path:p.Ay.SYSTEM.DATANODES.MIGRATION}],x=()=>e.createElement(f.Row,null,e.createElement(d.A,{items:M}))},"tTmUv/3r":(ae,U,r)=>{r.d(U,{$8:()=>M,Ay:()=>w,HU:()=>L,JY:()=>R,Qd:()=>b,ZA:()=>x,hK:()=>z,nh:()=>u,vB:()=>_});var e=r("DUKaTDO2"),n=r("MdYBRjRJ"),d=r("gyRmhZSW"),p=r("jAGDuYSC"),f=r("eFxcQyPT");const u=async(m,N)=>{try{const{failures:I,successfully_performed:y}=await(0,f.Ay)("POST",(0,n.H3)("/datanode/bulk_remove"),{entity_ids:m});I!=null&&I.length&&N(I.map(({entity_id:k})=>k)),(I==null?void 0:I.length)===m.length&&p.A.error(`Removing Data Node failed with status: ${JSON.stringify(I)}`,"Could not remove Data Nodes."),y&&p.A.success(`${y} Data Node${y>1?"s":""} removed successfully.`)}catch(I){p.A.error(`Removing Data Node failed with status: ${I}`,"Could not remove Data Nodes.")}},M=async(m,N)=>{try{const{failures:I,successfully_performed:y}=await(0,f.Ay)("POST",(0,n.H3)("/datanode/bulk_start"),{entity_ids:m});I!=null&&I.length&&N(I.map(({entity_id:k})=>k)),(I==null?void 0:I.length)===m.length&&p.A.error(`Starting Data Node failed with status: ${JSON.stringify(I)}`,"Could not start Data Nodes."),y&&p.A.success(`${y} Data Node${y>1?"s":""} started successfully.`)}catch(I){p.A.error(`Starting Data Node failed with status: ${I}`,"Could not start Data Nodes.")}},R=async(m,N)=>{try{const{failures:I,successfully_performed:y}=await(0,f.Ay)("POST",(0,n.H3)("/datanode/bulk_stop"),{entity_ids:m});I!=null&&I.length&&N(I.map(({entity_id:k})=>k)),(I==null?void 0:I.length)===m.length&&p.A.error(`Stopping Data Node failed with status: ${JSON.stringify(I)}`,"Could not stop Data Nodes."),y&&p.A.success(`${y} Data Node${y>1?"s":""} stopped successfully.`)}catch(I){p.A.error(`Stopping Data Node failed with status: ${I}`,"Could not stop Data Nodes.")}},x=async m=>{try{await(0,f.Ay)("DELETE",(0,n.H3)(`/datanode/${m}`)),p.A.success(`Data Node "${m}" removed successfully.`)}catch(N){p.A.error(`Removing Data Node failed with status: ${N}`,"Could not remove the Data Node.")}},L=async m=>{try{await(0,f.Ay)("POST",(0,n.H3)(`/datanode/${m}/start`)),p.A.success(`Data Node "${m}" started successfully.`)}catch(N){p.A.error(`Starting Data Node failed with status: ${N}`,"Could not start the Data Node.")}},_=async m=>{try{await(0,f.Ay)("POST",(0,n.H3)(`/datanode/${m}/stop`)),p.A.success(`Data Node "${m}" stopped successfully.`)}catch(N){p.A.error(`Stopping Data Node failed with status: ${N}`,"Could not stop the Data Node.")}},b=async m=>{try{await(0,f.Ay)("POST",(0,n.H3)(`/datanode/${m}/reset`)),p.A.success(`Data Node "${m}" rejoined successfully.`)}catch(N){p.A.error(`Rejoining Data Node failed with status: ${N}`,"Could not rejoin the Data Node.")}},z=m=>(0,f.Ay)("POST",(0,n.H3)(`/certrenewal/${m}`)).then(()=>{p.A.success("Certificate renewed successfully.")}).catch(N=>{p.A.error(`Certificate renewal failed with error: ${N}`)}),K=async m=>{var N,I;const y=(0,d.A)("/system/cluster/datanodes",m==null?void 0:m.page,m==null?void 0:m.pageSize,m==null?void 0:m.query,{sort:(N=m==null?void 0:m.sort)==null?void 0:N.attributeId,order:(I=m==null?void 0:m.sort)==null?void 0:I.direction});return(0,f.Ay)("GET",(0,n.H3)(y))},w=(m={query:"",page:1,pageSize:0},{enabled:N}={enabled:!0},I=5e3)=>{const{data:y,refetch:k,isInitialLoading:Ee,error:q}=(0,e.useQuery)(["datanodes"],()=>K(m),{onError:Q=>{p.A.error(`Loading Data Nodes failed with status: ${Q}`,"Could not load Data Nodes.")},notifyOnChangeProps:["data","error"],refetchInterval:I,enabled:N});return{data:y||{attributes:[],elements:[],pagination:{query:"",page:1,per_page:0,total:0,count:0}},refetch:k,isInitialLoading:Ee,error:q}}},"9GOsZwoo":(ae,U,r)=>{r.d(U,{A:()=>p,h:()=>u});var e=r("DUKaTDO2"),n=r("jAGDuYSC"),d=r("xAuw/bbM");const p=["migration-state"],u=(M=!1)=>{const{data:R,isLoading:x}=(0,e.useQuery)(p,()=>d.Nh.status(),{onError:L=>n.A.error(L.message),retry:2,refetchInterval:M});return{currentStep:R,isLoading:x}}},wH8GqTlC:(ae,U,r)=>{r.r(U),r.d(U,{default:()=>Rt});var e=r("Z7aTuO5B"),n=r("rIl5IEuP"),d=r("IOI9nV80"),p=r("E+CaPsQD"),f=r("pSEhaN5V"),u=r("J6y4/h8P"),M=r("UiXZqrDE"),R=r("DUKaTDO2"),x=r("eFxcQyPT"),L=r("MdYBRjRJ"),_=r("jAGDuYSC");const b=["data-nodes","ca-status"],z=()=>fetch("GET",qualifyUrl("ca"),void 0,!1),K=(t=3e3)=>{const[a,l]=useState({error:null,isInitialLoading:!1}),{data:o,isFetching:g}=useQuery({queryKey:b,queryFn:z,initialData:void 0,refetchInterval:t,retry:!1,onError:i=>{l({error:i,isInitialLoading:!1})},onSuccess:()=>{l({error:null,isInitialLoading:!1})}});return{data:o,isFetching:g,isInitialLoading:a.isInitialLoading,error:a.error}},oe=null;var w=r("9GOsZwoo");const m=t=>(0,x.Ay)("POST",(0,L.H3)("ca/create"),t,!1),I=()=>{const t=(0,R.useQueryClient)(),{mutateAsync:a}=(0,R.useMutation)(m,{onSuccess:()=>{_.A.success("CA created successfully"),t.invalidateQueries(b),t.invalidateQueries(w.A)},onError:o=>{_.A.error(`CA creation failed with error: ${o}`)}}),l=o=>a(o).catch(()=>{});return e.createElement("div",null,e.createElement("p",null,"Click on the \u201CCreate CA\u201D button to quickly create a new certificate authority for your Graylog Data Nodes."),e.createElement(M.Formik,{initialValues:{organization:"Graylog CA"},onSubmit:o=>l(o)},({isSubmitting:o,isValid:g})=>e.createElement(M.Form,null,e.createElement(d.jF,{id:"organization",placeholder:"Organization Name",name:"organization",label:"Organization Name",required:!0}),e.createElement(n.Button,{disabled:o||!g,type:"submit"},o?"Creating CA...":"Create CA"))))};var y=r("vRzdUUFc"),k=r("kwpLVeht");const q=()=>window.location.protocol!=="https:"?"NO":window.isSecureContext===void 0?"MAYBE":window.isSecureContext?"YES":"NO",Q=({renderIfSecure:t})=>{const a=q();return a==="YES"?t!=null?t:null:e.createElement(k.A,{bsStyle:"warning"},a==="NO"&&e.createElement(e.Fragment,null,"Your connection is not secure. Please be aware the information will be send to the server unencrypted."),a==="MAYBE"&&e.createElement(e.Fragment,null,"Your connection may not be secure. Please be aware the information may be send to the server unencrypted."))};Q.defaultProps={renderIfSecure:void 0};const Ae=Q,ye=(0,u.default)(y.mR)`
height: 120px;
display: flex;
align-items: center;
justify-content: center;
`,me=u.default.div`
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
`,ge=u.default.div`
margin-top: 5px;
margin-bottom: 5px;
`,re=u.default.div`
gap: 5px;
display: flex;
align-items: center;
`,le=(0,u.default)(d.In)`
cursor: pointer;
`,X=t=>{const a=new FormData;return t.password!==void 0&&a.append("password",t.password),t.files.forEach(l=>a.append("files",l)),(0,x.Rv)((0,L.H3)("ca/upload"),a,!1)},ie=t=>{var a,l;let o={};return(a=t.files)!=null&&a.length||(o={...o,files:"Please upload a file."}),((l=t.files)==null?void 0:l.length)>1&&(o={...o,files:"Please upload only a single file."}),o},se=u.default.p`
margin-bottom: 10px;
`,D=()=>{const t=(0,R.useQueryClient)(),a=(0,e.useCallback)(()=>{_.A.error("CA upload failed")},[]),{mutateAsync:l,isLoading:o}=(0,R.useMutation)(X,{onSuccess:()=>{_.A.success("CA uploaded successfully"),t.invalidateQueries(b),t.invalidateQueries(w.A)},onError:i=>{_.A.error(`CA upload failed with error: ${i}`)}}),g=(0,e.useCallback)(i=>l(i).catch(()=>{}),[l]);return e.createElement(M.Formik,{initialValues:{},onSubmit:g,validate:ie},({isSubmitting:i,isValid:E})=>e.createElement(M.Form,null,e.createElement(se,null,"Here you can upload your existing CA. You need to upload a single file containing both private key (encrypted or unencrypted), the CA certificate as well as any intermediate certificates. The file can be in PEM or in PKCS#12 format. If your private key is encrypted, you also need to supply its password."),e.createElement(M.Field,{name:"files"},({field:{name:h,onChange:S,value:$},meta:{error:C}})=>e.createElement(e.Fragment,null,e.createElement(n.Label,{required:!0,htmlFor:"ca-dropzone"},"Certificate Authority"),e.createElement(ye,{onDrop:P=>S({target:{name:h,value:P}}),onReject:a,"data-testid":"upload-dropzone",loading:o},e.createElement(me,null,e.createElement(y.mR.Accept,null,e.createElement(d.In,{name:"draft",type:"solid",size:"2x"})),e.createElement(y.mR.Reject,null,e.createElement(d.In,{name:"warning",size:"2x"})),e.createElement(y.mR.Idle,null,e.createElement(d.In,{name:"draft",type:"regular",size:"2x"})),e.createElement("div",null,"Drag CA here or click to select file"))),e.createElement(ge,null,$==null?void 0:$.filter(P=>!!P).map(({name:P},Ce)=>e.createElement(re,{key:P},e.createElement(d.In,{name:"draft"})," ",P," ",e.createElement(le,{name:"xmark",onClick:()=>{const Se=$.filter((Ue,de)=>de!==Ce);S({target:{name:h,value:Se}})}})))),C&&e.createElement(n.Input.Error,null,C))),e.createElement(d.jF,{id:"password",placeholder:"Password",name:"password",type:"password",label:"Password"}),e.createElement(Ae,{renderIfSecure:e.createElement("br",null)}),e.createElement(n.Button,{disabled:!E,type:"submit"},i?"Uploading CA...":"Upload CA")))},ce=["create","upload"],V=()=>e.createElement(e.Fragment,null,e.createElement("h2",null,"Configure Certificate Authority"),e.createElement("p",null,"In this step you can either upload or create a new certificate authority.",e.createElement("br",null),"The certificate authority will provision and manage certificates for your Data Nodes more easily."),e.createElement(n.Tabs,{defaultActiveKey:ce[0],id:"ca-configurations"},e.createElement(n.Tab,{eventKey:ce[0],title:"Create new CA"},e.createElement(I,null)),e.createElement(n.Tab,{eventKey:ce[1],title:"Upload CA"},e.createElement(D,null)))),j={CA_CONFIGURATION:{key:"CA_CONFIGURATION",description:"Configure a certificate authority"},RENEWAL_POLICY_CONFIGURATION:{key:"RENEWAL_POLICY_CONFIGURATION",description:"Configure a renewal policy"},COMPATIBILITY_CHECK:{key:"COMPATIBILITY_CHECK",description:"Check OpenSearch compatibility with datanode"},MANUAL_MIGRATION_STEP:{key:"MANUAL_MIGRATION_STEP",description:"Migration steps."},MIGRATION_FINISHED:{key:"MIGRATION_FINISHED",description:"Migration finished"}},s={NEW:{key:"NEW",description:"Migration"},MIGRATION_WELCOME_PAGE:{key:"MIGRATION_WELCOME_PAGE",description:"Welcome"},CA_CREATION_PAGE:{key:"CA_CREATION_PAGE",description:"Certificate authority"},RENEWAL_POLICY_CREATION_PAGE:{key:"RENEWAL_POLICY_CREATION_PAGE",description:"Certificate renewal policy"},MIGRATION_SELECTION_PAGE:{key:"MIGRATION_SELECTION_PAGE",description:"Migration steps"},ROLLING_UPGRADE_MIGRATION_WELCOME_PAGE:{key:"ROLLING_UPGRADE_MIGRATION_WELCOME_PAGE",description:"Welcome to In-Place migration"},ASK_TO_SHUTDOWN_OLD_CLUSTER:{key:"ASK_TO_SHUTDOWN_OLD_CLUSTER",description:"Shut down old cluster"},MANUALLY_REMOVE_OLD_CONNECTION_STRING_FROM_CONFIG:{key:"MANUALLY_REMOVE_OLD_CONNECTION_STRING_FROM_CONFIG",description:"Remove connection string"},MESSAGE_PROCESSING_STOP:{key:"MESSAGE_PROCESSING_STOP",description:"Stop message processing"},REPLACE_CLUSTER:{key:"REPLACE_CLUSTER",description:"Replace existing cluster"},RESTART_GRAYLOG:{key:"RESTART_GRAYLOG",description:"Update configuration file and restart Graylog"},REMOTE_REINDEX_WELCOME_PAGE:{key:"REMOTE_REINDEX_WELCOME_PAGE",description:"Remote reindexing migration"},PROVISION_DATANODE_CERTIFICATES_PAGE:{key:"PROVISION_DATANODE_CERTIFICATES_PAGE",description:"Provision Data Node with certificates"},PROVISION_DATANODE_CERTIFICATES_RUNNING:{key:"PROVISION_DATANODE_CERTIFICATES_RUNNING",description:"Provision the Data Node's certificate."},EXISTING_DATA_MIGRATION_QUESTION_PAGE:{key:"EXISTING_DATA_MIGRATION_QUESTION_PAGE",description:"Migrate existing data question"},MIGRATE_EXISTING_DATA:{key:"MIGRATE_EXISTING_DATA",description:"Migrate existing data"},REMOTE_REINDEX_RUNNING:{key:"REMOTE_REINDEX_RUNNING",description:"Remote reindexing migration running"},DIRECTORY_COMPATIBILITY_CHECK_PAGE:{key:"DIRECTORY_COMPATIBILITY_CHECK_PAGE",description:"Directory compatibility check"},PROVISION_ROLLING_UPGRADE_NODES_WITH_CERTIFICATES:{key:"PROVISION_ROLLING_UPGRADE_NODES_WITH_CERTIFICATES",description:"Certificate provisioning overview"},PROVISION_ROLLING_UPGRADE_NODES_RUNNING:{key:"PROVISION_ROLLING_UPGRADE_NODES_RUNNING",description:"Provision the Data Node's certificate."},JOURNAL_SIZE_DOWNTIME_WARNING:{key:"JOURNAL_SIZE_DOWNTIME_WARNING",description:"Journal size downtime warning"},FAILED:{key:"FAILED",description:"Migration failed"},FINISHED:{key:"FINISHED",description:"Migration finished"}},_e=[s.ROLLING_UPGRADE_MIGRATION_WELCOME_PAGE.key,s.DIRECTORY_COMPATIBILITY_CHECK_PAGE.key,s.PROVISION_ROLLING_UPGRADE_NODES_WITH_CERTIFICATES.key,s.PROVISION_ROLLING_UPGRADE_NODES_RUNNING.key,s.JOURNAL_SIZE_DOWNTIME_WARNING.key,s.MESSAGE_PROCESSING_STOP.key,s.RESTART_GRAYLOG.key],J=[s.REMOTE_REINDEX_WELCOME_PAGE.key,s.PROVISION_DATANODE_CERTIFICATES_PAGE.key,s.PROVISION_DATANODE_CERTIFICATES_RUNNING.key,s.EXISTING_DATA_MIGRATION_QUESTION_PAGE.key,s.MIGRATE_EXISTING_DATA.key,s.REMOTE_REINDEX_RUNNING.key,s.ASK_TO_SHUTDOWN_OLD_CLUSTER.key],c=[s.NEW.key,s.MIGRATION_WELCOME_PAGE.key,s.CA_CREATION_PAGE.key,s.RENEWAL_POLICY_CREATION_PAGE.key,s.MIGRATION_SELECTION_PAGE.key,s.FINISHED.key],A={SHOW_RENEWAL_POLICY_CREATION:{key:"SHOW_RENEWAL_POLICY_CREATION",label:"Configure certificate renewal policy"},SHOW_MIGRATION_SELECTION:{key:"SHOW_MIGRATION_SELECTION",label:"Go to migration steps"},RUN_DIRECTORY_COMPATIBILITY_CHECK:{key:"INSTALL_DATANODES_ON_EVERY_NODE",label:"Run directory compatibilty check"},PROVISION_DATANODE_CERTIFICATES:{key:"PROVISION_DATANODE_CERTIFICATES",label:"Provision Data Nodes with certificates"},SKIP_EXISTING_DATA_MIGRATION:{key:"SKIP_EXISTING_DATA_MIGRATION",label:"Skip existing data migration"},RETRY_MIGRATE_EXISTING_DATA:{key:"RETRY_MIGRATE_EXISTING_DATA",label:"Retry migrate existing data"},CHECK_REMOTE_INDEXER_CONNECTION:{key:"CHECK_REMOTE_INDEXER_CONNECTION",label:"Check connection"},START_REMOTE_REINDEX_MIGRATION:{key:"START_REMOTE_REINDEX_MIGRATION",label:"Start migration"}},G=null,B=(0,u.default)(n.ButtonToolbar)`
flex-wrap: wrap;
`,Z=({nextSteps:t,disabled:a,onTriggerStep:l,args:o,hidden:g})=>g?null:e.createElement(B,null,t.map(i=>{var E;return e.createElement(n.Button,{key:i,bsStyle:"success",bsSize:"small",disabled:a,onClick:()=>l(i,o)},((E=A[i])==null?void 0:E.label)||"Next")}));Z.defaultProps={nextSteps:[],disabled:!1,args:{},hidden:!1};const T=Z,Y=(0,u.default)(n.Alert)`
margin-top: 10px;
margin-bottom: 5px;
`,W=({errorMessage:t})=>t?e.createElement(Y,{bsStyle:"danger"},t):null,te=({currentStep:t,onTriggerStep:a})=>e.createElement(e.Fragment,null,e.createElement(W,{errorMessage:t.error_message}),e.createElement(V,null),e.createElement(y.$x,{h:"xs"}),t.next_steps.length<=0&&e.createElement("p",null,"Please create a certificate Authority before proceeding."),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a}));var H=r("fVisTAey"),pe=r("tTmUv/3r");const Te=(0,u.default)(d.In)`
margin-right: 0.5em;
`,Re=({showProvisioningState:t})=>{const{data:a,isInitialLoading:l}=(0,pe.Ay)();return l?e.createElement(d.y$,{text:"Loading Data Nodes"}):e.createElement("div",null,!a||(a==null?void 0:a.elements.length)===0?e.createElement(e.Fragment,null,e.createElement("p",null,e.createElement(Te,{name:"info"}),"There are no Data Nodes found."),e.createElement(n.Alert,{bsStyle:"warning",title:"No Data Nodes found"},"Please start at least a Data Node to continue the migration process. You can find more information on how to start a Data Nodes in our ",e.createElement(H.$,{page:"graylog-data-node",text:"documentation"}),"."),e.createElement("p",null,e.createElement(d.y$,{text:"Looking for Data Nodes..."}))):e.createElement(e.Fragment,null,e.createElement("h4",null,"Data Nodes found: ",a==null?void 0:a.elements.length),e.createElement("br",null),e.createElement(n.Table,{bordered:!0,condensed:!0,striped:!0,hover:!0},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Hostname"),e.createElement("th",null,"Transport address"),e.createElement("th",null,"Status"),e.createElement("th",null,"Certificate valid until"))),e.createElement("tbody",null,a.elements.map(o=>e.createElement("tr",{key:o.id},e.createElement("td",null,o.hostname),e.createElement("td",null,o.transport_address),e.createElement("td",null,t?o.status:o.data_node_status),e.createElement("td",null,o.cert_valid_until?e.createElement(d.sR,{dateTime:o.cert_valid_until}):"No certificate")))))))};Re.defaultProps={showProvisioningState:!0};const Ie=Re,we=(0,u.default)(n.Panel)(({bsStyle:t="default",theme:a})=>(0,u.css)`
&.panel {
background-color: ${a.colors.global.contentBackground};
.panel-heading {
color: ${a.colors.variant.darker[t]};
}
}
margin-top: ${a.spacings.md} !important;
`),De=()=>e.createElement(we,{bsStyle:"info"},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,{componentClass:"h3"},"In-Place migration")),e.createElement(n.Panel.Body,null,"For In-Place migrations, please ensure the configuration of your Data Nodes in ",e.createElement("code",null,"datanode.conf"),", specifically the ",e.createElement("code",null,"opensearch_data_location")," configuration option, points to the correct existing OpenSearch data directory on every node.")),ke=u.default.h2`
margin-top: 5px;
margin-bottom: 10px;
`,he=(0,u.default)(n.Panel)(({bsStyle:t="default",theme:a})=>(0,u.css)`
&.panel {
background-color: ${a.colors.global.contentBackground};
.panel-heading {
color: ${a.colors.variant.darker[t]};
}
}
`),We=(0,u.default)(he)`
margin-top: 30px;
`,Fe=({currentStep:t,onTriggerStep:a})=>e.createElement(n.Row,null,e.createElement(n.Col,{md:6},e.createElement(W,{errorMessage:t.error_message}),e.createElement(ke,null,"Data Nodes Migration"),e.createElement("p",null,"The Graylog Data Node is a management component designed to configure and optimize OpenSearch for use with Graylog, reducing administrative overhead and simplifying future updates."),e.createElement("p",null,"Deployments earlier than v5.2 or that opted to not install with a Data Node will need to migrate the message databases to Data Nodes."),e.createElement("p",null,"This migration tool will check the compatibility of your components and guide you through to migrate your existing OpenSearch data to a Data Node.",e.createElement("br",null)),e.createElement("p",null,"Migrating to Data Node will require some steps to be performed on the OS, within your current OS/ES cluster, and in your configuration files."),e.createElement("p",null,"You can get more information on the Data Node migration ",e.createElement(H.$,{page:"graylog-data-node",text:"documentation"}),"."),e.createElement("br",null),e.createElement(Ie,null),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a})),e.createElement(n.Col,{md:6},e.createElement(We,{bsStyle:"info"},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,{componentClass:"h3"},e.createElement(d.In,{name:"info"})," Migrating Elasticsearch 7.10")),e.createElement(n.Panel.Body,null,e.createElement("p",null,"Migration from ",e.createElement("code",null,"Elasticsearch 7.10")," needs an additional step. ES 7.10 does not understand JWT authentication. So you will need to first migrate to OpenSearch before running the update of the security information. Please find more information in our ",e.createElement(H.$,{page:"graylog-data-node",text:"documentation"}),"."),e.createElement("h5",null,"Migrating an OpenSearch Cluster"),e.createElement("p",null,"Depending on how you secured your existing cluster, some preliminary changes are needed to the security configuration. We use JWT authentication between Graylog and OpenSearch. If you want to perform an In-Place migration of your existing cluster into the Data Node, you have to manually include JWT authentication to your existing OpenSearch cluster prior to running the migration wizard."),e.createElement("p",null,"Enable JWT authentication in ",e.createElement("code",null,"opensearch-security/config.yml")," (section ",e.createElement("code",null,"jwt_auth_domain"),", ",e.createElement("code",null,"http_enabled: true"),", ",e.createElement("code",null,"transport_enabled: true"),") Add the signing key by converting the ",e.createElement("code",null,"GRAYLOG_PASSWORD_SECRET")," to ",e.createElement("code",null,"base64")," e.g. by doing ",e.createElement("code",null,'echo `"`The password secret you chose`"` | base64')," and put it into the ",e.createElement("code",null,"signing_key")," line"),e.createElement("h5",null,"Usage of certificates"),e.createElement("p",null,"If your existing cluster uses certificates, by default these will get replaced with the Graylog CA and automatically generated certificates during provisioning of the Data Nodes. If you have to reuse your own certificates, please read the ",e.createElement(H.$,{page:"graylog-data-node",text:"documentation"})," on how to include your own CA/certificates in Graylog/DataNode"))),e.createElement(De,null))),Be=(0,u.default)(he)`
margin-top: 30px;
`,$e=()=>e.createElement(Be,{bsStyle:"warning"},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,{componentClass:"h3"},e.createElement(d.In,{name:"warning"})," Journal size warning")),e.createElement(n.Panel.Body,null,e.createElement("p",null,"Please note that during migration you will have to stop processing on your Graylog node, this will result in the journal growing in size. Therefore you will have to increase your journal volume size during the Journal size downsize step or earlier."))),Pe=({currentStep:t,onTriggerStep:a})=>{var l;const{data:o}=(0,pe.Ay)();return e.createElement(e.Fragment,null,e.createElement(n.Row,null,e.createElement(n.Col,{md:6},e.createElement("h3",null,"Welcome"),e.createElement("p",null,"An In-Place migration will migrate the data folder of your existing cluster to a Data Node cluster."),e.createElement("p",null,"To start please install Data Node on every OS/ES node from your previous setup. You can find more information on how to download and install the Data Node ",e.createElement(H.$,{page:"graylog-data-node",text:"here"}),"."),e.createElement(Ie,null)),e.createElement(n.Col,{md:6},e.createElement($e,null),e.createElement(De,null))),e.createElement(T,{disabled:((l=o==null?void 0:o.elements)==null?void 0:l.length)<=0,nextSteps:t.next_steps,onTriggerStep:a}))},Me=({currentStep:t,onTriggerStep:a})=>{var l;const{currentStep:o,isLoading:g}=(0,w.h)(3e3);if(g)return e.createElement(d.y$,{text:"Loading migration state."});const i=o.state===s.PROVISION_ROLLING_UPGRADE_NODES_WITH_CERTIFICATES.key||o.state===s.PROVISION_DATANODE_CERTIFICATES_PAGE.key,E=o.state===s.PROVISION_ROLLING_UPGRADE_NODES_RUNNING.key||o.state===s.PROVISION_DATANODE_CERTIFICATES_RUNNING.key,h=((l=o==null?void 0:o.next_steps)==null?void 0:l.length)>0;return e.createElement(e.Fragment,null,i&&e.createElement("p",null,"Certificate authority has been configured successfully.",e.createElement("br",null),"You can now provision certificate for your Data Nodes."),E&&!h&&e.createElement(d.y$,{text:"Provisioning certificate"}),E&&h&&e.createElement(n.Alert,{bsStyle:"success"},"Provisioning the Data Node finished."),e.createElement(Ie,null),e.createElement("br",null),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a}))},Ke=async()=>(0,x.Ay)("GET",(0,L.H3)("/migration/journalestimate")),Ye=()=>{const{data:t,refetch:a,isInitialLoading:l,error:o,isError:g}=(0,R.useQuery)(["JournalDowntimeSize"],Ke,{onError:i=>{_.A.error(`Loading Data Node migration journal estimate: ${i}`,"Could not load Data Node journal size estimate")},notifyOnChangeProps:["data","error"],refetchInterval:5e3});return{data:Math.round((t||0)/1024),refetch:a,isInitialLoading:l,error:o,isError:g}},He=(0,u.default)(n.Alert)`
margin-top: 10px;
margin-bottom: 5px;
`,ze=({currentStep:t,onTriggerStep:a})=>{const{data:l,error:o,isError:g}=Ye();return e.createElement(e.Fragment,null,e.createElement("h3",null,"Journal downtime size warning"),e.createElement("p",null,"Please note that during migration data processing will stop on your Graylog node, this will result in the journal growing in size."),e.createElement("p",null,"Therefore increase your journal volume size."),e.createElement("p",null,"Your current journal throughput is: ",e.createElement("b",null,l," KB/min")),g&&e.createElement(W,{errorMessage:`There was an error while estimating your journal throughput: ${o==null?void 0:o.message}`}),e.createElement(He,{bsStyle:"warning"},"Please make sure your journal volume size is sufficient before proceeding."),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a}))},Ve=(0,u.default)(he)`
margin-top: 30px;
`,Qe=({currentStep:t,onTriggerStep:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"Graylog processing is stopped."),e.createElement(Ve,{bsStyle:"warning"},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,{componentClass:"h3"},e.createElement(d.In,{name:"warning"}),"Stop OpenSearch")),e.createElement(n.Panel.Body,null,e.createElement("p",null,"Please stop your OpenSearch cluster before proceeding."),e.createElement("p",null,"If you are migrating existing OpenSearch data by pointing the data node to its data directory, make sure that the user running the data node (usually graylog-datanode) has permissions to write to the data directory set in the data node configuration."))),e.createElement("p",null),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a})),Xe=async()=>(0,x.Ay)("GET",(0,L.H3)("datanodes/all/rest/indices-directory/compatibility")),je=({enabled:t}={enabled:!0})=>{const{data:a,refetch:l,isInitialLoading:o,error:g,isError:i}=(0,R.useQuery)(["datanodes","compatibility"],()=>Xe(),{keepPreviousData:!0,enabled:t});return{data:a,error:g,refetch:l,isInitialLoading:o,isError:i}},Je=u.default.div`
display: grid;
grid-template-columns: 25% 75%;
grid-gap: 0.5rem;
margin-bottom: 1rem;
`,ve=u.default.span`
display: block;
clear: both;
`,Ze=({hostname:t,opensearchVersion:a,nodeInfo:l})=>{var o,g;const{opensearch_data_location:i,nodes:E}=l,[h,S]=(0,e.useState)(`Node: 1, Version: ${(o=E[0])==null?void 0:o.node_version}, ${(g=E[0])==null?void 0:g.indices.length} indices`),$=C=>{S(C!=null?C:h)};return e.createElement(Je,null,e.createElement("div",null,e.createElement(ve,null,e.createElement("strong",null,"Datanode OpenSearch version"),": ",a),e.createElement(ve,null,e.createElement("strong",null,"OpenSearch data location"),": ",i)),e.createElement("div",null,e.createElement(d.nD,{defaultActiveKey:h,onSelect:$,id:"nodes","data-testid":"nodes",activeKey:h},E.map(C=>e.createElement(d.As,{key:`${C.node_version}${C.indices.length}`,name:`Node: ${t}, Version: ${C.node_version}, ${C.indices.length} indices`},e.createElement(n.Table,{striped:!0,bordered:!0,condensed:!0},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"Indices"),e.createElement("th",null,"Creation date"),e.createElement("th",null,"Index version"),e.createElement("th",null,"Shards"))),e.createElement("tbody",null,C.indices.map(P=>e.createElement("tr",{key:P.index_id},e.createElement("td",null,P.index_name),e.createElement("td",null,e.createElement(d.Dc,{dateTime:P.creation_date})),e.createElement("td",null,P.index_version_created),e.createElement("td",null,P.shards.length," ",e.createElement(d.Fb,{singular:"shard",plural:"shards",value:P.shards.length})," "))))))))))},qe=(0,u.default)(n.Alert)`
margin-top: 10px;
margin-bottom: 5px;
`,be=({currentStep:t,onTriggerStep:a})=>{const{error:l,data:o,isInitialLoading:g,isError:i}=je();if(g)return e.createElement(d.y$,{text:"Loading compatibility check results..."});const E=Object.values(o||{}).flatMap(S=>(S==null?void 0:S.compatibility_errors)||[]),h=E.length===0;return e.createElement(e.Fragment,null,e.createElement("h3",null,"Directory compatibility check"),e.createElement(qe,{bsStyle:!i&&h?"success":"danger"},h&&e.createElement("h4",null,"Your existing OpenSearch data can be migrated to Data Node."),!i&&!h&&e.createElement(e.Fragment,null,e.createElement("h4",null,"Your existing OpenSearch data cannot be migrated to Data Node."),e.createElement("br",null),"Error: ",E," ",E.map(S=>e.createElement("dd",{key:S},S))),i&&e.createElement(e.Fragment,null,e.createElement("h4",null,"There was an error checking the compatibility"),e.createElement("p",null,l.message))),e.createElement("br",null),!h&&e.createElement("p",null,"Your OpenSearch cluster cannot be migrated to this Data Node version because it's not compatible."),h&&Object.keys(o).map(S=>e.createElement(Ze,{key:S,hostname:S,opensearchVersion:o[S].opensearch_version,nodeInfo:o[S].info})),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a}))};be.defaultProps={canSkip:!0};const et=be,tt=({currentStep:t,onTriggerStep:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"Almost there!"),e.createElement("p",null,"Please remove the ",e.createElement("code",null,"elasticsearch_hosts")," line from your ",e.createElement("code",null,"graylog.conf")),e.createElement("p",null,"E.g., ",e.createElement("code",null,"elasticsearch_hosts = https://admin:admin@opensearch1:9200,https://admin:admin@opensearch2:9200,https://admin:admin@opensearch3:9200")),e.createElement(y.$x,{h:"md"}),e.createElement(Ie,{showProvisioningState:!1}),e.createElement("p",null,"Please wait for all data nodes to become 'AVAILABLE'. Please check the data node's log if they do not become available within 1-2 minutes."),e.createElement("p",null,"Once that's done, please restart Graylog to finish the migration."),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a})),nt=u.default.h3`
margin-bottom: 10px;
& > small {
font-size: 80%;
}
`,at=(0,u.default)(n.PanelGroup)`
&.panel-group > .panel {
margin-top: 0;
border-color: ${t=>t.theme.colors.input.border};
background-color: ${t=>t.theme.colors.global.contentBackground};
.panel-heading {
background-color: ${t=>t.theme.colors.table.row.backgroundAlt};
}
&:not(:first-child) {
border-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
&:not(:last-child) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
`,ot=({currentStep:t,onTriggerStep:a})=>{const{state:l}=t,o=async(i,E={})=>a(i,E),g=i=>{switch(i){case s.ROLLING_UPGRADE_MIGRATION_WELCOME_PAGE.key:return e.createElement(Pe,{currentStep:t,onTriggerStep:o});case s.DIRECTORY_COMPATIBILITY_CHECK_PAGE.key:return e.createElement(et,{currentStep:t,onTriggerStep:o});case s.PROVISION_ROLLING_UPGRADE_NODES_WITH_CERTIFICATES.key:case s.PROVISION_ROLLING_UPGRADE_NODES_RUNNING.key:return e.createElement(Me,{currentStep:t,onTriggerStep:o});case s.JOURNAL_SIZE_DOWNTIME_WARNING.key:return e.createElement(ze,{currentStep:t,onTriggerStep:o});case s.MESSAGE_PROCESSING_STOP.key:return e.createElement(Qe,{currentStep:t,onTriggerStep:o});case s.RESTART_GRAYLOG.key:return e.createElement(tt,{currentStep:t,onTriggerStep:o});default:return e.createElement(Pe,{currentStep:t,onTriggerStep:o})}};return e.createElement(n.Col,null,e.createElement(nt,null,"In-Place migration"),e.createElement("p",null,"Follow these steps to migrate your existing OpenSearch version 2.x or 1.3.x cluster to Data Nodes."),e.createElement(at,{accordion:!0,id:"first",activeKey:l,onSelect:()=>{}},_e.map((i,E)=>{const{description:h}=s[i];return e.createElement(n.Panel,{eventKey:i,key:i,collapsible:!1},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,null,e.createElement(n.Panel.Toggle,{tabIndex:E},`${E+1}. ${h}`))),e.createElement(n.Panel.Collapse,null,e.createElement(n.Panel.Body,null,e.createElement(W,{errorMessage:t.error_message}),g(i))))})))};var rt=r("xAuw/bbM");const Ne=()=>{const t=(0,R.useQueryClient)(),{mutateAsync:a,isLoading:l,error:o,isError:g}=(0,R.useMutation)(rt.Nh.trigger,{onSuccess:()=>{t.invalidateQueries(w.A)},onError:i=>_.A.error(i.message)});return{onTriggerNextState:a,isLoadingNextMigrationState:l,isError:g,error:o}},Ge=({currentStep:t,onTriggerStep:a})=>{var l;const{data:o}=(0,pe.Ay)();return e.createElement(e.Fragment,null,e.createElement("h3",null,"Welcome"),e.createElement("p",null,"Using the Remote Reindexing will allow you to move to Data Nodes by reindexing the data in your existing cluster to a Data Node cluster."),e.createElement("p",null,"To start please install Data Node on every OS/ES node from your previous setup. You can find more information on how to download and install the Data Node ",e.createElement(H.$,{page:"graylog-data-node",text:"here"}),"."),e.createElement(Ie,null),e.createElement(T,{disabled:((l=o==null?void 0:o.elements)==null?void 0:l.length)<=0,nextSteps:t.next_steps,onTriggerStep:a}))},lt=({currentStep:t,onTriggerStep:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"Do you want to migrate your existing data?"),e.createElement(y.$x,{h:"md"}),e.createElement("p",null,"Please remove the ",e.createElement("code",null,"elasticsearch_hosts")," line from your Graylog configuration file (",e.createElement("code",null,"graylog.conf"),")."),e.createElement("p",null,"E.g., ",e.createElement("code",null,"elasticsearch_hosts = https://admin:admin@opensearch1:9200,https://admin:admin@opensearch2:9200,https://admin:admin@opensearch3:9200")),e.createElement(y.$x,{h:"md"}),e.createElement("p",null,"Once that is done please proceed to the next step."),e.createElement(y.$x,{h:"md"}),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a})),it=["RETRY_MIGRATE_EXISTING_DATA","SHOW_ASK_TO_SHUTDOWN_OLD_CLUSTER"],st=(t,a,l=3e3)=>{const[o,g]=(0,e.useState)(["RETRY_MIGRATE_EXISTING_DATA"]),[i,E]=(0,e.useState)(void 0);return(0,e.useEffect)(()=>{const S=async()=>{(t==null?void 0:t.state)===s.REMOTE_REINDEX_RUNNING.key&&((i==null?void 0:i.progress)===100&&(i==null?void 0:i.status)==="FINISHED"?g(t==null?void 0:t.next_steps.filter(C=>it.includes(C))):a("REQUEST_MIGRATION_STATUS").then(C=>{const P=C==null?void 0:C.response;P&&E(P)}))},$=setInterval(()=>{S()},l);return()=>clearInterval($)},[a,i,t==null?void 0:t.state,t==null?void 0:t.next_steps,l]),{nextSteps:o,migrationStatus:i,handleTriggerStep:(S,$)=>a(S,$).then(C=>(E(void 0),C))}},ct=u.default.div`
max-height: 100px;
overflow-y: auto;
`,ut=({currentStep:t,onTriggerStep:a})=>{const{nextSteps:l,migrationStatus:o,handleTriggerStep:g}=st(t,a),i=(o==null?void 0:o.indices.filter(E=>E.status==="ERROR"))||[];return e.createElement(e.Fragment,null,"We are currently migrating your existing data asynchronically, once the data migration is finished you will be automatically transitioned to the next step.",e.createElement("br",null),e.createElement("br",null),e.createElement(d.z2,{bars:[{animated:!0,striped:!0,value:(o==null?void 0:o.progress)||0,bsStyle:"info",label:`${(o==null?void 0:o.status)||""} ${(o==null?void 0:o.progress)||0}%`}]}),i.length>0&&e.createElement(n.Alert,{title:"Migration failed",bsStyle:"danger"},e.createElement(ct,null,i.map(E=>e.createElement("span",{key:E.name},e.createElement("b",null,E.name),e.createElement("p",null,E.error_msg))))),e.createElement(T,{nextSteps:l||t.next_steps,onTriggerStep:g}))},dt=u.default.div`
max-height: 300px;
overflow-y: scroll;
overflow: -moz-scrollbars-vertical;
-ms-overflow-y: scroll;
margin-top: 5px;
`,Et=({currentStep:t,onTriggerStep:a})=>{const[l,o]=(0,e.useState)(["CHECK_REMOTE_INDEXER_CONNECTION"]),[g,i]=(0,e.useState)(null),[E,h]=(0,e.useState)(!1),[S,$]=(0,e.useState)([]),[C,P]=(0,e.useState)([]),Ce=(v,F)=>{var O;if(v==="CHECK_REMOTE_INDEXER_CONNECTION"){const ne=F==null?void 0:F.response;(O=ne==null?void 0:ne.indices)!=null&&O.length?($(ne.indices),P(ne.indices),o(t.next_steps.filter(Mt=>Mt==="START_REMOTE_REINDEX_MIGRATION"))):ne!=null&&ne.error?i(ne.error):i("No available index has been found for remote reindex migration.")}},Se=async(v,F)=>(h(!0),i(null),a(v,F).then(O=>(Ce(v,O),O)).catch(O=>(i(O==null?void 0:O.message),{})).finally(()=>h(!1))),Ue=()=>{i(null),h(!1),$([]),P([]),o(t.next_steps.filter(v=>v==="CHECK_REMOTE_INDEXER_CONNECTION"))},de=async(v,F)=>{await F(v.target.name,v.target.value),Ue()},Dt=v=>{C.includes(v)?P(C.filter(F=>F!==v)):P([...C,v])},Pt={allowlist:"",hostname:"",user:"",password:"",synchronous:!1,indices:[]};return e.createElement(M.Formik,{initialValues:Pt,onSubmit:()=>{}},({values:v,setFieldValue:F})=>e.createElement(M.Form,{role:"form"},e.createElement(n.Input,{id:"allowlist",name:"allowlist",label:"Allowlist of all machines in the old cluster",type:"text",disabled:E,value:v.allowlist,onChange:O=>de(O,F),required:!0}),e.createElement(n.Input,{id:"hostname",name:"hostname",label:"URI of the host to call the remote reindexing command against",type:"text",disabled:E,value:v.hostname,onChange:O=>de(O,F),required:!0}),e.createElement(n.Input,{id:"user",name:"user",label:"Username",type:"text",disabled:E,value:v.user,onChange:O=>de(O,F)}),e.createElement(n.Input,{id:"password",name:"password",label:"Password",type:"password",disabled:E,value:v.password,onChange:O=>de(O,F)}),S.length>0&&e.createElement(n.Alert,{title:"Valid connection",bsStyle:"success"},"These are the available ",e.createElement("b",null,S.length)," indices for the remote reindex migration:",e.createElement(dt,null,S.map(O=>e.createElement(n.Input,{type:"checkbox",key:O,name:O,id:O,label:O,disabled:E,checked:C.includes(O),onChange:()=>Dt(O)})))),g&&e.createElement(n.Alert,{bsStyle:"danger"},g),E?e.createElement(d.y$,null):e.createElement(T,{nextSteps:l||t.next_steps,onTriggerStep:Se,args:{...v,indices:C}})))},mt=({currentStep:t,onTriggerStep:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"The migration from your current ",e.createElement("code",null,"OpenSearch")," to the Data Node is almost done."),e.createElement("p",null,"To finish please shut down your ",e.createElement("code",null,"OpenSearch")," cluster before continuing."),e.createElement(y.$x,{h:"md"}),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a})),gt=u.default.h3`
margin-bottom: 10px;
& > small {
font-size: 80%;
}
`,_t=(0,u.default)(n.PanelGroup)`
&.panel-group > .panel {
margin-top: 0;
border-color: ${t=>t.theme.colors.input.border};
background-color: ${t=>t.theme.colors.global.contentBackground};
.panel-heading {
background-color: ${t=>t.theme.colors.table.row.backgroundAlt};
}
&:not(:first-child) {
border-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
&:not(:last-child) {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
}
`,pt=({currentStep:t,onTriggerStep:a})=>{const{state:l}=t,o=async(i,E={})=>a(i,E),g=i=>{switch(i){case s.REMOTE_REINDEX_WELCOME_PAGE.key:return e.createElement(Ge,{currentStep:t,onTriggerStep:o});case s.PROVISION_DATANODE_CERTIFICATES_PAGE.key:case s.PROVISION_DATANODE_CERTIFICATES_RUNNING.key:return e.createElement(Me,{currentStep:t,onTriggerStep:o});case s.EXISTING_DATA_MIGRATION_QUESTION_PAGE.key:return e.createElement(lt,{currentStep:t,onTriggerStep:o});case s.MIGRATE_EXISTING_DATA.key:return e.createElement(Et,{currentStep:t,onTriggerStep:o});case s.REMOTE_REINDEX_RUNNING.key:return e.createElement(ut,{currentStep:t,onTriggerStep:o});case s.ASK_TO_SHUTDOWN_OLD_CLUSTER.key:return e.createElement(mt,{currentStep:t,onTriggerStep:o});default:return e.createElement(Ge,{currentStep:t,onTriggerStep:o})}};return e.createElement(n.Col,null,e.createElement(gt,null,"Remote reindexing migration"),e.createElement("p",null,"Follow these steps to migrate your existing OpenSearch 2.x or 1.3.x cluster to Data Nodes."),e.createElement(_t,{accordion:!0,id:"first",activeKey:l,onSelect:()=>{}},J.map((i,E)=>{const{description:h}=s[i];return e.createElement(n.Panel,{key:i,eventKey:i,collapsible:!1},e.createElement(n.Panel.Heading,null,e.createElement(n.Panel.Title,null,e.createElement(n.Panel.Toggle,{tabIndex:E},`${E+1}. ${h}`))),e.createElement(n.Panel.Body,{collapsible:!0},e.createElement(W,{errorMessage:t.error_message}),g(i)))})))},It=()=>{const t=[{label:"In-Place migration",value:"SELECT_ROLLING_UPGRADE_MIGRATION"},{label:"Remote Re-indexing Migration",value:"SELECT_REMOTE_REINDEX_MIGRATION"}],{currentStep:a}=(0,w.h)(),{onTriggerNextState:l}=Ne(),o=async(g,i={})=>l({step:g,args:i});return e.createElement(e.Fragment,null,(a==null?void 0:a.state)===s.MIGRATION_SELECTION_PAGE.key&&e.createElement(n.Col,{md:8,"data-testid":"datanode-migration-select"},e.createElement("form",{className:"form form-horizontal",onSubmit:()=>{}},e.createElement(n.Input,{id:"datanode-migration-type-select",label:"Migration type",required:!0,autoFocus:!0,help:"The type of migration you want to do.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},e.createElement(d.l6,{placeholder:"Select migration type",clearable:!1,inputId:"datanode-migration-type-select",options:t,matchProp:"label",onChange:o,value:null})))),e.createElement(W,{errorMessage:a.error_message}),a&&_e.includes(a.state)&&e.createElement(ot,{onTriggerStep:o,currentStep:a}),a&&J.includes(a.state)&&e.createElement(pt,{onTriggerStep:o,currentStep:a}))},At=(t,a)=>!a&&c.includes(t==null?void 0:t.state)?t:{state:s.MIGRATION_SELECTION_PAGE.key,next_steps:["SELECT_ROLLING_UPGRADE_MIGRATION","SELECT_REMOTE_REINDEX_MIGRATION"]},Le=()=>{const{currentStep:t,isLoading:a}=(0,w.h)(),l=At(t,a);return(0,e.useMemo)(()=>({isLoading:a,step:l,errors:null}),[a,l])};var yt=r("orGoq0ZB");const ft=({currentStep:t,onTriggerStep:a})=>e.createElement(e.Fragment,null,e.createElement(W,{errorMessage:t.error_message}),e.createElement(yt.A,null),e.createElement(y.$x,{h:"xs"}),t.next_steps.length<=0&&e.createElement("p",null,"Please create a certificate renewal policy before proceeding."),e.createElement(T,{nextSteps:t.next_steps,onTriggerStep:a})),Tt=()=>e.createElement("p",null,"The migration is finished !"),ht=(0,u.default)(d.sQ)`
.migration-wizard{
.nav > li > a {
background-color: red !important;
}
}
`,Nt=()=>{const{step:t,isLoading:a}=Le(),{onTriggerNextState:l}=Ne();if(a)return e.createElement(d.y$,{text:"Loading ..."});const o=async(E,h={})=>l({step:E,args:h}),{state:g}=t,i=[{key:s.MIGRATION_WELCOME_PAGE.key,title:s.MIGRATION_WELCOME_PAGE.description,component:e.createElement(Fe,{currentStep:t,onTriggerStep:o})},{key:s.CA_CREATION_PAGE.key,title:s.CA_CREATION_PAGE.description,component:e.createElement(te,{currentStep:t,onTriggerStep:o})},{key:s.RENEWAL_POLICY_CREATION_PAGE.key,title:s.RENEWAL_POLICY_CREATION_PAGE.description,component:e.createElement(ft,{currentStep:t,onTriggerStep:o})},{key:s.MIGRATION_SELECTION_PAGE.key,title:s.MIGRATION_SELECTION_PAGE.description,component:e.createElement(It,null)},{key:s.FINISHED.key,title:s.FINISHED.description,component:e.createElement(Tt,null)}];return e.createElement(ht,{steps:i,activeStep:g,onStepChange:()=>{},horizontal:!0,justified:!0,containerClassName:"migration-wizard",hidePreviousNextButtons:!0})},xe=["data-nodes","ca-status"],Ct=()=>fetch("GET",qualifyUrl("/api/ca"),void 0,!1),nn=()=>{const[t,a]=useState({error:null,isInitialLoading:!1}),{data:l,isFetching:o}=useQuery({queryKey:xe,queryFn:Ct,initialData:void 0,refetchInterval:3e3,retry:!1,onError:g=>{a({error:g,isInitialLoading:!1})},onSuccess:()=>{a({error:null,isInitialLoading:!1})}});return{data:l,isFetching:o,isInitialLoading:t.isInitialLoading,error:t.error}},an=null,St=async()=>(0,x.Ay)("DELETE",(0,L.H3)("/migration/state")),Ot=()=>{const t=(0,R.useQueryClient)(),[a,l]=(0,e.useState)(!1),{mutateAsync:o}=(0,R.useMutation)(St,{onSuccess:()=>{_.A.success("Migration state reset successful."),t.invalidateQueries(xe),t.invalidateQueries(w.A)},onError:g=>{_.A.error(`Resetting migration state failed with status: ${g}`,"Could not reset the migration state.")}});return e.createElement(e.Fragment,null,e.createElement(n.Button,{bsStyle:"primary",bsSize:"small",onClick:()=>l(!0)},"Reset Migration"),a&&e.createElement(d.TM,{title:"Reset Migration",show:!0,onConfirm:async()=>{await o(),l(!1)},onCancel:()=>l(!1)},"Are you sure you want to reset the migration?"))},Rt=()=>{const{step:t,isLoading:a}=Le(),{onTriggerNextState:l}=Ne();return(0,e.useEffect)(()=>{!a&&t.state===s.NEW.key&&l({step:t.next_steps[0],args:{}})},[t.next_steps,t.state,a,l]),e.createElement(d.Qc,{title:"Data Nodes Migration"},e.createElement(f.A,null),e.createElement(d.zY,{title:"Data Nodes Migration",actions:e.createElement(Ot,null),documentationLink:{title:"Data Nodes documentation",path:p.A.PAGES.GRAYLOG_DATA_NODE}},e.createElement("span",null,"Graylog Data Nodes offer a better integration with Graylog and simplify future updates. They allow you to index and search through all the messages in your Graylog message database.")),e.createElement(n.Row,{className:"content"},e.createElement(n.Col,{md:12},e.createElement(Nt,null))))}},vRzdUUFc:(ae,U,r)=>{r.d(U,{Ex:()=>p,mR:()=>z,$x:()=>V,hE:()=>J});var e=r("Z7aTuO5B"),n=r("L3UIULT/");const p=({children:c,...A})=>e.createElement(n.Badge,{...A},c);var f=r("J6y4/h8P");const u=(0,f.default)(n.Button)(({theme:c})=>(0,f.css)`
${c.components.button}
`),M=(0,e.forwardRef)(({children:c,...A},G)=>e.createElement(u,{...A,ref:G},c));M.defaultProps={type:"button"};const R=null,L=({children:c,...A})=>e.createElement(n.Grid.Col,{...A,style:{...A.style}},c);var _=r("HFJv8079");const b=({children:c,...A})=>e.createElement(_.mR,{...A},c);b.Accept=_.mR.Accept,b.Reject=_.mR.Reject,b.Reject=_.mR.Reject,b.Idle=_.mR.Idle;const z=b;var K=r("UiXZqrDE");const w=c=>e.createElement(n.TextInput,{...c}),m=({name:c,placeholder:A,label:G,type:B,required:Z})=>e.createElement(K.Field,{name:c},({field:{value:T,onChange:Y,onBlur:ee},meta:{error:W}})=>e.createElement(w,{onBlur:ee,required:Z,id:c,label:G,type:B,placeholder:A,value:T,error:W,onChange:Y}));m.defaultProps={placeholder:void 0,type:void 0,required:!1};const N=null,I=({children:c,...A})=>e.createElement(n.Grid,{...A},c);I.Col=n.Grid.Col;const y=null,k=c=>e.createElement(n.Input,{...c});k.Error=n.Input.Error,k.Label=n.Input.Label;const Ee=null,q=(0,f.default)(n.List)(({theme:c})=>(0,f.css)`
color: ${c.colors.global.textDefault};
`),Q=({children:c,...A})=>e.createElement(q,{...A},c);Q.Item=n.List.Item;const Ae=null,me=({children:c,...A})=>e.createElement(n.Grid,{...A},c),ge=(0,f.default)(n.Box)`
display: flex;
justify-content: flex-end;
gap: 5px;
`,re=(0,f.default)(n.Box)(({theme:c})=>(0,f.css)`
padding: ${c.spacings.md};
margin-bottom: ${c.spacings.xs};
`),le=(0,f.default)(re)(({theme:c})=>(0,f.css)`
background-color: ${c.colors.global.contentBackground};
border: 1px solid ${c.colors.variant.lighter.default};
border-radius: 4px;
`),X=({title:c,actions:A,titleOrder:G})=>e.createElement(me,null,e.createElement(L,{span:{base:12,lg:6,md:6}},e.createElement(J,{order:G},c)),e.createElement(L,{span:{base:12,lg:6,md:6}},e.createElement(ge,null,A)));X.defaultProps={actions:void 0,titleOrder:2};const ie=({title:c,children:A,actions:G,titleOrder:B})=>e.createElement(re,{component:"section"},e.createElement(X,{title:c,actions:G,titleOrder:B}),A);ie.defaultProps={actions:void 0,titleOrder:void 0};const se=({title:c,children:A,actions:G,titleOrder:B,dataTestid:Z})=>e.createElement(le,{component:"section","data-testid":Z},e.createElement(X,{title:c,actions:G,titleOrder:B}),A);se.defaultProps={actions:void 0,titleOrder:void 0};const fe=null,D=({children:c,...A})=>{const G=useTheme(),B=()=>({input:{color:G.colors.input.color,backgroundColor:G.colors.input.background,borderColor:G.colors.input.border},dropdown:{color:G.colors.input.color,backgroundColor:G.colors.input.background}});return React.createElement(MantineSelect,{...A,styles:B},c)},ce=null,V=c=>e.createElement(n.Space,{...c}),j=({children:c,...A})=>e.createElement(n.Tabs,{...A},c);j.List=n.Tabs.List,j.Tab=n.Tabs.Tab,j.Panel=n.Tabs.Panel;const s=null,J=({children:c,...A})=>e.createElement(n.Title,{...A},c)}}]);})();
//# sourceMappingURL=bb8c8232-4752.77d643179b480a221a32.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy