github.com/minio/console@v1.4.1/web-app/build/static/js/7880.813513ce.chunk.js (about)

     1  "use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7880],{7880:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var n=a(65043),l=a(73216),i=a(89923),s=a(99161),r=a(64159),c=a(20554),o=a(48793),d=a(55968),h=a(56629),u=a(53518),p=a(96512),g=a(56483),x=a(33097),m=a.n(x),b=a(23758),j=a(70579);const y=()=>{const e=(0,c.jL)(),t=(0,l.Zp)();let a=new URLSearchParams(document.location.search);const x=a.get("bucketName")||"",y=a.get("nextPriority")||"1",[v,f]=(0,n.useState)(!1),[S,C]=(0,n.useState)(y),[k,w]=(0,n.useState)(""),[R,E]=(0,n.useState)(""),[A,B]=(0,n.useState)(""),[T,_]=(0,n.useState)(""),[I,D]=(0,n.useState)(""),[M,O]=(0,n.useState)(""),[L,N]=(0,n.useState)(""),[z,K]=(0,n.useState)(!0),[P,U]=(0,n.useState)(!0),[F,G]=(0,n.useState)(!0),[J,V]=(0,n.useState)(!0),[q,W]=(0,n.useState)(!0),[Y,H]=(0,n.useState)(""),[Z,$]=(0,n.useState)("async"),[Q,X]=(0,n.useState)("100"),[ee,te]=(0,n.useState)("Gi"),[ae,ne]=(0,n.useState)("60"),[le,ie]=(0,n.useState)(!1),se=s.zZ.BUCKETS+"/".concat(x,"/admin/replication");(0,n.useEffect)((()=>{e((0,r.ph)("bucket-replication-add"))}),[]);return(0,n.useEffect)((()=>{!le&&k.length>=3&&R.length>=8&&M.length>=3&&A.length>0&&ie(!0)}),[A,k,R,M,le]),(0,n.useEffect)((()=>{le&&(k.length<3||R.length<8||M.length<3||A.length<1)&&ie(!1)}),[A,k,R,M,le]),(0,j.jsxs)(n.Fragment,{children:[(0,j.jsx)(o.A,{label:(0,j.jsx)(i.EGL,{label:"Add Bucket Replication Rule - "+x,onClick:()=>t(se)}),actions:(0,j.jsx)(d.A,{})}),(0,j.jsx)(i.Mxu,{children:(0,j.jsx)(i.Hbc,{title:"Add Replication Rule",icon:(0,j.jsx)(i.WBh,{}),helpBox:(0,j.jsx)(i.lVp,{iconComponent:(0,j.jsx)(i.WBh,{}),title:"Bucket Replication Configuration",help:(0,j.jsxs)(n.Fragment,{children:[(0,j.jsx)(i.azJ,{sx:{paddconngTop:"10px"},children:"The bucket selected in this deployment acts as the \u201csource\u201d while the configured remote deployment acts as the \u201ctarget\u201d."}),(0,j.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:'For each write operation to this "source" bucket, MinIO checks all configured replication rules and applies the matching rule with highest configured priority.'}),(0,j.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:"MinIO supports automatically replicating existing objects in a bucket; this setting is enabled by default. Please note that objects created before replication was configured or while replication is disabled are not synchronized to the target deployment in case this setting is not enabled."}),(0,j.jsx)(i.azJ,{sx:{paddingTop:"10px"},children:"MinIO supports replicating delete operations, where MinIO synchronizes deleting specific object versions and new delete markers. Delete operation replication uses the same replication process as all other replication operations."})," "]})}),children:(0,j.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:a=>{a.preventDefault(),f(!0),(()=>{const a=[{originBucket:x,destinationBucket:M}],n=parseInt(ae),l="".concat(z?"https://":"http://").concat(A),i={accessKey:k,secretKey:R,targetURL:l,region:L,bucketsRelation:a,syncMode:Z,bandwidth:"async"===Z?parseInt((0,g.q5)(Q,ee,!0)):0,healthCheckPeriod:n,prefix:I,tags:Y,replicateDeleteMarkers:P,replicateDeletes:F,replicateExistingObjects:q,priority:parseInt(S),storageClass:T,replicateMetadata:J};h.F.bucketsReplication.setMultiBucketReplication(i).then((a=>{f(!1);const n=m()(a.data,"replicationState",[]);if(n.length>0){const a=n[0];return f(!1),a.errorString&&""!==a.errorString?void e((0,r.C9)({errorMessage:"There was an error",detailedError:a.errorString})):void t(se)}e((0,r.C9)({errorMessage:"No changes applied",detailedError:""}))})).catch((t=>{console.log("this is an error!"),f(!1),e((0,r.C9)((0,u.S)(t.error)))}))})()},children:[(0,j.jsx)(i.cl_,{id:"priority",name:"priority",onChange:e=>{e.target.validity.valid&&C(e.target.value)},label:"Priority",value:S,pattern:"[0-9]*"}),(0,j.jsx)(i.cl_,{id:"targetURL",name:"targetURL",onChange:e=>{B(e.target.value)},placeholder:"play.min.io",label:"Target URL",value:A}),(0,j.jsx)(i.dOG,{checked:z,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:e=>{K(e.target.checked)},value:"yes"}),(0,j.jsx)(i.cl_,{id:"accessKey",name:"accessKey",onChange:e=>{w(e.target.value)},label:"Access Key",value:k}),(0,j.jsx)(i.cl_,{id:"secretKey",name:"secretKey",onChange:e=>{E(e.target.value)},label:"Secret Key",value:R}),(0,j.jsx)(i.cl_,{id:"targetBucket",name:"targetBucket",onChange:e=>{O(e.target.value)},label:"Target Bucket",value:M}),(0,j.jsx)(i.cl_,{id:"region",name:"region",onChange:e=>{N(e.target.value)},label:"Region",value:L}),(0,j.jsx)(i.l6P,{id:"replication_mode",name:"replication_mode",onChange:e=>{$(e)},label:"Replication Mode",value:Z,options:[{label:"Asynchronous",value:"async"},{label:"Synchronous",value:"sync"}]}),"async"===Z&&(0,j.jsx)(i.azJ,{className:"inputItem",children:(0,j.jsx)(i.cl_,{type:"number",id:"bandwidth_scalar",name:"bandwidth_scalar",onChange:e=>{e.target.validity.valid&&X(e.target.value)},label:"Bandwidth",value:Q,min:"0",pattern:"[0-9]*",overlayObject:(0,j.jsx)(b.A,{id:"quota_unit",onUnitChange:e=>{te(e)},unitSelected:ee,unitsList:(0,g.l9)(["Ki"]),disabled:!1})})}),(0,j.jsx)(i.cl_,{id:"healthCheck",name:"healthCheck",onChange:e=>{ne(e.target.value)},label:"Health Check Duration",value:ae}),(0,j.jsx)(i.cl_,{id:"storageClass",name:"storageClass",onChange:e=>{_(e.target.value)},placeholder:"STANDARD_IA,REDUCED_REDUNDANCY etc",label:"Storage Class",value:T}),(0,j.jsxs)("fieldset",{className:"inputItem",children:[(0,j.jsx)("legend",{children:"Object Filters"}),(0,j.jsx)(i.cl_,{id:"prefix",name:"prefix",onChange:e=>{D(e.target.value)},placeholder:"prefix",label:"Prefix",value:I}),(0,j.jsx)(p.A,{name:"tags",label:"Tags",elements:"",onChange:e=>{H(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})]}),(0,j.jsxs)("fieldset",{className:"inputItem",children:[(0,j.jsx)("legend",{children:"Replication Options"}),(0,j.jsx)(i.dOG,{checked:q,id:"repExisting",name:"repExisting",label:"Existing Objects",onChange:e=>{W(e.target.checked)},description:"Replicate existing objects"}),(0,j.jsx)(i.dOG,{checked:J,id:"metadatataSync",name:"metadatataSync",label:"Metadata Sync",onChange:e=>{V(e.target.checked)},description:"Metadata Sync"}),(0,j.jsx)(i.dOG,{checked:P,id:"deleteMarker",name:"deleteMarker",label:"Delete Marker",onChange:e=>{U(e.target.checked)},description:"Replicate soft deletes"}),(0,j.jsx)(i.dOG,{checked:F,id:"repDelete",name:"repDelete",label:"Deletes",onChange:e=>{G(e.target.checked)},description:"Replicate versioned deletes"})]}),(0,j.jsxs)(i.xA9,{item:!0,xs:12,sx:{display:"flex",flexDirection:"row",justifyContent:"end",gap:10,paddingTop:10},children:[(0,j.jsx)(i.$nd,{id:"cancel",type:"button",variant:"regular",disabled:v,onClick:()=>{t(se)},label:"Cancel"}),(0,j.jsx)(i.$nd,{id:"submit",type:"submit",variant:"callAction",color:"primary",disabled:v||!le,label:"Save"})]})]})})})]})}},23758:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(89923),i=a(94574),s=a(33097),r=a.n(s),c=a(70579);const o=i.Ay.button((e=>{let{theme:t}=e;return{border:"1px solid ".concat(r()(t,"borderColor","#E2E2E2")),borderRadius:3,color:r()(t,"secondaryText","#5B5C5C"),backgroundColor:r()(t,"boxBackground","#FBFAFA"),fontSize:12}})),d=e=>{let{id:t,unitSelected:a,unitsList:i,disabled:s=!1,onUnitChange:r}=e;const[d,h]=n.useState(null),u=Boolean(d),p=e=>{h(null),""!==e&&r&&r(e)};return(0,c.jsxs)(n.Fragment,{children:[(0,c.jsx)(o,{id:"".concat(t,"-button"),"aria-controls":"".concat(t,"-menu"),"aria-haspopup":"true","aria-expanded":u?"true":void 0,onClick:e=>{h(e.currentTarget)},disabled:s,type:"button",children:a}),(0,c.jsx)(l.Vey,{id:"upload-main-menu",options:i,selectedOption:"",onSelect:e=>p(e),hideTriggerAction:()=>{p("")},open:u,anchorEl:d,anchorOrigin:"end"})]})}},96512:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(33097),i=a.n(l),s=a(93950),r=a.n(s),c=a(89923),o=a(70579);const d=e=>{let{elements:t,name:a,label:l,tooltip:s="",keyPlaceholder:d="",valuePlaceholder:h="",onChange:u,withBorder:p=!1}=e;const[g,x]=(0,n.useState)([""]),[m,b]=(0,n.useState)([""]),j=(0,n.createRef)();(0,n.useEffect)((()=>{if(1===g.length&&""===g[0]&&1===m.length&&""===m[0]&&t&&""!==t){const e=t.split("&");let a=[],n=[];e.forEach((e=>{const t=e.split("=");2===t.length&&(a.push(t[0]),n.push(t[1]))})),a.push(""),n.push(""),x(a),b(n)}}),[g,m,t]),(0,n.useEffect)((()=>{const e=j.current;e&&g.length>1&&e.scrollIntoView(!1)}),[g]);const y=(0,n.useRef)(!0);(0,n.useLayoutEffect)((()=>{y.current?y.current=!1:S()}),[g,m]);const v=e=>{e.persist();let t=[...g];const a=i()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,x(t)},f=e=>{e.persist();let t=[...m];const a=i()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,b(t)},S=r()((()=>{let e="";g.forEach(((t,a)=>{if(g[a]&&m[a]){let n="".concat(t,"=").concat(m[a]);0!==a&&(n="&".concat(n)),e="".concat(e).concat(n)}})),u(e)}),500),C=m.map(((e,t)=>(0,o.jsxs)(c.xA9,{item:!0,xs:12,className:"lineInputBoxes inputItem",children:[(0,o.jsx)(c.cl_,{id:"".concat(a,"-key-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:g[t],onChange:v,index:t,placeholder:d}),(0,o.jsx)("span",{className:"queryDiv",children:":"}),(0,o.jsx)(c.cl_,{id:"".concat(a,"-value-").concat(t.toString()),label:"",name:"".concat(a,"-").concat(t.toString()),value:m[t],onChange:f,index:t,placeholder:h,overlayIcon:t===m.length-1?(0,o.jsx)(c.REV,{}):null,overlayAction:()=>{(()=>{if(""!==g[g.length-1].trim()&&""!==m[m.length-1].trim()){const e=[...g],t=[...m];e.push(""),t.push(""),x(e),b(t)}})()}})]},"query-pair-".concat(a,"-").concat(t.toString()))));return(0,o.jsx)(n.Fragment,{children:(0,o.jsxs)(c.xA9,{item:!0,xs:12,sx:{"& .lineInputBoxes":{display:"flex"},"& .queryDiv":{alignSelf:"center",margin:"-15px 4px 0",fontWeight:600}},className:"inputItem",children:[(0,o.jsxs)(c.l1Y,{children:[l,""!==s&&(0,o.jsx)(c.azJ,{sx:{marginLeft:5,display:"flex",alignItems:"center","& .min-icon":{width:13}},children:(0,o.jsx)(c.m_M,{tooltip:s,placement:"top",children:(0,o.jsx)(c.NTw,{style:{width:13,height:13}})})})]}),(0,o.jsxs)(c.azJ,{withBorders:p,sx:{padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},children:[C,(0,o.jsx)("div",{ref:j})]})]})})}}}]);
     2  //# sourceMappingURL=7880.813513ce.chunk.js.map