"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[7904],{87904:(e,t,i)=>{i.r(t),i.d(t,{default:()=>k});var n=i(69060),l=i(19536),s=i(51560),c=i(66152),a=i(50900),r=i(3992),o=i(21124),d=i(95705),u=i(2432),h=i(66156),p=i(84612),b=i(99748),m=i(82496);const x=(0,b.c)(n.lazy((()=>i.e(92).then(i.bind(i,40092))))),O=(0,b.c)(n.lazy((()=>i.e(5508).then(i.bind(i,35508))))),j=(0,b.c)(n.lazy((()=>i.e(4084).then(i.bind(i,94084))))),k=()=>{const e=(0,h.Ab)(),t=(0,s.W4)(),i=(0,l.w1)(u.qO),[b,k]=(0,n.useState)(!0),[S,g]=(0,n.useState)([]),[R,I]=(0,n.useState)(!1),[T,_]=(0,n.useState)(!1),[N,A]=(0,n.useState)(!1),[y,C]=(0,n.useState)(""),[f,P]=(0,n.useState)([]),[v,E]=(0,n.useState)(!1),F=t.bucketName||"",w=(0,r.i)(F,[o.Oi.S3_GET_REPLICATION_CONFIGURATION,o.Oi.S3_GET_ACTIONS]);(0,n.useEffect)((()=>{e((0,d.i8)("bucket_detail_replication"))}),[]),(0,n.useEffect)((()=>{i&&k(!0)}),[i,k]),(0,n.useEffect)((()=>{b&&(w?a.c.invoke("GET","/api/v1/buckets/".concat(F,"/replication")).then((e=>{const t=e.rules?e.rules:[];t.sort(((e,t)=>e.priority-t.priority)),g(t),k(!1)})).catch((t=>{e((0,d.aW)(t)),k(!1)})):k(!1))}),[b,e,F,w]);const G=function(){_(arguments.length>0&&void 0!==arguments[0]&&arguments[0])},U=(0,s.i6)(),K=[{type:"delete",onClick:e=>{C(e.id),E(!1),I(!0)}},{type:"view",onClick:e=>{C(e.id),U("/buckets/edit-replication?bucketName=".concat(F,"&ruleID=").concat(e.id))},disableButtonFunction:!(0,r.i)(F,[o.Oi.S3_PUT_REPLICATION_CONFIGURATION,o.Oi.S3_PUT_ACTIONS],!0)}];return(0,m.jsxs)(n.Fragment,{children:[T&&(0,m.jsx)(O,{closeModalAndRefresh:()=>{G(!1),k(!0)},open:T,bucketName:F,setReplicationRules:S}),R&&(0,m.jsx)(j,{deleteOpen:R,selectedBucket:F,closeDeleteModalAndRefresh:e=>{I(!1),e&&k(!0)},ruleToDelete:y,rulesToDelete:f,remainingRules:S.length,allSelected:S.length>0&&f.length===S.length,deleteSelectedRules:v}),N&&(0,m.jsx)(x,{closeModalAndRefresh:e=>{A(!1),e&&k(!0)},open:N,bucketName:F,ruleID:y}),(0,m.jsx)(c.eCc,{separator:!0,sx:{marginBottom:15},actions:(0,m.jsxs)(c.kvh,{style:{display:"flex",gap:10},children:[(0,m.jsx)(r.K,{scopes:[o.Oi.S3_PUT_REPLICATION_CONFIGURATION,o.Oi.S3_PUT_ACTIONS],resource:F,matchAll:!0,errorProps:{disabled:!0},children:(0,m.jsx)(p.c,{tooltip:"Remove Selected Replication Rules",children:(0,m.jsx)(c.qaq,{id:"remove-bucket-replication-rule",onClick:()=>{C("selectedRules"),E(!0),I(!0)},label:"Remove Selected Rules",icon:(0,m.jsx)(c.g8$,{}),color:"secondary",disabled:0===f.length||0===S.length,variant:"secondary"})})}),(0,m.jsx)(r.K,{scopes:[o.Oi.S3_PUT_REPLICATION_CONFIGURATION,o.Oi.S3_PUT_ACTIONS],resource:F,matchAll:!0,errorProps:{disabled:!0},children:(0,m.jsx)(p.c,{tooltip:"Add Replication Rule",children:(0,m.jsx)(c.qaq,{id:"add-bucket-replication-rule",onClick:()=>{G(!0)},label:"Add Replication Rule",icon:(0,m.jsx)(c.EgV,{}),variant:"callAction"})})})]}),children:(0,m.jsx)(c.M5Y,{content:(0,m.jsxs)(n.Fragment,{children:["MinIO"," ",(0,m.jsx)("a",{target:"blank",href:"https://min.io/docs/minio/kubernetes/upstream/administration/bucket-replication.html",children:"server-side bucket replication"})," ","is an automatic bucket-level configuration that synchronizes objects between a source and destination bucket."]}),placement:"right",children:"Replication"})}),(0,m.jsxs)(c.yeN,{container:!0,children:[(0,m.jsx)(c.yeN,{item:!0,xs:12,children:(0,m.jsx)(r.K,{scopes:[o.Oi.S3_GET_REPLICATION_CONFIGURATION,o.Oi.S3_GET_ACTIONS],resource:F,errorProps:{disabled:!0},children:(0,m.jsx)(c.iSL,{itemActions:K,columns:[{label:"Priority",elementKey:"priority",width:55,contentTextAlign:"center"},{label:"Destination",elementKey:"destination",renderFunction:e=>(0,m.jsx)(n.Fragment,{children:e.bucket.replace("arn:aws:s3:::","")})},{label:"Prefix",elementKey:"prefix",width:200},{label:"Tags",elementKey:"tags",renderFunction:e=>(0,m.jsx)(n.Fragment,{children:e&&""!==e.tags?"Yes":"No"}),width:60},{label:"Status",elementKey:"status",width:100}],isLoading:b,records:S,entityName:"Replication Rules",idField:"id",customPaperHeight:"400px",textSelectable:!0,selectedItems:f,onSelect:e=>(e=>{const t=e.target,i=t.value,n=t.checked;let l=[...f];return n?l.push(i):l=l.filter((e=>e!==i)),P(l),l})(e),onSelectAll:()=>{f.length!==S.length?P(S.map((e=>e.id))):P([])}})})}),(0,m.jsxs)(c.yeN,{item:!0,xs:12,children:[(0,m.jsx)("br",{}),(0,m.jsx)(c.g1k,{title:"Replication",iconComponent:(0,m.jsx)(c.Gme,{}),help:(0,m.jsxs)(n.Fragment,{children:["MinIO supports server-side and client-side replication of objects between source and destination buckets.",(0,m.jsx)("br",{}),(0,m.jsx)("br",{}),"You can learn more at our"," ",(0,m.jsx)("a",{href:"https://min.io/docs/minio/linux/administration/bucket-replication.html?ref=con",target:"_blank",rel:"noopener",children:"documentation"}),"."]})})]})]})]})}}}]);
//# sourceMappingURL=7904.05fd1ade.chunk.js.map