"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[2343],{22343:function(e,n,t){t.r(n);var c=t(77439),a=t(49058),s=t(57223),i=t(537),o=t(29240),r=t(83681),l=t(9690),u=t(64519),d=t(45114),f=t(46148),S=t(64964),I=t(47939),b=t(38199),p=t(29322),h=t(32542),m=t(11927),_=t(70466),Z=t(4481),k=t(18054),x=(0,i.$j)((function(e){return{session:e.console.session,loadingBucket:e.buckets.bucketDetails.loadingBucket,bucketInfo:e.buckets.bucketDetails.bucketInfo}}),{setErrorSnackMessage:u.Ih});function F(e){return{id:"simple-tab-".concat(e),"aria-controls":"simple-tabpanel-".concat(e)}}n.default=(0,Z.Z)((function(e){return(0,m.Z)((0,a.Z)({},_.VX))}))(x((function(e){var n=e.match,t=e.setErrorSnackMessage,i=e.loadingBucket,u=e.classes,m=(0,s.useState)(0),_=(0,c.Z)(m,2),Z=_[0],x=_[1],E=(0,s.useState)(!0),v=(0,c.Z)(E,2),g=v[0],A=v[1],N=(0,s.useState)([]),j=(0,c.Z)(N,2),L=j[0],C=j[1],T=(0,s.useState)(!0),D=(0,c.Z)(T,2),M=D[0],y=D[1],P=(0,s.useState)([]),U=(0,c.Z)(P,2),R=U[0],B=U[1],G=n.params.bucketName,O=(0,h.F)(G,[b.Ft.ADMIN_LIST_USER_POLICIES]),w=(0,h.F)(G,[b.Ft.ADMIN_GET_POLICY,b.Ft.ADMIN_LIST_USERS,b.Ft.ADMIN_LIST_GROUPS],!0),K=(0,h.F)(b.C3,[b.Ft.ADMIN_GET_USER]),Y=(0,h.F)(b.C3,[b.Ft.ADMIN_GET_POLICY,b.Ft.ADMIN_LIST_USERS,b.Ft.ADMIN_LIST_GROUPS]);(0,s.useEffect)((function(){i&&(y(!0),A(!0))}),[i,y,A]);var z=[{type:"view",disableButtonFunction:function(){return!Y},onClick:function(e){I.Z.push("".concat(b.gA.POLICIES,"/").concat(e.name))}}],V=[{type:"view",disableButtonFunction:function(){return!K},onClick:function(e){I.Z.push("".concat(b.gA.USERS,"/").concat(e))}}];return(0,s.useEffect)((function(){M&&(w?S.Z.invoke("GET","/api/v1/bucket-users/".concat(G)).then((function(e){B(e),y(!1)})).catch((function(e){t(e),y(!1)})):y(!1))}),[M,t,G,w]),(0,s.useEffect)((function(){g&&(O?S.Z.invoke("GET","/api/v1/bucket-policy/".concat(G)).then((function(e){C(e.policies),A(!1)})).catch((function(e){t(e),A(!1)})):A(!1))}),[g,t,G,O]),(0,k.jsxs)(s.Fragment,{children:[(0,k.jsx)(p.Z,{children:"\u6743\u9650\u5ba1\u6838"}),(0,k.jsxs)(r.Z,{value:Z,onChange:function(e,n){x(n)},indicatorColor:"primary",textColor:"primary","aria-label":"cluster-tabs",variant:"scrollable",scrollButtons:"auto",children:[O&&(0,k.jsx)(l.Z,(0,a.Z)({label:"\u7b56\u7565"},F(0))),w&&(0,k.jsx)(l.Z,(0,a.Z)({label:"\u7528\u6237"},F(1)))]}),(0,k.jsxs)(o.Z,{className:u.tableBlock,children:[(0,k.jsx)(d.x,{index:0,value:Z,children:(0,k.jsx)(h.s,{scopes:[b.Ft.ADMIN_LIST_USER_POLICIES],resource:G,errorProps:{disabled:!0},children:(0,k.jsx)(f.Z,{noBackground:!0,itemActions:z,columns:[{label:"\u540d\u79f0",elementKey:"name"}],isLoading:g,records:L,entityName:"Policies",idField:"name"})})}),(0,k.jsx)(d.x,{index:1,value:Z,children:(0,k.jsx)(h.s,{scopes:[b.Ft.ADMIN_GET_POLICY,b.Ft.ADMIN_LIST_USERS,b.Ft.ADMIN_LIST_GROUPS],resource:G,matchAll:!0,errorProps:{disabled:!0},children:(0,k.jsx)(f.Z,{noBackground:!0,itemActions:V,columns:[{label:"User",elementKey:"accessKey"}],isLoading:M,records:R,entityName:"Users",idField:"accessKey"})})})]})]})})))},29322:function(e,n,t){t(57223);var c=t(11927),a=t(4481),s=t(18054);n.Z=(0,a.Z)((function(e){return(0,c.Z)({root:{padding:0,margin:0,fontSize:".9rem"}})}))((function(e){var n=e.classes,t=e.children;return(0,s.jsx)("h1",{className:n.root,children:t})}))},45114:function(e,n,t){t.d(n,{x:function(){return r}});var c=t(49058),a=t(38861),s=t(57223),i=t(18054),o=["children","value","index"],r=function(e){var n=e.children,t=e.value,r=e.index,l=(0,a.Z)(e,o);return(0,i.jsx)("div",(0,c.Z)((0,c.Z)({role:"tabpanel",hidden:t!==r,id:"simple-tabpanel-".concat(r),"aria-labelledby":"simple-tab-".concat(r),style:{marginTop:"5px"}},l),{},{children:t===r&&(0,i.jsx)(s.Fragment,{children:n})}))}}}]);
//# sourceMappingURL=2343.fb0f65e7.chunk.js.map