2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[3328],{63328:function(e,n,t){t.r(n),t.d(n,{default:function(){return q}});var s=t(29439),i=t(1413),l=t(72791),o=t(60364),a=t(16871),r=t(11135),c=t(25787),u=t(61889),d=t(64554),f=t(26181),x=t.n(f),h=t(23814),p=t(81207),Z=t(56087),m=t(38442),j=t(75578),v=t(45902),g=t(80184),b=function(e){var n=e.icon,t=void 0===n?null:n,s=e.label,i=void 0===s?null:s;return(0,g.jsxs)(d.Z,{sx:{display:"flex"},children:[(0,g.jsx)("div",{style:{height:16,width:16,display:"flex",alignItems:"center",marginTop:5},children:t}),(0,g.jsx)("div",{style:{marginLeft:t?5:"none"},children:i})]})},E=t(56096),T=t(45987),C=t(36151),_=t(72401),S=["isLoading","onClick","label"],y=function(e){var n=e.isLoading,t=e.onClick,s=e.label,l=(0,T.Z)(e,S);return(0,g.jsx)(C.Z,(0,i.Z)((0,i.Z)({color:"primary",onClick:t,variant:"text",sx:{padding:0,margin:0,alignItems:"flex-start",justifyContent:"flex-start",display:"inline-flex",height:"auto",textDecoration:"underline",color:"#2781B0","&:hover":{background:"#ffffff",textDecoration:"underline"}},disableRipple:!0,disableFocusRipple:!0},l),{},{children:n?(0,g.jsx)(_.Z,{style:{width:16,height:16}}):s}))},N=t(13400),k=t(33548),I=["disabled","onClick"],O=(0,c.Z)((function(e){return(0,r.Z)({root:{"&:hover":{backgroundColor:"#E2E2E2"}}})}))((function(e){var n=e.disabled,t=e.onClick,s=(0,T.Z)(e,I);return(0,g.jsx)(N.Z,(0,i.Z)((0,i.Z)({size:"small",disabled:n,onClick:t},s),{},{children:(0,g.jsx)(k.Z,{})}))})),F=function(e){var n=e.resourceName,t=e.iamScopes,s=e.secureCmpProps,l=void 0===s?{}:s,o=e.children;return(0,g.jsx)(m.s,(0,i.Z)((0,i.Z)({scopes:t,resource:n,errorProps:{disabled:!0}},l),{},{children:o}))},R=function(e){var n=e.isLoading,t=void 0===n||n,s=e.resourceName,i=void 0===s?"":s,l=e.iamScopes,o=e.secureCmpProps,a=void 0===o?{}:o,r=e.property,c=void 0===r?null:r,u=e.value,f=void 0===u?null:u,x=e.onEdit;return(0,g.jsxs)(d.Z,{sx:{display:"flex",alignItems:"baseline",justifyContent:"flex-start"},children:[(0,g.jsx)(v.Z,{label:c,value:(0,g.jsx)(F,{resourceName:i,iamScopes:l,secureCmpProps:a,children:(0,g.jsx)(y,{isLoading:t,onClick:x,label:f})})}),(0,g.jsx)(F,{resourceName:i,iamScopes:l,secureCmpProps:a,children:(0,g.jsx)(O,{onClick:x,sx:{background:"#f8f8f8",marginLeft:"3px",top:3,"& .min-icon":{width:"16px",height:"16px"}}})})]})},U=t(45248),G=function(e){var n=e.bucketSize;return(0,g.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center","& .min-icon":{height:37,width:37}},children:[(0,g.jsx)(E.Mhr,{}),(0,g.jsxs)(d.Z,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"center",flexFlow:"column",marginLeft:"20px",fontSize:"19px"},children:[(0,g.jsx)("label",{style:{fontWeight:600},children:"Reported Usage:"}),(0,g.jsx)("label",{children:(0,U.ae)(n)})]})]})},P=function(e){var n=e.quota;return(0,g.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center","& .min-icon":{height:37,width:37}},children:[(0,g.jsx)(E.sjJ,{}),(0,g.jsxs)(d.Z,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"center",flexFlow:"column",marginLeft:"20px",fontSize:"19px"},children:[(0,g.jsxs)("label",{style:{fontWeight:600,textTransform:"capitalize"},children:[null===n||void 0===n?void 0:n.type," Quota"]}),(0,g.jsxs)("label",{children:[" ",(0,U.ae)("".concat(null===n||void 0===n?void 0:n.quota),!0)]})]})]})},A=t(50896),L=t(87995),B=t(9859),w=t(25469),K=(0,j.Z)(l.lazy((function(){return Promise.all([t.e(2813),t.e(1913)]).then(t.bind(t,33690))}))),z=(0,j.Z)(l.lazy((function(){return t.e(1604).then(t.bind(t,1604))}))),M=(0,j.Z)(l.lazy((function(){return t.e(8391).then(t.bind(t,18391))}))),D=(0,j.Z)(l.lazy((function(){return t.e(402).then(t.bind(t,70402))}))),V=(0,j.Z)(l.lazy((function(){return Promise.all([t.e(1918),t.e(1705)]).then(t.bind(t,71705))}))),Q=(0,j.Z)(l.lazy((function(){return t.e(1581).then(t.bind(t,1581))}))),Y={display:"grid",gridTemplateColumns:{xs:"1fr",sm:"2fr 1fr"},gridAutoFlow:{xs:"dense",sm:"row"},gap:2},q=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)({},h.bK),h.VI))}))((function(e){var n=e.classes,t=(0,w.TL)(),r=(0,a.UO)(),c=(0,o.v9)(B.HQ),f=(0,o.v9)(B.G6),h=(0,o.v9)(L.N5),j=(0,l.useState)(null),T=(0,s.Z)(j,2),C=T[0],_=T[1],S=(0,l.useState)("0"),y=(0,s.Z)(S,2),N=y[0],k=y[1],I=(0,l.useState)(!1),O=(0,s.Z)(I,2),F=O[0],U=O[1],q=(0,l.useState)(!1),J=(0,s.Z)(q,2),W=J[0],H=J[1],X=(0,l.useState)(!1),$=(0,s.Z)(X,2),ee=$[0],ne=$[1],te=(0,l.useState)(!0),se=(0,s.Z)(te,2),ie=se[0],le=se[1],oe=(0,l.useState)(!0),ae=(0,s.Z)(oe,2),re=ae[0],ce=ae[1],ue=(0,l.useState)(!0),de=(0,s.Z)(ue,2),fe=de[0],xe=de[1],he=(0,l.useState)(!0),pe=(0,s.Z)(he,2),Ze=pe[0],me=pe[1],je=(0,l.useState)(!0),ve=(0,s.Z)(je,2),ge=ve[0],be=ve[1],Ee=(0,l.useState)(!0),Te=(0,s.Z)(Ee,2),Ce=Te[0],_e=Te[1],Se=(0,l.useState)(!0),ye=(0,s.Z)(Se,2),Ne=ye[0],ke=ye[1],Ie=(0,l.useState)(!0),Oe=(0,s.Z)(Ie,2),Fe=Oe[0],Re=Oe[1],Ue=(0,l.useState)(!1),Ge=(0,s.Z)(Ue,2),Pe=Ge[0],Ae=Ge[1],Le=(0,l.useState)(!1),Be=(0,s.Z)(Le,2),we=Be[0],Ke=Be[1],ze=(0,l.useState)(null),Me=(0,s.Z)(ze,2),De=Me[0],Ve=Me[1],Qe=(0,l.useState)(!1),Ye=(0,s.Z)(Qe,2),qe=Ye[0],Je=Ye[1],We=(0,l.useState)(!1),He=(0,s.Z)(We,2),Xe=He[0],$e=He[1],en=(0,l.useState)(null),nn=(0,s.Z)(en,2),tn=nn[0],sn=nn[1],ln=(0,l.useState)(!1),on=(0,s.Z)(ln,2),an=on[0],rn=on[1],cn=(0,l.useState)(!1),un=(0,s.Z)(cn,2),dn=un[0],fn=un[1],xn=(0,l.useState)(!1),hn=(0,s.Z)(xn,2),pn=hn[0],Zn=hn[1],mn=(0,l.useState)(!1),jn=(0,s.Z)(mn,2),vn=jn[0],gn=jn[1],bn=r.bucketName||"",En="n/a",Tn="";null!==f&&(En=f.access,Tn=f.definition);var Cn=(0,m.F)(bn,[Z.Ft.S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION]),_n=(0,m.F)(bn,[Z.Ft.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION]),Sn=(0,m.F)(bn,[Z.Ft.ADMIN_GET_BUCKET_QUOTA]);(0,l.useEffect)((function(){xe(!!c)}),[c,xe]),(0,l.useEffect)((function(){Ze&&(_n?p.Z.invoke("GET","/api/v1/buckets/".concat(bn,"/encryption/info")).then((function(e){e.algorithm&&(Je(!0),_(e)),me(!1)})).catch((function(e){"The server side encryption configuration was not found"===e.errorMessage&&(Je(!1),_(null)),me(!1)})):(Je(!1),_(null),me(!1)))}),[Ze,bn,_n]),(0,l.useEffect)((function(){ge&&h&&p.Z.invoke("GET","/api/v1/buckets/".concat(bn,"/versioning")).then((function(e){Ae(e.is_versioned),be(!1)})).catch((function(e){t((0,L.Ih)(e)),be(!1)}))}),[ge,t,bn,h]),(0,l.useEffect)((function(){Ce&&h&&(Sn?p.Z.invoke("GET","/api/v1/buckets/".concat(bn,"/quota")).then((function(e){Ve(e),e.quota?Ke(!0):Ke(!1),_e(!1)})).catch((function(e){t((0,L.Ih)(e)),Ke(!1),_e(!1)})):(Ke(!1),_e(!1)))}),[Ce,be,t,bn,h,Sn]),(0,l.useEffect)((function(){ge&&h&&(Cn?p.Z.invoke("GET","/api/v1/buckets/".concat(bn,"/object-locking")).then((function(e){U(e.object_locking_enabled),le(!1)})).catch((function(e){t((0,L.Ih)(e)),le(!1)})):le(!1))}),[ie,t,bn,ge,h,Cn]),(0,l.useEffect)((function(){re&&p.Z.invoke("GET","/api/v1/buckets").then((function(e){var n=x()(e,"buckets",[]).find((function(e){return e.name===bn})),t=x()(n,"size","0");ce(!1),k(t)})).catch((function(e){ce(!1),t((0,L.Ih)(e))}))}),[re,t,bn]),(0,l.useEffect)((function(){Ne&&h&&p.Z.invoke("GET","/api/v1/buckets/".concat(bn,"/replication")).then((function(e){var n=e.rules?e.rules:[];ne(n.length>0),ke(!1)})).catch((function(e){t((0,L.Ih)(e)),ke(!1)}))}),[Ne,t,bn,h]),(0,l.useEffect)((function(){Fe&&F&&p.Z.invoke("GET","/api/v1/buckets/".concat(bn,"/retention")).then((function(e){Re(!1),$e(!0),sn(e)})).catch((function(e){$e(!1),Re(!1),sn(null)}))}),[Fe,F,bn]);var yn=function(){t((0,B.d5)(!0)),xe(!0),ce(!0),be(!0),me(!0),Re(!0)};return(0,g.jsxs)(l.Fragment,{children:[dn&&(0,g.jsx)(M,{open:dn,selectedBucket:bn,encryptionEnabled:qe,encryptionCfg:C,closeModalAndRefresh:function(){fn(!1),me(!0)}}),pn&&(0,g.jsx)(Q,{open:pn,selectedBucket:bn,enabled:we,cfg:De,closeModalAndRefresh:function(){Zn(!1),_e(!0)}}),W&&(0,g.jsx)(K,{bucketName:bn,open:W,actualPolicy:En,actualDefinition:Tn,closeModalAndRefresh:function(){H(!1),yn()}}),an&&(0,g.jsx)(z,{bucketName:bn,open:an,closeModalAndRefresh:function(){rn(!1),yn()}}),vn&&(0,g.jsx)(D,{closeVersioningModalAndRefresh:function(e){gn(!1),e&&yn()},modalOpen:vn,selectedBucket:bn,versioningCurrentState:Pe}),(0,g.jsx)(A.Z,{children:"Summary"}),(0,g.jsxs)(u.ZP,{container:!0,spacing:1,children:[(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_BUCKET_POLICY],resource:bn,children:(0,g.jsx)(u.ZP,{item:!0,xs:12,children:(0,g.jsxs)(d.Z,{sx:(0,i.Z)({},Y),children:[(0,g.jsxs)(d.Z,{sx:(0,i.Z)({},Y),children:[(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_BUCKET_POLICY],resource:bn,children:(0,g.jsx)(R,{iamScopes:[Z.Ft.S3_PUT_BUCKET_POLICY],resourceName:bn,property:"Access Policy:",value:En.toLowerCase(),onEdit:function(){H(!0)},isLoading:fe})}),(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_BUCKET_ENCRYPTION_CONFIGURATION],resource:bn,children:(0,g.jsx)(R,{iamScopes:[Z.Ft.S3_PUT_BUCKET_ENCRYPTION_CONFIGURATION],resourceName:bn,property:"Encryption:",value:qe?"Enabled":"Disabled",onEdit:function(){fn(!0)},isLoading:Ze})}),(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_REPLICATION_CONFIGURATION],resource:bn,children:(0,g.jsx)(v.Z,{label:"Replication:",value:(0,g.jsx)(b,{icon:ee?(0,g.jsx)(E.E31,{}):(0,g.jsx)(E.dRf,{}),label:(0,g.jsx)("label",{className:n.textMuted,children:ee?"Enabled":"Disabled"})})})}),(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_BUCKET_OBJECT_LOCK_CONFIGURATION],resource:bn,children:(0,g.jsx)(v.Z,{label:"Object Locking:",value:(0,g.jsx)(b,{icon:F?(0,g.jsx)(E.E31,{}):(0,g.jsx)(E.dRf,{}),label:(0,g.jsx)("label",{className:n.textMuted,children:F?"Enabled":"Disabled"})})})}),(0,g.jsx)(d.Z,{className:n.spacerTop,children:(0,g.jsx)(v.Z,{label:"Tags:",value:(0,g.jsx)(V,{bucketName:bn})})}),(0,g.jsx)(R,{iamScopes:[Z.Ft.ADMIN_SET_BUCKET_QUOTA],resourceName:bn,property:"Quota:",value:we?"Enabled":"Disabled",onEdit:function(){Zn(!0)},isLoading:Ce})]}),(0,g.jsxs)(d.Z,{sx:{display:"grid",gridTemplateColumns:"1fr",alignItems:"flex-start"},children:[(0,g.jsx)(G,{bucketSize:N}),we&&De?(0,g.jsx)(P,{quota:De}):null]})]})})}),h&&(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_BUCKET_VERSIONING],resource:bn,children:(0,g.jsxs)(u.ZP,{item:!0,xs:12,children:[(0,g.jsx)(A.Z,{children:"Versioning"}),(0,g.jsx)(d.Z,{sx:(0,i.Z)({},Y),children:(0,g.jsx)(d.Z,{sx:(0,i.Z)({},Y),children:(0,g.jsx)(R,{iamScopes:[Z.Ft.S3_PUT_BUCKET_VERSIONING],resourceName:bn,property:"Current Status:",value:Pe?"Versioned":"Unversioned (Default)",onEdit:function(){gn(!0)},isLoading:ge})})})]})}),F&&(0,g.jsx)(m.s,{scopes:[Z.Ft.S3_GET_OBJECT_RETENTION],resource:bn,children:(0,g.jsxs)(u.ZP,{item:!0,xs:12,children:[(0,g.jsx)(A.Z,{children:"Retention"}),(0,g.jsxs)(d.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"2fr 1fr"},gridAutoFlow:{xs:"dense",sm:"row"},gap:2},children:[(0,g.jsxs)(d.Z,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"2fr 1fr"},gridAutoFlow:{xs:"dense",sm:"row"},gap:2},children:[(0,g.jsx)(R,{iamScopes:[Z.Ft.ADMIN_SET_BUCKET_QUOTA],resourceName:bn,property:"Retention:",value:Xe?"Enabled":"Disabled",onEdit:function(){rn(!0)},isLoading:Fe}),(0,g.jsx)(v.Z,{label:"Mode:",value:(0,g.jsx)("label",{className:n.textMuted,style:{textTransform:"capitalize"},children:tn&&tn.mode?tn.mode:"-"})}),(0,g.jsx)(v.Z,{label:"Validity:",value:(0,g.jsxs)("label",{className:n.textMuted,style:{textTransform:"capitalize"},children:[tn&&tn.validity," ",tn&&(1===tn.validity?tn.unit.slice(0,-1):tn.unit)]})})]}),(0,g.jsx)(d.Z,{sx:{display:"grid",gridTemplateColumns:"1fr",alignItems:"flex-start"}})]})]})})]})]})}))},45902:function(e,n,t){var s=t(1413),i=(t(72791),t(53767)),l=t(80184);n.Z=function(e){var n=e.label,t=void 0===n?null:n,o=e.value,a=void 0===o?"-":o,r=e.orientation,c=void 0===r?"column":r,u=e.stkProps,d=void 0===u?{}:u,f=e.lblProps,x=void 0===f?{}:f,h=e.valProps,p=void 0===h?{}:h;return(0,l.jsxs)(i.Z,(0,s.Z)((0,s.Z)({direction:{xs:"column",sm:c}},d),{},{children:[(0,l.jsx)("label",(0,s.Z)((0,s.Z)({style:{marginRight:5,fontWeight:600}},x),{},{children:t})),(0,l.jsx)("label",(0,s.Z)((0,s.Z)({style:{marginRight:5,fontWeight:500}},p),{},{children:a}))]}))}}}]);
|
|
//# sourceMappingURL=3328.72ba5ec0.chunk.js.map
|