"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[6129],{56129:function(e,n,t){t.r(n);var s=t(77439),o=t(49058),i=t(57223),c=t(537),r=t(11927),a=t(4481),l=t(29240),u=t(64519),f=t(46148),d=t(64964),m=t(39543),b=t(73130),k=t(70466),Z=t(38199),p=t(29322),g=t(32542),_=t(77263),h=t(54864),x=t(18054),C=(0,_.Z)(i.lazy((function(){return Promise.all([t.e(4003),t.e(731),t.e(5201),t.e(4413)]).then(t.bind(t,4413))}))),E=(0,_.Z)(i.lazy((function(){return Promise.all([t.e(5201),t.e(4556)]).then(t.bind(t,94556))}))),S=(0,_.Z)(i.lazy((function(){return Promise.all([t.e(4003),t.e(5201),t.e(2481)]).then(t.bind(t,32481))}))),B=(0,c.$j)((function(e){return{session:e.console.session,loadingBucket:e.buckets.bucketDetails.loadingBucket,bucketInfo:e.buckets.bucketDetails.bucketInfo}}),{setErrorSnackMessage:u.Ih});n.default=(0,a.Z)((function(e){return(0,r.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({"@global":{".rowLine:hover  .iconFileElm":{backgroundImage:"url(/images/ob_file_filled.svg)"},".rowLine:hover  .iconFolderElm":{backgroundImage:"url(/images/ob_folder_filled.svg)"}},listButton:{marginLeft:"10px",align:"right"}},k.VX),k.OR),k.qg),k.cx),(0,k.Bz)(e.spacing(4))))}))(B((function(e){var n=e.classes,t=e.match,o=e.setErrorSnackMessage,c=e.loadingBucket,r=(e.bucketInfo,(0,i.useState)(!0)),a=(0,s.Z)(r,2),u=a[0],k=a[1],_=(0,i.useState)([]),B=(0,s.Z)(_,2),F=B[0],j=B[1],P=(0,i.useState)(!1),T=(0,s.Z)(P,2),v=T[0],I=T[1],L=(0,i.useState)(!1),y=(0,s.Z)(L,2),O=y[0],K=y[1],U=(0,i.useState)(""),Y=(0,s.Z)(U,2),w=Y[0],z=Y[1],N=(0,i.useState)(!1),D=(0,s.Z)(N,2),G=D[0],A=D[1],M=(0,i.useState)(""),R=(0,s.Z)(M,2),q=R[0],V=R[1],X=(0,i.useState)(""),$=(0,s.Z)(X,2),H=$[0],J=$[1],Q=t.params.bucketName,W=(0,g.F)(Q,[Z.Ft.S3_GET_BUCKET_POLICY]),ee=(0,g.F)(Q,[Z.Ft.S3_DELETE_BUCKET_POLICY]),ne=(0,g.F)(Q,[Z.Ft.S3_PUT_BUCKET_POLICY]);(0,i.useEffect)((function(){c&&k(!0)}),[c,k]);var te=[{type:"delete",disableButtonFunction:function(){return!ee},onClick:function(e){K(!0),z(e.prefix)}},{type:"view",disableButtonFunction:function(){return!ne},onClick:function(e){V(e.prefix),J(e.access),A(!0)}}];(0,i.useEffect)((function(){u&&(W?d.Z.invoke("GET","/api/v1/bucket/".concat(Q,"/access-rules")).then((function(e){j(e.accessRules),k(!1)})).catch((function(e){o(e),k(!1)})):k(!1))}),[u,o,W,Q]);return(0,x.jsxs)(i.Fragment,{children:[v&&(0,x.jsx)(C,{modalOpen:v,onClose:function(){I(!1),k(!0)},bucket:Q}),O&&(0,x.jsx)(E,{modalOpen:O,onClose:function(){K(!1),k(!0)},bucket:Q,toDelete:w}),G&&(0,x.jsx)(S,{modalOpen:G,onClose:function(){A(!1),k(!0)},bucket:Q,toEdit:q,initial:H}),(0,x.jsxs)(b.ZP,{item:!0,xs:12,className:n.actionsTray,children:[(0,x.jsx)(p.Z,{children:"\u6743\u9650\u89c4\u5219"}),(0,x.jsx)(g.s,{scopes:[Z.Ft.S3_GET_BUCKET_POLICY,Z.Ft.S3_PUT_BUCKET_POLICY],resource:Q,matchAll:!0,errorProps:{disabled:!0},children:(0,x.jsx)(h.Z,{tooltip:"\u6dfb\u52a0\u6743\u9650\u89c4\u5219",onClick:function(){I(!0)},text:"\u6dfb\u52a0\u6743\u9650\u89c4\u5219",icon:(0,x.jsx)(m.Z,{}),color:"primary",variant:"contained"})})]}),(0,x.jsx)(l.Z,{className:n.tableBlock,children:(0,x.jsx)(g.s,{scopes:[Z.Ft.S3_GET_BUCKET_POLICY],resource:Q,errorProps:{disabled:!0},children:(0,x.jsx)(f.Z,{noBackground:!0,itemActions:te,columns:[{label:"\u524d\u7f00",elementKey:"prefix"},{label:"\u6743\u9650",elementKey:"access"}],isLoading:u,records:F,entityName:"\u6743\u9650\u89c4\u5219",idField:"prefix"})})})]})})))},29322:function(e,n,t){t(57223);var s=t(11927),o=t(4481),i=t(18054);n.Z=(0,o.Z)((function(e){return(0,s.Z)({root:{padding:0,margin:0,fontSize:".9rem"}})}))((function(e){var n=e.classes,t=e.children;return(0,i.jsx)("h1",{className:n.root,children:t})}))}}]);
//# sourceMappingURL=6129.286c1865.chunk.js.map