"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[5759],{85759:function(e,t,n){n.r(t);var i=n(93433),l=n(29439),r=n(72791),s=n(78687),c=n(57689),o=n(29945),a=n(81207),u=n(38442),d=n(56087),p=n(87995),h=n(9859),f=n(81551),x=n(27454),m=n(75578),b=n(80184),j=(0,m.Z)(r.lazy((function(){return n.e(3509).then(n.bind(n,83509))}))),S=(0,m.Z)(r.lazy((function(){return Promise.all([n.e(5473),n.e(1715),n.e(889)]).then(n.bind(n,20889))}))),R=(0,m.Z)(r.lazy((function(){return n.e(9088).then(n.bind(n,69088))})));t.default=function(){var e=(0,f.TL)(),t=(0,c.UO)(),n=(0,s.v9)(h.HQ),m=(0,r.useState)(!0),T=(0,l.Z)(m,2),_=T[0],I=T[1],N=(0,r.useState)([]),A=(0,l.Z)(N,2),F=A[0],g=A[1],k=(0,r.useState)(!1),O=(0,l.Z)(k,2),C=O[0],y=O[1],P=(0,r.useState)(!1),Z=(0,l.Z)(P,2),v=Z[0],E=Z[1],U=(0,r.useState)(!1),w=(0,l.Z)(U,2),G=w[0],L=w[1],K=(0,r.useState)(""),z=(0,l.Z)(K,2),D=z[0],M=z[1],B=(0,r.useState)([]),H=(0,l.Z)(B,2),Q=H[0],X=H[1],Y=(0,r.useState)(!1),J=(0,l.Z)(Y,2),q=J[0],V=J[1],W=t.bucketName||"",$=(0,u.F)(W,[d.Ft.S3_GET_REPLICATION_CONFIGURATION,d.Ft.S3_GET_ACTIONS]);(0,r.useEffect)((function(){e((0,p.Sc)("bucket_detail_replication"))}),[]),(0,r.useEffect)((function(){n&&I(!0)}),[n,I]),(0,r.useEffect)((function(){_&&($?a.Z.invoke("GET","/api/v1/buckets/".concat(W,"/replication")).then((function(e){var t=e.rules?e.rules:[];t.sort((function(e,t){return e.priority-t.priority})),g(t),I(!1)})).catch((function(t){e((0,p.Ih)(t)),I(!1)})):I(!1))}),[_,e,W,$]);var ee=function(){E(arguments.length>0&&void 0!==arguments[0]&&arguments[0])},te=[{type:"delete",onClick:function(e){M(e.id),V(!1),y(!0)}},{type:"view",onClick:function(e){M(e.id),L(!0)},disableButtonFunction:!(0,u.F)(W,[d.Ft.S3_PUT_REPLICATION_CONFIGURATION,d.Ft.S3_PUT_ACTIONS],!0)}];return(0,b.jsxs)(r.Fragment,{children:[v&&(0,b.jsx)(S,{closeModalAndRefresh:function(){ee(!1),I(!0)},open:v,bucketName:W,setReplicationRules:F}),C&&(0,b.jsx)(R,{deleteOpen:C,selectedBucket:W,closeDeleteModalAndRefresh:function(e){y(!1),e&&I(!0)},ruleToDelete:D,rulesToDelete:Q,remainingRules:F.length,allSelected:F.length>0&&Q.length===F.length,deleteSelectedRules:q}),G&&(0,b.jsx)(j,{closeModalAndRefresh:function(e){L(!1),e&&I(!0)},open:G,bucketName:W,ruleID:D}),(0,b.jsx)(o.NZf,{separator:!0,sx:{marginBottom:15},actions:(0,b.jsxs)(o.xuv,{style:{display:"flex",gap:10},children:[(0,b.jsx)(u.s,{scopes:[d.Ft.S3_PUT_REPLICATION_CONFIGURATION,d.Ft.S3_PUT_ACTIONS],resource:W,matchAll:!0,errorProps:{disabled:!0},children:(0,b.jsx)(x.Z,{tooltip:"Remove Selected Replication Rules",children:(0,b.jsx)(o.zxk,{id:"remove-bucket-replication-rule",onClick:function(){M("selectedRules"),V(!0),y(!0)},label:"Remove Selected Rules",icon:(0,b.jsx)(o.XHJ,{}),color:"secondary",disabled:0===Q.length||0===F.length,variant:"secondary"})})}),(0,b.jsx)(u.s,{scopes:[d.Ft.S3_PUT_REPLICATION_CONFIGURATION,d.Ft.S3_PUT_ACTIONS],resource:W,matchAll:!0,errorProps:{disabled:!0},children:(0,b.jsx)(x.Z,{tooltip:"Add Replication Rule",children:(0,b.jsx)(o.zxk,{id:"add-bucket-replication-rule",onClick:function(){ee(!0)},label:"Add Replication Rule",icon:(0,b.jsx)(o.dtP,{}),variant:"callAction"})})})]}),children:"Replication"}),(0,b.jsxs)(o.rjZ,{container:!0,children:[(0,b.jsx)(o.rjZ,{item:!0,xs:12,children:(0,b.jsx)(u.s,{scopes:[d.Ft.S3_GET_REPLICATION_CONFIGURATION,d.Ft.S3_GET_ACTIONS],resource:W,errorProps:{disabled:!0},children:(0,b.jsx)(o.wQF,{itemActions:te,columns:[{label:"Priority",elementKey:"priority",width:55,contentTextAlign:"center"},{label:"Destination",elementKey:"destination",renderFunction:function(e){return(0,b.jsx)(r.Fragment,{children:e.bucket.replace("arn:aws:s3:::","")})}},{label:"Prefix",elementKey:"prefix",width:200},{label:"Tags",elementKey:"tags",renderFunction:function(e){return(0,b.jsx)(r.Fragment,{children:e&&""!==e.tags?"Yes":"No"})},width:60},{label:"Status",elementKey:"status",width:100}],isLoading:_,records:F,entityName:"Replication Rules",idField:"id",customPaperHeight:"400px",textSelectable:!0,selectedItems:Q,onSelect:function(e){return function(e){var t=e.target,n=t.value,l=t.checked,r=(0,i.Z)(Q);return l?r.push(n):r=r.filter((function(e){return e!==n})),X(r),r}(e)},onSelectAll:function(){Q.length!==F.length?X(F.map((function(e){return e.id}))):X([])}})})}),(0,b.jsxs)(o.rjZ,{item:!0,xs:12,children:[(0,b.jsx)("br",{}),(0,b.jsx)(o.KfX,{title:"Replication",iconComponent:(0,b.jsx)(o.wNb,{}),help:(0,b.jsxs)(r.Fragment,{children:["MinIO supports server-side and client-side replication of objects between source and destination buckets.",(0,b.jsx)("br",{}),(0,b.jsx)("br",{}),"You can learn more at our"," ",(0,b.jsx)("a",{href:"https://min.io/docs/minio/linux/administration/bucket-replication.html?ref=con",target:"_blank",rel:"noopener",children:"documentation"}),"."]})})]})]})]})}}}]);
//# sourceMappingURL=5759.47541c57.chunk.js.map