Files
object-browser/portal-ui/build/static/js/9561.ebe2bdbf.chunk.js
2022-08-10 20:43:36 -07:00

2 lines
9.3 KiB
JavaScript

"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9561],{23804:function(e,n,t){t(72791);var i=t(11135),r=t(25787),a=t(61889),o=t(80184);n.Z=(0,r.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 n=e.classes,t=e.iconComponent,i=e.title,r=e.help;return(0,o.jsx)("div",{className:n.root,children:(0,o.jsxs)(a.ZP,{container:!0,children:[(0,o.jsxs)(a.ZP,{item:!0,xs:12,className:n.leftItems,children:[t,i]}),(0,o.jsx)(a.ZP,{item:!0,xs:12,className:n.helpText,children:r})]})})}))},79561:function(e,n,t){t.r(n);var i=t(93433),r=t(1413),a=t(29439),o=t(72791),s=t(61889),l=t(64554),d=t(40986),c=t(36151),p=t(16871),x=t(40603),u=t(9505),f=t(38734),h=t(21435),m=t(32291),g=t(84669),j=t(56087),Z=t(74794),v=t(23804),y=t(50896),b=t(87995),C=t(25469),S=t(80184),k=function(e){var n=!1;try{new URL(e),n=!0}catch(t){n=!1}return n||""===e?"":"Invalid Endpoint"};n.default=function(){var e=(0,C.TL)(),n=(0,p.s0)(),t=(0,o.useState)([]),I=(0,a.Z)(t,2),T=I[0],w=I[1],P=(0,o.useState)(""),R=(0,a.Z)(P,2),B=R[0],E=R[1],A=(0,o.useState)(""),K=(0,a.Z)(A,2),L=K[0],W=K[1],z=(0,o.useState)([]),F=(0,a.Z)(z,2),N=F[0],O=F[1],q=function(){var e=null!==T&&void 0!==T&&T.length?[{endpoint:"",name:""}]:[{endpoint:"",name:""},{endpoint:"",name:""}];O(e)},_=(0,u.Z)((function(e){var n=e.sites,t=e.name,i=n.findIndex((function(e){return e.name===t}));if(-1!==i){var a=n[i];a=(0,r.Z)((0,r.Z)({},a),{},{isCurrent:!0}),n.splice(i,1,a)}n.sort((function(e,n){return e.name===t?-1:n.name===t?1:0})),w(n)}),(function(e){w([])})),D=(0,a.Z)(_,2),M=D[0],H=D[1],G=function(){H("GET","api/v1/admin/site-replication")};(0,o.useEffect)((function(){G()}),[]),(0,o.useEffect)((function(){q()}),[T]);var U=N.reduce((function(e,n,t){var i=N[t].endpoint,r=k(i);return""===r&&""!==i&&e.push(r),e}),[]).length===N.length,V=(0,u.Z)((function(t){t.success?(e((0,b.y1)(t.status)),X(),G(),n(j.gA.SITE_REPLICATION)):e((0,b.Ih)({errorMessage:"Error",detailedError:t.status}))}),(function(n){e((0,b.Ih)(n))})),Y=(0,a.Z)(V,2),J=Y[0],Q=Y[1],X=function(){E(""),W(""),q()};return(0,S.jsxs)(o.Fragment,{children:[(0,S.jsx)(m.Z,{label:(0,S.jsx)(g.Z,{to:j.gA.SITE_REPLICATION,label:"Add Replication Site"})}),(0,S.jsx)(Z.Z,{children:(0,S.jsxs)(l.Z,{sx:{display:"grid",padding:"25px",gap:"25px",gridTemplateColumns:{md:"2fr 1.2fr",xs:"1fr"},border:"1px solid #eaeaea"},children:[(0,S.jsxs)(l.Z,{children:[(0,S.jsx)(y.Z,{icon:(0,S.jsx)(f.aWt,{}),children:"Add Sites for Replication"}),M||J?(0,S.jsx)(d.Z,{}):null,(0,S.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){return e.preventDefault(),function(){var e=null===T||void 0===T?void 0:T.map((function(e,n){return{accessKey:B,secretKey:L,name:e.name,endpoint:e.endpoint}})),n=N.reduce((function(e,n,t){return n.endpoint&&e.push({accessKey:B,secretKey:L,name:n.name||"dr-site-".concat(t),endpoint:n.endpoint}),e}),[]);Q("POST","api/v1/admin/site-replication",[].concat((0,i.Z)(e||[]),(0,i.Z)(n||[])))}()},children:[(0,S.jsx)(s.ZP,{item:!0,xs:12,marginBottom:"15px",children:(0,S.jsxs)(l.Z,{sx:{fontStyle:"italic",display:"flex",alignItems:"center",fontSize:"12px",marginTop:2},children:[(0,S.jsx)(l.Z,{sx:{fontWeight:600},children:"Note:"})," ",(0,S.jsx)(l.Z,{sx:{marginLeft:1},children:"Access Key and Secret Key should be same on all sites."})]})}),(0,S.jsx)(s.ZP,{item:!0,xs:12,marginBottom:"15px",sx:{"& label span":{fontWeight:"normal"}},children:(0,S.jsx)(h.Z,{id:"add-rep-peer-accKey",name:"add-rep-peer-accKey",onChange:function(e){E(e.target.value)},label:"Access Key",required:!0,value:B,error:""===B?"Access Key is required.":"","data-test-id":"add-site-rep-acc-key"})}),(0,S.jsx)(s.ZP,{item:!0,xs:12,marginBottom:"30px",sx:{"& label span":{fontWeight:"normal"}},children:(0,S.jsx)(h.Z,{id:"add-rep-peer-secKey",name:"add-rep-peer-secKey",type:"password",required:!0,onChange:function(e){W(e.target.value)},error:""===L?"Secret Key is required.":"",label:"Secret Key",value:L,"data-test-id":"add-site-rep-sec-key"})}),(0,S.jsx)(s.ZP,{item:!0,xs:12,children:(0,S.jsx)(l.Z,{sx:{marginBottom:"15px",fontSize:"14px",fontWeight:600},children:"Peer Sites"})}),(0,S.jsxs)(l.Z,{sx:{display:"grid",gridTemplateColumns:".8fr 1.2fr .2fr",border:"1px solid #eaeaea",padding:"15px",gap:"10px",maxHeight:"430px",overflowY:"auto"},children:[(0,S.jsx)(l.Z,{sx:{fontSize:"14px",marginLeft:"5px"},children:"Site Name"}),(0,S.jsxs)(l.Z,{sx:{fontSize:"14px",marginLeft:"5px"},children:["Endpoint ","*"]}),(0,S.jsx)(l.Z,{children:" "}),null===T||void 0===T?void 0:T.map((function(e,n){return(0,S.jsxs)(o.Fragment,{children:[(0,S.jsx)(l.Z,{children:(0,S.jsx)(h.Z,{id:"add-rep-ex-peer-site-".concat(n),name:"add-rep-ex-peer-site-".concat(n),extraInputProps:{readOnly:!0},label:"",value:e.name,onChange:function(){}})}),(0,S.jsx)(l.Z,{children:(0,S.jsx)(h.Z,{id:"add-rep-ex-peer-site-ep-".concat(n),name:"add-rep-ex-peer-site-ep-".concat(n),extraInputProps:{readOnly:!0},label:"",value:e.endpoint,onChange:function(){}})}),(0,S.jsx)(s.ZP,{item:!0,xs:12,children:" "})]},e.name)})),N.map((function(e,n){var t=!1;return(null!==T&&void 0!==T&&T.length&&0===n||(null===T||void 0===T||!T.length)&&n<2)&&(t=!0),(0,S.jsxs)(o.Fragment,{children:[(0,S.jsx)(l.Z,{children:(0,S.jsx)(h.Z,{id:"add-rep-peer-site-".concat(n),name:"add-rep-peer-site-".concat(n),placeholder:"dr-site-".concat(n),label:"",value:"".concat(e.name),onChange:function(e){var t=e.target.value;O((function(e){return e.map((function(e,i){return i===n?(0,r.Z)((0,r.Z)({},e),{},{name:t}):e}))}))},"data-test-id":"add-site-rep-peer-site-".concat(n)})}),(0,S.jsx)(l.Z,{children:(0,S.jsx)(h.Z,{id:"add-rep-peer-site-ep-".concat(n),name:"add-rep-peer-site-ep-".concat(n),placeholder:"https://dr.minio-storage:900".concat(n),label:"",error:k(N[n].endpoint),value:"".concat(e.endpoint),onChange:function(e){var t=e.target.value;O((function(e){return e.map((function(e,i){return i===n?(0,r.Z)((0,r.Z)({},e),{},{endpoint:t}):e}))}))},"data-test-id":"add-site-rep-peer-ep-".concat(n)})}),(0,S.jsx)(s.ZP,{item:!0,xs:12,alignItems:"center",display:"flex",children:(0,S.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",alignSelf:"baseline",marginTop:"4px","& button":{borderColor:"#696969",color:"#696969",borderRadius:"50%"}},children:[(0,S.jsx)(x.Z,{tooltip:"Add a Row",text:"",variant:"outlined",color:"primary",icon:(0,S.jsx)(f.dtP,{}),onClick:function(e){e.preventDefault();var t=(0,i.Z)(N);t.splice(n+1,0,{name:"",endpoint:""}),O(t)}}),(0,S.jsx)(x.Z,{tooltip:"Remove Row",text:"",variant:"outlined",disabled:t,color:"primary",icon:(0,S.jsx)(f.HFL,{}),onClick:function(e){e.preventDefault(),O(N.filter((function(e,t){return t!==n})))}})]})})]},"".concat(n))}))]}),(0,S.jsx)(s.ZP,{item:!0,xs:12,children:(0,S.jsxs)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",marginTop:"20px",gap:"15px"},children:[(0,S.jsx)(c.Z,{type:"button",variant:"outlined",color:"primary",disabled:J,onClick:X,children:"Clear"}),(0,S.jsx)(c.Z,{type:"submit",variant:"contained",color:"primary",disabled:J||!B||!L||!U,children:"Save"})]})})]})]}),(0,S.jsx)(v.Z,{title:"",iconComponent:null,help:(0,S.jsxs)(o.Fragment,{children:[(0,S.jsxs)(l.Z,{sx:{marginTop:"-25px",fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center",justifyContent:"flex-start",padding:"2px"},children:[(0,S.jsx)(l.Z,{sx:{backgroundColor:"#07193E",height:"15px",width:"15px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",marginRight:"18px",padding:"3px",paddingLeft:"2px","& .min-icon":{height:"11px",width:"11px",fill:"#ffffff"}},children:(0,S.jsx)(f.aWt,{})}),"About Site Replication"]}),(0,S.jsxs)(l.Z,{sx:{display:"flex",flexFlow:"column",fontSize:"14px",flex:"2","& .step-number":{color:"#ffffff",height:"25px",width:"25px",background:"#081C42",marginRight:"10px",textAlign:"center",fontWeight:600,borderRadius:"50%"},"& .step-row":{fontSize:"14px",display:"flex",marginTop:"15px",marginBottom:"15px","&.step-text":{fontWeight:400},"&:before":{content:"' '",height:"7px",width:"7px",backgroundColor:"#2781B0",marginRight:"10px",marginTop:"12px",flexShrink:0}}},children:[(0,S.jsx)(l.Z,{children:"The following changes are replicated to all other sites"}),(0,S.jsxs)("ul",{children:[(0,S.jsx)("li",{children:"Creation and deletion of buckets and objects"}),(0,S.jsx)("li",{children:"Creation and deletion of all IAM users, groups, policies and their mappings to users or groups"}),(0,S.jsx)("li",{children:"Creation of STS credentials"}),(0,S.jsx)("li",{children:"Creation and deletion of service accounts (except those owned by the root user)"}),(0,S.jsxs)("li",{children:["Changes to Bucket features such as",(0,S.jsxs)("ul",{children:[(0,S.jsx)("li",{children:"Bucket Policies"}),(0,S.jsx)("li",{children:"Bucket Tags"}),(0,S.jsx)("li",{children:"Bucket Object-Lock configurations"}),(0,S.jsx)("li",{children:"Bucket Encryption configuration"})]})]}),(0,S.jsxs)("li",{children:["The following Bucket features will NOT be replicated",(0,S.jsxs)("ul",{children:[(0,S.jsx)("li",{children:"Bucket notification configuration"}),(0,S.jsx)("li",{children:"Bucket lifecycle (ILM) configuration"})]})]})]})]})]})})]})})]})}}}]);
//# sourceMappingURL=9561.ebe2bdbf.chunk.js.map