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

     1  "use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[459],{10459:(e,t,a)=>{a.r(t),a.d(t,{default:()=>v});var n=a(65043),l=a(33097),r=a.n(l),s=a(89923),i=a(56629),c=a(53518),o=a(77403),d=a(56483),u=a(64159),h=a(20554),g=a(94141),p=a(96512),x=a(23758),m=a(70579);const v=e=>{let{open:t,closeModalAndRefresh:a,bucketName:l,setReplicationRules:v}=e;const y=(0,h.jL)(),[b,S]=(0,n.useState)(!1),[j,C]=(0,n.useState)("1"),[f,k]=(0,n.useState)(""),[R,_]=(0,n.useState)(""),[A,B]=(0,n.useState)(""),[D,w]=(0,n.useState)(""),[I,E]=(0,n.useState)(""),[M,T]=(0,n.useState)(""),[L,N]=(0,n.useState)(""),[K,O]=(0,n.useState)(!0),[U,P]=(0,n.useState)(!0),[F,q]=(0,n.useState)(!0),[z,G]=(0,n.useState)(!0),[V,J]=(0,n.useState)(""),[Y,H]=(0,n.useState)("async"),[W,$]=(0,n.useState)("100"),[Q,X]=(0,n.useState)("Gi"),[Z,ee]=(0,n.useState)("60");(0,n.useEffect)((()=>{if(0===v.length)return void C("1");const e=v.reduce(((e,t)=>t.priority>e?t.priority:e),0);C((e+1).toString())}),[v]);return(0,m.jsx)(g.A,{modalOpen:t,onClose:()=>{a()},title:"Set Bucket Replication",titleIcon:(0,m.jsx)(s.WBh,{}),children:(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),S(!0),(()=>{const e=[{originBucket:l,destinationBucket:M}],t=parseInt(Z),n="".concat(K?"https://":"http://").concat(A),s={accessKey:f,secretKey:R,targetURL:n,region:L,bucketsRelation:e,syncMode:Y,bandwidth:"async"===Y?parseInt((0,d.q5)(W,Q,!0)):0,healthCheckPeriod:t,prefix:I,tags:V,replicateDeleteMarkers:U,replicateDeletes:F,priority:parseInt(j),storageClass:D,replicateMetadata:z};i.F.bucketsReplication.setMultiBucketReplication(s).then((e=>{S(!1);const t=r()(e.data,"replicationState",[]);if(t.length>0){const e=t[0];return S(!1),e.errorString&&""!==e.errorString?void y((0,u.Dy)({errorMessage:e.errorString,detailedError:""})):void a()}y((0,u.Dy)({errorMessage:"No changes applied",detailedError:""}))})).catch((e=>{S(!1),y((0,u.Dy)((0,c.S)(e.error)))}))})()},children:(0,m.jsxs)(s.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,m.jsx)(s.cl_,{id:"priority",name:"priority",onChange:e=>{e.target.validity.valid&&C(e.target.value)},label:"Priority",value:j,pattern:"[0-9]*"}),(0,m.jsx)(s.cl_,{id:"targetURL",name:"targetURL",onChange:e=>{B(e.target.value)},placeholder:"play.min.io",label:"Target URL",value:A}),(0,m.jsx)(s.dOG,{checked:K,id:"useTLS",name:"useTLS",label:"Use TLS",onChange:e=>{O(e.target.checked)},value:"yes"}),(0,m.jsx)(s.cl_,{id:"accessKey",name:"accessKey",onChange:e=>{k(e.target.value)},label:"Access Key",value:f}),(0,m.jsx)(s.cl_,{id:"secretKey",name:"secretKey",onChange:e=>{_(e.target.value)},label:"Secret Key",value:R}),(0,m.jsx)(s.cl_,{id:"targetBucket",name:"targetBucket",onChange:e=>{T(e.target.value)},label:"Target Bucket",value:M}),(0,m.jsx)(s.cl_,{id:"region",name:"region",onChange:e=>{N(e.target.value)},label:"Region",value:L}),(0,m.jsx)(s.l6P,{id:"replication_mode",name:"replication_mode",onChange:e=>{H(e)},label:"Replication Mode",value:Y,options:[{label:"Asynchronous",value:"async"},{label:"Synchronous",value:"sync"}]}),"async"===Y&&(0,m.jsx)(s.azJ,{className:"inputItem",children:(0,m.jsx)(s.cl_,{type:"number",id:"bandwidth_scalar",name:"bandwidth_scalar",onChange:e=>{e.target.validity.valid&&$(e.target.value)},label:"Bandwidth",value:W,min:"0",pattern:"[0-9]*",overlayObject:(0,m.jsx)(x.A,{id:"quota_unit",onUnitChange:e=>{X(e)},unitSelected:Q,unitsList:(0,d.l9)(["Ki"]),disabled:!1})})}),(0,m.jsx)(s.cl_,{id:"healthCheck",name:"healthCheck",onChange:e=>{ee(e.target.value)},label:"Health Check Duration",value:Z}),(0,m.jsx)(s.cl_,{id:"storageClass",name:"storageClass",onChange:e=>{w(e.target.value)},placeholder:"STANDARD_IA,REDUCED_REDUNDANCY etc",label:"Storage Class",value:D}),(0,m.jsxs)("fieldset",{className:"inputItem",children:[(0,m.jsx)("legend",{children:"Object Filters"}),(0,m.jsx)(s.cl_,{id:"prefix",name:"prefix",onChange:e=>{E(e.target.value)},placeholder:"prefix",label:"Prefix",value:I}),(0,m.jsx)(p.A,{name:"tags",label:"Tags",elements:"",onChange:e=>{J(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})]}),(0,m.jsxs)("fieldset",{className:"inputItem",children:[(0,m.jsx)("legend",{children:"Replication Options"}),(0,m.jsx)(s.dOG,{checked:z,id:"metadatataSync",name:"metadatataSync",label:"Metadata Sync",onChange:e=>{G(e.target.checked)},description:"Metadata Sync"}),(0,m.jsx)(s.dOG,{checked:U,id:"deleteMarker",name:"deleteMarker",label:"Delete Marker",onChange:e=>{P(e.target.checked)},description:"Replicate soft deletes"}),(0,m.jsx)(s.dOG,{checked:F,id:"repDelete",name:"repDelete",label:"Deletes",onChange:e=>{q(e.target.checked)},description:"Replicate versioned deletes"})]}),(0,m.jsxs)(s.xA9,{item:!0,xs:12,sx:o.Uz.modalButtonBar,children:[(0,m.jsx)(s.$nd,{id:"cancel",type:"button",variant:"regular",disabled:b,onClick:()=>{a()},label:"Cancel"}),(0,m.jsx)(s.$nd,{id:"submit",type:"submit",variant:"callAction",color:"primary",disabled:b,label:"Save"})]})]})})})}},23758:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(89923),r=a(94574),s=a(33097),i=a.n(s),c=a(70579);const o=r.Ay.button((e=>{let{theme:t}=e;return{border:"1px solid ".concat(i()(t,"borderColor","#E2E2E2")),borderRadius:3,color:i()(t,"secondaryText","#5B5C5C"),backgroundColor:i()(t,"boxBackground","#FBFAFA"),fontSize:12}})),d=e=>{let{id:t,unitSelected:a,unitsList:r,disabled:s=!1,onUnitChange:i}=e;const[d,u]=n.useState(null),h=Boolean(d),g=e=>{u(null),""!==e&&i&&i(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":h?"true":void 0,onClick:e=>{u(e.currentTarget)},disabled:s,type:"button",children:a}),(0,c.jsx)(l.Vey,{id:"upload-main-menu",options:r,selectedOption:"",onSelect:e=>g(e),hideTriggerAction:()=>{g("")},open:h,anchorEl:d,anchorOrigin:"end"})]})}},96512:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(33097),r=a.n(l),s=a(93950),i=a.n(s),c=a(89923),o=a(70579);const d=e=>{let{elements:t,name:a,label:l,tooltip:s="",keyPlaceholder:d="",valuePlaceholder:u="",onChange:h,withBorder:g=!1}=e;const[p,x]=(0,n.useState)([""]),[m,v]=(0,n.useState)([""]),y=(0,n.createRef)();(0,n.useEffect)((()=>{if(1===p.length&&""===p[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),v(n)}}),[p,m,t]),(0,n.useEffect)((()=>{const e=y.current;e&&p.length>1&&e.scrollIntoView(!1)}),[p]);const b=(0,n.useRef)(!0);(0,n.useLayoutEffect)((()=>{b.current?b.current=!1:C()}),[p,m]);const S=e=>{e.persist();let t=[...p];const a=r()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,x(t)},j=e=>{e.persist();let t=[...m];const a=r()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,v(t)},C=i()((()=>{let e="";p.forEach(((t,a)=>{if(p[a]&&m[a]){let n="".concat(t,"=").concat(m[a]);0!==a&&(n="&".concat(n)),e="".concat(e).concat(n)}})),h(e)}),500),f=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:p[t],onChange:S,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:j,index:t,placeholder:u,overlayIcon:t===m.length-1?(0,o.jsx)(c.REV,{}):null,overlayAction:()=>{(()=>{if(""!==p[p.length-1].trim()&&""!==m[m.length-1].trim()){const e=[...p],t=[...m];e.push(""),t.push(""),x(e),v(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:g,sx:{padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},children:[f,(0,o.jsx)("div",{ref:y})]})]})})}}}]);
     2  //# sourceMappingURL=459.65dbecac.chunk.js.map