Files
object-browser/portal-ui/build/static/js/2512.acfc57ce.chunk.js
2022-04-25 15:41:06 -07:00

2 lines
16 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[2512],{23804:function(e,t,n){n(72791);var i=n(11135),a=n(25787),s=n(61889),l=n(80184);t.Z=(0,a.Z)((function(e){return(0,i.Z)({root:{border:"1px solid #E2E2E2",borderRadius:2,backgroundColor:"#FBFAFA",paddingLeft:25,paddingTop:31,paddingBottom:21,paddingRight:30},leftItems:{fontSize:16,fontWeight:"bold",marginBottom:15,display:"flex",alignItems:"center","& .min-icon":{marginRight:15,height:28,width:38}},helpText:{fontSize:16,paddingLeft:5}})}))((function(e){var t=e.classes,n=e.iconComponent,i=e.title,a=e.help;return(0,l.jsx)("div",{className:t.root,children:(0,l.jsxs)(s.ZP,{container:!0,children:[(0,l.jsxs)(s.ZP,{item:!0,xs:12,className:t.leftItems,children:[n,i]}),(0,l.jsx)(s.ZP,{item:!0,xs:12,className:t.helpText,children:a})]})})}))},32512:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var i=n(93433),a=n(29439),s=n(1413),l=n(72791),r=n(60364),o=n(11135),c=n(25787),d=n(61889),u=n(42649),m=n(23814),h=n(38442),f=n(56087),p=n(92388),x=n(81207),g=n(92983),Z=n(23804),j=n(60680),v=n(75578),b=n(40603),S=n(36151),k=n(56028),N=n(21435),R=n(17420),C=n(64163),P=n(37516),y=n(80184),E=(0,r.$j)(null,{setModalErrorSnackMessage:u.zb}),I=(0,c.Z)((function(e){return(0,o.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)((0,s.Z)({buttonContainer:{textAlign:"right"},multiContainer:{display:"flex",alignItems:"center"},sizeFactorContainer:{"& label":{display:"none"},"& div:first-child":{marginBottom:0}}},m.bK),m.QV),m.DF),m.ID),{},{modalFormScrollable:(0,s.Z)((0,s.Z)({},m.ID.modalFormScrollable),{},{paddingRight:10})}))}))(E((function(e){var t=e.closeModalAndRefresh,n=e.open,i=e.classes,s=e.bucketName,r=e.ruleID,o=e.setModalErrorSnackMessage,c=(0,l.useState)(!0),u=(0,a.Z)(c,2),m=u[0],h=u[1],f=(0,l.useState)(!1),g=(0,a.Z)(f,2),Z=g[0],j=g[1],v=(0,l.useState)("1"),b=(0,a.Z)(v,2),E=b[0],I=b[1],F=(0,l.useState)(""),T=(0,a.Z)(F,2),A=T[0],M=T[1],w=(0,l.useState)(""),D=(0,a.Z)(w,2),B=D[0],O=D[1],_=(0,l.useState)(!1),L=(0,a.Z)(_,2),G=L[0],U=L[1],z=(0,l.useState)(!1),K=(0,a.Z)(z,2),H=K[0],W=K[1],Y=(0,l.useState)(""),q=(0,a.Z)(Y,2),V=q[0],$=q[1],Q=(0,l.useState)(""),X=(0,a.Z)(Q,2),J=X[0],ee=X[1],te=(0,l.useState)(""),ne=(0,a.Z)(te,2),ie=ne[0],ae=ne[1],se=(0,l.useState)(!1),le=(0,a.Z)(se,2),re=le[0],oe=le[1],ce=(0,l.useState)(!1),de=(0,a.Z)(ce,2),ue=de[0],me=de[1],he=(0,l.useState)(!1),fe=(0,a.Z)(he,2),pe=fe[0],xe=fe[1];return(0,l.useEffect)((function(){m&&x.Z.invoke("GET","/api/v1/buckets/".concat(s,"/replication/").concat(r)).then((function(e){I(e.priority.toString());var t=e.prefix||"",n=e.tags||"";O(t),$(n),ee(n),M(e.destination.bucket),U(e.delete_marker_replication),ae(e.storageClass||""),oe(!!e.existingObjects),me(!!e.deletes_replication),xe("Enabled"===e.status),W(!!e.metadata_replication),h(!1)})).catch((function(e){o(e),h(!1)}))}),[m,o,s,r]),(0,l.useEffect)((function(){if(Z){var e={arn:A,ruleState:pe,prefix:B,tags:J,replicateDeleteMarkers:G,replicateDeletes:ue,replicateExistingObjects:re,replicateMetadata:H,priority:parseInt(E),storageClass:ie};x.Z.invoke("PUT","/api/v1/buckets/".concat(s,"/replication/").concat(r),e).then((function(){j(!1),t(!0)})).catch((function(e){o(e),j(!1)}))}}),[Z,s,r,A,B,J,G,E,ue,re,pe,H,ie,t,o]),(0,y.jsx)(k.Z,{modalOpen:n,onClose:function(){t(!1)},title:"Edit Bucket Replication",titleIcon:(0,y.jsx)(p.xR,{}),children:(0,y.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){e.preventDefault(),j(!0)},children:(0,y.jsxs)(d.ZP,{container:!0,children:[(0,y.jsxs)(d.ZP,{item:!0,xs:12,className:i.modalFormScrollable,children:[(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(P.Z,{checked:pe,id:"ruleState",name:"ruleState",label:"Rule State",onChange:function(e){xe(e.target.checked)},value:pe})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(C.Z,{label:"Destination",content:A})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(N.Z,{id:"priority",name:"priority",onChange:function(e){e.target.validity.valid&&I(e.target.value)},label:"Priority",value:E,pattern:"[0-9]*"})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:"".concat(i.spacerTop," ").concat(i.formFieldRow),children:(0,y.jsx)(N.Z,{id:"storageClass",name:"storageClass",onChange:function(e){ae(e.target.value)},placeholder:"STANDARD_IA,REDUCED_REDUNDANCY etc",label:"Storage Class",value:ie})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,children:(0,y.jsxs)("fieldset",{className:i.fieldGroup,children:[(0,y.jsx)("legend",{className:i.descriptionText,children:"Object Filters"}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(N.Z,{id:"prefix",name:"prefix",onChange:function(e){O(e.target.value)},placeholder:"prefix",label:"Prefix",value:B})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(R.Z,{name:"tags",label:"Tags",elements:V,onChange:function(e){ee(e)},keyPlaceholder:"Tag Key",valuePlaceholder:"Tag Value",withBorder:!0})})]})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,children:(0,y.jsxs)("fieldset",{className:i.fieldGroup,children:[(0,y.jsx)("legend",{className:i.descriptionText,children:"Replication Options"}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(P.Z,{checked:re,id:"repExisting",name:"repExisting",label:"Existing Objects",onChange:function(e){oe(e.target.checked)},value:re,description:"Replicate existing objects"})}),(0,y.jsx)(P.Z,{checked:H,id:"metadatataSync",name:"metadatataSync",label:"Metadata Sync",onChange:function(e){W(e.target.checked)},value:H,description:"Metadata Sync"}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(P.Z,{checked:G,id:"deleteMarker",name:"deleteMarker",label:"Delete Marker",onChange:function(e){U(e.target.checked)},value:G,description:"Replicate soft deletes"})}),(0,y.jsx)(d.ZP,{item:!0,xs:12,className:i.formFieldRow,children:(0,y.jsx)(P.Z,{checked:ue,id:"repDelete",name:"repDelete",label:"Deletes",onChange:function(e){me(e.target.checked)},value:ue,description:"Replicate versioned deletes"})})]})})]}),(0,y.jsxs)(d.ZP,{item:!0,xs:12,className:i.modalButtonBar,children:[(0,y.jsx)(S.Z,{type:"button",variant:"outlined",color:"primary",disabled:m||Z,onClick:function(){t(!1)},children:"Cancel"}),(0,y.jsx)(S.Z,{type:"submit",variant:"contained",color:"primary",disabled:m||Z,children:"Save"})]})]})})})}))),F=(0,v.Z)(l.lazy((function(){return n.e(889).then(n.bind(n,20889))}))),T=(0,v.Z)(l.lazy((function(){return n.e(9088).then(n.bind(n,69088))}))),A=(0,r.$j)((function(e){return{session:e.console.session,loadingBucket:e.buckets.bucketDetails.loadingBucket,bucketInfo:e.buckets.bucketDetails.bucketInfo}}),{setErrorSnackMessage:u.Ih}),M=(0,c.Z)((function(e){return(0,o.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},m.qg),m.OR),{},{twHeight:{minHeight:400}}))}))(A((function(e){var t=e.classes,n=e.match,s=e.setErrorSnackMessage,r=e.loadingBucket,o=(0,l.useState)(!0),c=(0,a.Z)(o,2),u=c[0],m=c[1],v=(0,l.useState)([]),S=(0,a.Z)(v,2),k=S[0],N=S[1],R=(0,l.useState)(!1),C=(0,a.Z)(R,2),P=C[0],E=C[1],A=(0,l.useState)(!1),M=(0,a.Z)(A,2),w=M[0],D=M[1],B=(0,l.useState)(!1),O=(0,a.Z)(B,2),_=O[0],L=O[1],G=(0,l.useState)(""),U=(0,a.Z)(G,2),z=U[0],K=U[1],H=(0,l.useState)([]),W=(0,a.Z)(H,2),Y=W[0],q=W[1],V=(0,l.useState)(!1),$=(0,a.Z)(V,2),Q=$[0],X=$[1],J=n.params.bucketName,ee=(0,h.F)(J,[f.Ft.S3_GET_REPLICATION_CONFIGURATION]);(0,l.useEffect)((function(){r&&m(!0)}),[r,m]),(0,l.useEffect)((function(){u&&(ee?x.Z.invoke("GET","/api/v1/buckets/".concat(J,"/replication")).then((function(e){var t=e.rules?e.rules:[];t.sort((function(e,t){return e.priority-t.priority})),N(t),m(!1)})).catch((function(e){s(e),m(!1)})):m(!1))}),[u,s,J,ee]);var te=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];D(e)},ne=[{type:"delete",onClick:function(e){K(e.id),X(!1),E(!0)}},{type:"view",onClick:function(e){K(e.id),L(!0)},disableButtonFunction:!(0,h.F)(J,[f.Ft.S3_PUT_REPLICATION_CONFIGURATION],!0)}];return(0,y.jsxs)(l.Fragment,{children:[w&&(0,y.jsx)(F,{closeModalAndRefresh:function(){te(!1),m(!0)},open:w,bucketName:J,setReplicationRules:k}),P&&(0,y.jsx)(T,{deleteOpen:P,selectedBucket:J,closeDeleteModalAndRefresh:function(e){E(!1),e&&m(!0)},ruleToDelete:z,rulesToDelete:Y,remainingRules:k.length,allSelected:Y.length===k.length,deleteSelectedRules:Q}),_&&(0,y.jsx)(I,{closeModalAndRefresh:function(e){L(!1),e&&m(!0)},open:_,bucketName:J,ruleID:z}),(0,y.jsxs)(d.ZP,{container:!0,children:[(0,y.jsxs)(d.ZP,{item:!0,xs:12,className:t.actionsTray,children:[(0,y.jsx)(j.Z,{children:"Replication"}),(0,y.jsxs)("div",{children:[(0,y.jsx)(h.s,{scopes:[f.Ft.S3_PUT_REPLICATION_CONFIGURATION],resource:J,matchAll:!0,errorProps:{disabled:!0},children:(0,y.jsx)(b.Z,{tooltip:"Remove Selected Replication Rules",onClick:function(){K("selectedRules"),X(!0),E(!0)},text:"Remove Selected Rules",icon:(0,y.jsx)(p.XH,{}),color:"secondary",variant:"outlined",disabled:0===Y.length})}),(0,y.jsx)(h.s,{scopes:[f.Ft.S3_PUT_REPLICATION_CONFIGURATION],resource:J,matchAll:!0,errorProps:{disabled:!0},children:(0,y.jsx)(b.Z,{tooltip:"Add Replication Rule",onClick:function(){te(!0)},text:"Add Replication Rule",icon:(0,y.jsx)(p.dt,{}),color:"primary",variant:"contained"})})]})]}),(0,y.jsx)(d.ZP,{item:!0,xs:12,children:(0,y.jsx)(h.s,{scopes:[f.Ft.S3_GET_REPLICATION_CONFIGURATION],resource:J,errorProps:{disabled:!0},children:(0,y.jsx)(g.Z,{itemActions:ne,columns:[{label:"Priority",elementKey:"priority",width:55,contentTextAlign:"center"},{label:"Destination",elementKey:"destination",renderFunction:function(e){return(0,y.jsx)(l.Fragment,{children:e.bucket.replace("arn:aws:s3:::","")})}},{label:"Prefix",elementKey:"prefix",width:200},{label:"Tags",elementKey:"tags",renderFunction:function(e){return(0,y.jsx)(l.Fragment,{children:e&&""!==e.tags?"Yes":"No"})},width:60},{label:"Status",elementKey:"status",width:100}],isLoading:u,records:k,entityName:"Replication Rules",idField:"id",customPaperHeight:t.twHeight,textSelectable:!0,selectedItems:Y,onSelect:function(e){return function(e){var t=e.target,n=t.value,a=t.checked,s=(0,i.Z)(Y);return a?s.push(n):s=s.filter((function(e){return e!==n})),q(s),s}(e)},onSelectAll:function(){Y.length!==k.length?q(k.map((function(e){return e.id}))):q([])}})})}),(0,y.jsxs)(d.ZP,{item:!0,xs:12,children:[(0,y.jsx)("br",{}),(0,y.jsx)(Z.Z,{title:"Replication",iconComponent:(0,y.jsx)(p.wN,{}),help:(0,y.jsxs)(l.Fragment,{children:["MinIO supports server-side and client-side replication of objects between source and destination buckets.",(0,y.jsx)("br",{}),(0,y.jsx)("br",{}),"You can learn more at our"," ",(0,y.jsx)("a",{href:"https://docs.min.io/minio/baremetal/replication/replication-overview.html?ref=con",target:"_blank",rel:"noreferrer",children:"documentation"}),"."]})})]})]})]})})))},64163:function(e,t,n){var i=n(1413),a=n(72791),s=n(61889),l=n(11135),r=n(25787),o=n(23814),c=n(80184);t.Z=(0,r.Z)((function(e){return(0,l.Z)((0,i.Z)({},o.xx))}))((function(e){var t=e.classes,n=e.label,i=void 0===n?"":n,l=e.content,r=e.multiLine,o=void 0!==r&&r;return(0,c.jsx)(a.Fragment,{children:(0,c.jsxs)(s.ZP,{className:t.prefinedContainer,children:[""!==i&&(0,c.jsx)(s.ZP,{item:!0,xs:12,className:t.predefinedTitle,children:i}),(0,c.jsx)(s.ZP,{item:!0,xs:12,className:t.predefinedList,children:(0,c.jsx)(s.ZP,{item:!0,xs:12,className:o?t.innerContentMultiline:t.innerContent,children:l})})]})})}))},17420:function(e,t,n){var i=n(93433),a=n(29439),s=n(1413),l=n(72791),r=n(26181),o=n.n(r),c=n(48573),d=n.n(c),u=n(11135),m=n(25787),h=n(61889),f=n(77961),p=n(30829),x=n(20068),g=n(23814),Z=n(21435),j=n(47919),v=n(80184);t.Z=(0,m.Z)((function(e){return(0,u.Z)((0,s.Z)((0,s.Z)((0,s.Z)({},g.YI),g.Hr),{},{inputWithBorder:{border:"1px solid #EAEAEA",padding:15,height:150,overflowY:"auto",position:"relative",marginTop:15},lineInputBoxes:{display:"flex",marginBottom:10},queryDiv:{alignSelf:"center",margin:"0 4px",fontWeight:600}}))}))((function(e){var t=e.elements,n=e.name,s=e.label,r=e.tooltip,c=void 0===r?"":r,u=e.keyPlaceholder,m=void 0===u?"":u,g=e.valuePlaceholder,b=void 0===g?"":g,S=e.onChange,k=e.withBorder,N=void 0!==k&&k,R=e.classes,C=(0,l.useState)([""]),P=(0,a.Z)(C,2),y=P[0],E=P[1],I=(0,l.useState)([""]),F=(0,a.Z)(I,2),T=F[0],A=F[1],M=(0,l.createRef)();(0,l.useEffect)((function(){if(1===y.length&&""===y[0]&&1===T.length&&""===T[0]&&t&&""!==t){var e=t.split("&"),n=[],i=[];e.forEach((function(e){var t=e.split("=");2===t.length&&(n.push(t[0]),i.push(t[1]))})),n.push(""),i.push(""),E(n),A(i)}}),[y,T,t]),(0,l.useEffect)((function(){var e=M.current;e&&y.length>1&&e.scrollIntoView(!1)}),[y]);var w=(0,l.useRef)(!0);(0,l.useLayoutEffect)((function(){w.current?w.current=!1:O()}),[y,T]);var D=function(e){e.persist();var t=(0,i.Z)(y);t[o()(e.target,"dataset.index",0)]=e.target.value,E(t)},B=function(e){e.persist();var t=(0,i.Z)(T);t[o()(e.target,"dataset.index",0)]=e.target.value,A(t)},O=d()((function(){var e="";y.forEach((function(t,n){if(y[n]&&T[n]){var i="".concat(t,"=").concat(T[n]);0!==n&&(i="&".concat(i)),e="".concat(e).concat(i)}})),S(e)}),500),_=T.map((function(e,t){return(0,v.jsxs)(h.ZP,{item:!0,xs:12,className:R.lineInputBoxes,children:[(0,v.jsx)(Z.Z,{id:"".concat(n,"-key-").concat(t.toString()),label:"",name:"".concat(n,"-").concat(t.toString()),value:y[t],onChange:D,index:t,placeholder:m}),(0,v.jsx)("span",{className:R.queryDiv,children:":"}),(0,v.jsx)(Z.Z,{id:"".concat(n,"-value-").concat(t.toString()),label:"",name:"".concat(n,"-").concat(t.toString()),value:T[t],onChange:B,index:t,placeholder:b,overlayIcon:t===T.length-1?(0,v.jsx)(j.Z,{}):null,overlayAction:function(){!function(){if(""!==y[y.length-1].trim()&&""!==T[T.length-1].trim()){var e=(0,i.Z)(y),t=(0,i.Z)(T);e.push(""),t.push(""),E(e),A(t)}}()}})]},"query-pair-".concat(n,"-").concat(t.toString()))}));return(0,v.jsx)(l.Fragment,{children:(0,v.jsxs)(h.ZP,{item:!0,xs:12,className:R.fieldContainer,children:[(0,v.jsxs)(p.Z,{className:R.inputLabel,children:[(0,v.jsx)("span",{children:s}),""!==c&&(0,v.jsx)("div",{className:R.tooltipContainer,children:(0,v.jsx)(x.Z,{title:c,placement:"top-start",children:(0,v.jsx)(f.Z,{className:R.tooltip})})})]}),(0,v.jsxs)(h.ZP,{item:!0,xs:12,className:"".concat(N?R.inputWithBorder:""),children:[_,(0,v.jsx)("div",{ref:M})]})]})})}))},56028:function(e,t,n){var i=n(29439),a=n(1413),s=n(72791),l=n(60364),r=n(13400),o=n(55646),c=n(5574),d=n(65661),u=n(39157),m=n(11135),h=n(25787),f=n(23814),p=n(42649),x=n(29823),g=n(28057),Z=n(80184),j=(0,l.$j)((function(e){return{modalSnackMessage:e.system.modalSnackBar}}),{setModalSnackMessage:p.MK});t.Z=(0,h.Z)((function(e){return(0,m.Z)((0,a.Z)((0,a.Z)({},f.Qw),{},{content:{padding:25,paddingBottom:0},customDialogSize:{width:"100%",maxWidth:765}},f.sN))}))(j((function(e){var t=e.onClose,n=e.modalOpen,l=e.title,m=e.children,h=e.classes,f=e.wideLimit,p=void 0===f||f,j=e.modalSnackMessage,v=e.noContentPadding,b=e.setModalSnackMessage,S=e.titleIcon,k=void 0===S?null:S,N=(0,s.useState)(!1),R=(0,i.Z)(N,2),C=R[0],P=R[1];(0,s.useEffect)((function(){b("")}),[b]),(0,s.useEffect)((function(){if(j){if(""===j.message)return void P(!1);"error"!==j.type&&P(!0)}}),[j]);var y=p?{classes:{paper:h.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},E="";return j&&(E=j.detailedErrorMsg,(""===j.detailedErrorMsg||j.detailedErrorMsg.length<5)&&(E=j.message)),(0,Z.jsxs)(c.Z,(0,a.Z)((0,a.Z)({open:n,classes:h},y),{},{scroll:"paper",onClose:function(e,n){"backdropClick"!==n&&t()},className:h.root,children:[(0,Z.jsxs)(d.Z,{className:h.title,children:[(0,Z.jsxs)("div",{className:h.titleText,children:[k," ",l]}),(0,Z.jsx)("div",{className:h.closeContainer,children:(0,Z.jsx)(r.Z,{"aria-label":"close",id:"close",className:h.closeButton,onClick:t,disableRipple:!0,size:"small",children:(0,Z.jsx)(x.Z,{})})})]}),(0,Z.jsx)(g.Z,{isModal:!0}),(0,Z.jsx)(o.Z,{open:C,className:h.snackBarModal,onClose:function(){P(!1),b("")},message:E,ContentProps:{className:"".concat(h.snackBar," ").concat(j&&"error"===j.type?h.errorSnackBar:"")},autoHideDuration:j&&"error"===j.type?1e4:5e3}),(0,Z.jsx)(u.Z,{className:v?"":h.content,children:m})]}))})))},60680:function(e,t,n){n(72791);var i=n(11135),a=n(25787),s=n(80184);t.Z=(0,a.Z)((function(e){return(0,i.Z)({root:{padding:0,margin:0,fontSize:".9rem"}})}))((function(e){var t=e.classes,n=e.children;return(0,s.jsx)("h1",{className:t.root,children:n})}))}}]);
//# sourceMappingURL=2512.acfc57ce.chunk.js.map