2 lines
6.9 KiB
JavaScript
2 lines
6.9 KiB
JavaScript
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[9714],{79714:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var n=a(65043),l=a(89923),s=a(94141),i=a(96512),r=a(77403),c=a(64159),o=a(21383),d=a(56629),u=a(53518),p=a(70579);const h=e=>{let{closeModalAndRefresh:t,open:a,bucketName:h,ruleID:g}=e;const x=(0,o.jL)(),[m,f]=(0,n.useState)(!0),[j,S]=(0,n.useState)(!1),[b,v]=(0,n.useState)("1"),[y,k]=(0,n.useState)(""),[C,E]=(0,n.useState)(""),[D,I]=(0,n.useState)(!1),[w,R]=(0,n.useState)(!1),[A,_]=(0,n.useState)(""),[B,M]=(0,n.useState)(""),[O,N]=(0,n.useState)(""),[P,L]=(0,n.useState)(!1),[T,G]=(0,n.useState)(!1),[q,F]=(0,n.useState)(!1);return(0,n.useEffect)((()=>{m&&d.F.buckets.getBucketReplicationRule(h,g).then((e=>{var t;v(e.data.priority?e.data.priority.toString():"");const a=e.data.prefix||"",n=e.data.tags||"";E(a),_(n),M(n),k((null===(t=e.data.destination)||void 0===t?void 0:t.bucket)||""),I(e.data.delete_marker_replication||!1),N(e.data.storageClass||""),L(!!e.data.existingObjects),G(!!e.data.deletes_replication),F("Enabled"===e.data.status),R(!!e.data.metadata_replication),f(!1)})).catch((e=>{x((0,c.Dy)((0,u.S)(e.error))),f(!1)}))}),[m,x,h,g]),(0,n.useEffect)((()=>{if(j){const e={arn:y,ruleState:q,prefix:C,tags:B,replicateDeleteMarkers:D,replicateDeletes:T,replicateExistingObjects:P,replicateMetadata:w,priority:parseInt(b),storageClass:O};d.F.buckets.updateMultiBucketReplication(h,g,e).then((()=>{S(!1),t(!0)})).catch((e=>{x((0,c.Dy)((0,u.S)(e.error))),S(!1)}))}}),[j,h,g,y,C,B,D,b,T,P,q,w,O,t,x]),(0,p.jsx)(s.A,{modalOpen:a,onClose:()=>{t(!1)},title:"Edit Bucket Replication",titleIcon:(0,p.jsx)(l.WBh,{}),children:(0,p.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:e=>{e.preventDefault(),S(!0)},children:(0,p.jsxs)(l.Hbc,{containerPadding:!1,withBorders:!1,children:[(0,p.jsx)(l.dOG,{checked:q,id:"ruleState",name:"ruleState",label:"Rule State",onChange:e=>{F(e.target.checked)}}),(0,p.jsx)(l.EmB,{label:"Destination",sx:{width:"100%"},children:y}),(0,p.jsx)(l.cl_,{id:"priority",name:"priority",onChange:e=>{e.target.validity.valid&&v(e.target.value)},label:"Priority",value:b,pattern:"[0-9]*"}),(0,p.jsx)(l.cl_,{id:"storageClass",name:"storageClass",onChange:e=>{N(e.target.value)},placeholder:"STANDARD_IA,REDUCED_REDUNDANCY etc",label:"Storage Class",value:O}),(0,p.jsxs)("fieldset",{className:"inputItem",children:[(0,p.jsx)("legend",{children:"Object Filters"}),(0,p.jsx)(l.cl_,{id:"prefix",name:"prefix",onChange:e=>{E(e.target.value)},placeholder:"prefix",label:"Prefix",value:C}),(0,p.jsx)(i.A,{name:"tags",label:"Tags",elements:A,onChange:e=>{M(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})]}),(0,p.jsxs)("fieldset",{className:"inputItem",children:[(0,p.jsx)("legend",{children:"Replication Options"}),(0,p.jsx)(l.dOG,{checked:P,id:"repExisting",name:"repExisting",label:"Existing Objects",onChange:e=>{L(e.target.checked)},description:"Replicate existing objects"}),(0,p.jsx)(l.dOG,{checked:w,id:"metadatataSync",name:"metadatataSync",label:"Metadata Sync",onChange:e=>{R(e.target.checked)},description:"Metadata Sync"}),(0,p.jsx)(l.dOG,{checked:D,id:"deleteMarker",name:"deleteMarker",label:"Delete Marker",onChange:e=>{I(e.target.checked)},description:"Replicate soft deletes"}),(0,p.jsx)(l.dOG,{checked:T,id:"repDelete",name:"repDelete",label:"Deletes",onChange:e=>{G(e.target.checked)},description:"Replicate versioned deletes"})]}),(0,p.jsxs)(l.xA9,{item:!0,xs:12,sx:r.Uz.modalButtonBar,children:[(0,p.jsx)(l.$nd,{id:"cancel-edit-replication",type:"button",variant:"regular",disabled:m||j,onClick:()=>{t(!1)},label:"Cancel"}),(0,p.jsx)(l.$nd,{id:"save-replication",type:"submit",variant:"callAction",disabled:m||j,label:"Save"})]})]})})})}},96512:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(33097),s=a.n(l),i=a(93950),r=a.n(i),c=a(89923),o=a(70579);const d=e=>{let{elements:t,name:a,label:l,tooltip:i="",keyPlaceholder:d="",valuePlaceholder:u="",onChange:p,withBorder:h=!1}=e;const[g,x]=(0,n.useState)([""]),[m,f]=(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),f(n)}}),[g,m,t]),(0,n.useEffect)((()=>{const e=j.current;e&&g.length>1&&e.scrollIntoView(!1)}),[g]);const S=(0,n.useRef)(!0);(0,n.useLayoutEffect)((()=>{S.current?S.current=!1:y()}),[g,m]);const b=e=>{e.persist();let t=[...g];const a=s()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,x(t)},v=e=>{e.persist();let t=[...m];const a=s()(e.target,"dataset.index","0");t[parseInt(a)]=e.target.value,f(t)},y=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)}})),p(e)}),500),k=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:b,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:v,index:t,placeholder:u,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),f(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,""!==i&&(0,o.jsx)(c.azJ,{sx:{marginLeft:5,display:"flex",alignItems:"center","& .min-icon":{width:13}},children:(0,o.jsx)(c.m_M,{tooltip:i,placement:"top",children:(0,o.jsx)(c.NTw,{style:{width:13,height:13}})})})]}),(0,o.jsxs)(c.azJ,{withBorders:h,sx:{padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},children:[k,(0,o.jsx)("div",{ref:j})]})]})})}},94141:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(65043),l=a(22166),s=a(89923),i=a(21383),r=a(64159),c=a(49555),o=a(70579);const d=e=>{let{onClose:t,modalOpen:a,title:d,children:u,wideLimit:p=!0,titleIcon:h=null,iconColor:g="default",sx:x}=e;const m=(0,i.jL)(),[f,j]=(0,n.useState)(!1),S=(0,l.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{m((0,r.h0)(""))}),[m]),(0,n.useEffect)((()=>{if(S){if(""===S.message)return void j(!1);"error"!==S.type&&j(!0)}}),[S]);let b="";return S&&(b=S.detailedErrorMsg,(""===b||b&&b.length<5)&&(b=S.message)),(0,o.jsxs)(s.ngX,{onClose:t,open:a,title:d,titleIcon:h,widthLimit:p,sx:x,iconColor:g,children:[(0,o.jsx)(c.A,{isModal:!0}),(0,o.jsx)(s.qb_,{onClose:()=>{j(!1),m((0,r.h0)(""))},open:f,message:b,mode:"inline",variant:"error"===S.type?"error":"default",autoHideDuration:"error"===S.type?10:5,condensed:!0}),u]})}}}]);
|
|
//# sourceMappingURL=9714.c65a6c13.chunk.js.map
|