github.com/minio/console@v1.4.1/web-app/build/static/js/4103.926c44ef.chunk.js (about) 1 "use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[4103],{64103:(t,e,a)=>{a.r(e),a.d(e,{default:()=>I});var s=a(65043),n=a(89923),i=a(73216),l=a(99161),o=a(20554),c=a(64159),r=a(95109),p=a(25448),u=a(94574),x=a(33097),d=a.n(x),m=a(70579);const h=u.Ay.div((t=>{let{theme:e}=t;return{marginTop:15,table:{width:"100%",borderCollapse:"collapse","& .feature-cell":{fontWeight:600,fontSize:14,paddingLeft:15},"& .status-cell":{textAlign:"center"},"& .header-cell":{textAlign:"center"},"& tr":{height:38,"& td":{borderBottom:"1px solid ".concat(d()(e,"borderColor","#E2E2E2"))},"& th":{borderBottom:"2px solid ".concat(d()(e,"borderColor","#E2E2E2"))}},"& .indicator":{display:"flex",alignItems:"center",justifyContent:"center","& .min-icon":{height:15,width:15},"&.active":{"& .min-icon":{fill:d()(e,"signalColors.good","#4CCB92")}},"&.deactivated":{"& .min-icon":{fill:d()(e,"signalColors.danger","#C51B3F")}}}}}})),f=t=>{let{matrixData:e=[],entityName:a="",entityType:s=""}=t;const[i=[],...l]=e,o=i.map(((t,e)=>(0,m.jsx)("th",{className:"header-cell",children:t},"".concat(0,e)))),c=l.map(((t,e)=>(0,m.jsx)("tr",{children:t.map(((t,a)=>{let s=null;return 0===a?s=t:""===t&&(s=""),!0===t?s=(0,m.jsx)(n.azJ,{className:"indicator active",children:(0,m.jsx)(n.GQ2,{})}):!1===t&&(s=(0,m.jsx)(n.azJ,{className:"indicator deactivated",children:(0,m.jsx)(n.GQ2,{})})),(0,m.jsx)("td",{className:0===a?"feature-cell":"status-cell",children:s},"".concat(e+1).concat(a))}))},"r-".concat(e+1))));return(0,m.jsxs)(h,{children:[(0,m.jsxs)(n.azJ,{sx:{marginTop:15,marginBottom:15},children:["Replication status for ",s,": ",(0,m.jsx)("strong",{children:a}),"."]}),(0,m.jsxs)("table",{children:[(0,m.jsx)("thead",{children:(0,m.jsx)("tr",{children:o})}),(0,m.jsx)("tbody",{children:c})]})]})};function g(t,e){return e?!t:""}function y(t,e,a){return Object.keys(t).find((t=>!(e[t]||{})[a]))}const j=t=>{let{entityType:e,entityValue:a}=t;return(0,m.jsxs)(n.azJ,{sx:{marginTop:"45px",display:"flex",alignItems:"center",justifyContent:"center"},children:[e,":"," ",(0,m.jsx)(n.azJ,{sx:{marginLeft:"5px",marginRight:"5px",fontWeight:600},children:a})," ","not found."]})},C=t=>{let{bucketStats:e={},sites:a={},lookupValue:s=""}=t;const n=["Tags","Policy","Quota","Retention","Encryption","Replication"],i=e[s]||{};if(!s)return null;const l=Object.keys(a),o=[];if(y(a,i,"HasBucket"))return(0,m.jsx)(j,{entityType:"Bucket",entityValue:s});{const t=[];for(let e=0;e<l.length;e++)0===e&&t.push(""),t.push(a[l[e]].name);o.push(t);for(let e=0;e<n.length;e++){const t=[],s=n[e];let c="";for(let n=0;n<l.length;n++){const o=i[a[l[n]].deploymentID];switch(0===n&&t.push(s),e){case 0:c=g(o.TagMismatch,o.HasTagsSet),t.push(c);break;case 1:c=g(o.PolicyMismatch,o.HasPolicySet),t.push(c);break;case 2:c=g(o.QuotaCfgMismatch,o.HasQuotaCfgSet),t.push(c);break;case 3:c=g(o.OLockConfigMismatch,o.HasOLockConfigSet),t.push(c);break;case 4:c=g(o.SSEConfigMismatch,o.HasSSECfgSet),t.push(c);break;case 5:c=g(o.ReplicationCfgMismatch,o.HasReplicationCfg),t.push(c)}}o.push(t)}}return(0,m.jsx)(f,{matrixData:o,entityName:s,entityType:"Bucket"})},b=t=>{let{policyStats:e={},sites:a={},lookupValue:s=""}=t;const n=["Policy"],i=e[s]||{};if(!s)return null;const l=Object.keys(a),o=[];if(y(a,i,"HasPolicy"))return(0,m.jsx)(j,{entityType:"Policy",entityValue:s});{const t=[];for(let e=0;e<l.length;e++)0===e&&t.push(""),t.push(a[l[e]].name);o.push(t);for(let e=0;e<n.length;e++){const t=[],s=n[e];let c="";for(let n=0;n<l.length;n++){const o=i[a[l[n]].deploymentID];if(0===n&&t.push(s),0===e)c=g(o.PolicyMismatch,o.HasPolicy),t.push(c)}o.push(t)}}return(0,m.jsx)(f,{matrixData:o,entityName:s,entityType:"Policy"})},S=t=>{let{groupStats:e={},sites:a={},lookupValue:s=""}=t;const n=["Info","Policy mapping"],i=e[s]||{};if(!s)return null;const l=Object.keys(a),o=[];if(y(a,i,"HasGroup"))return(0,m.jsx)(j,{entityType:"Group",entityValue:s});{const t=[];for(let e=0;e<l.length;e++)0===e&&t.push(""),t.push(a[l[e]].name);o.push(t);for(let e=0;e<n.length;e++){const t=[],s=n[e];let c="";for(let n=0;n<l.length;n++){const o=i[a[l[n]].deploymentID];switch(0===n&&t.push(s),e){case 0:c=g(o.GroupDescMismatch,o.HasGroup),t.push(c);break;case 1:c=g(o.PolicyMismatch,o.HasPolicyMapping),t.push(c)}}o.push(t)}}return(0,m.jsx)(f,{matrixData:o,entityName:s,entityType:"Group"})},k=t=>{let{userStats:e={},sites:a={},lookupValue:s=""}=t;const n=["Info","Policy mapping"],i=e[s]||{};if(!s)return null;const l=Object.keys(a),o=[];if(y(a,i,"HasUser"))return(0,m.jsx)(j,{entityType:"User",entityValue:s});{const t=[];for(let e=0;e<l.length;e++)0===e&&t.push(""),t.push(a[l[e]].name);o.push(t);for(let e=0;e<n.length;e++){const t=[],s=n[e];let c="";for(let n=0;n<l.length;n++){const o=i[a[l[n]].deploymentID];switch(0===n&&t.push(s),e){case 0:c=g(o.UserInfoMismatch,o.HasUser),t.push(c);break;case 1:c=g(o.PolicyMismatch,o.HasPolicyMapping),t.push(c)}}o.push(t)}}return(0,m.jsx)(f,{matrixData:o,entityName:s,entityType:"User"})};var T=a(6681);const w=()=>{const[t,e]=(0,s.useState)("bucket"),[a,i]=(0,s.useState)(""),[l,o]=(0,s.useState)({}),[c,r]=(0,s.useState)(!1),[u,x]=(0,p.A)((t=>{o(t),r(!0)}),(t=>{o({}),r(!0)})),{bucketStats:d={},sites:h={},userStats:f={},policyStats:g={},groupStats:y={}}=l||{};return(0,m.jsxs)(n.azJ,{children:[(0,m.jsxs)(n.azJ,{sx:{display:"grid",alignItems:"center",gridTemplateColumns:".7fr .9fr 1.2fr .3fr",["@media (max-width: ".concat(n.nmC.sm,"px)")]:{gridTemplateColumns:"1fr"},["@media (max-width: ".concat(n.nmC.md,"px)")]:{gridTemplateColumns:"1.2fr .7fr .7fr .3fr"},gap:"15px"},children:[(0,m.jsx)(n.azJ,{sx:{width:"240px",flexGrow:"0"},children:"View Replication Status for a:"}),(0,m.jsx)(n.azJ,{sx:{marginLeft:-25,["@media (max-width: ".concat(n.nmC.sm,"px)")]:{marginLeft:0}},children:(0,m.jsx)(n.l6P,{id:"replicationEntityLookup",name:"replicationEntityLookup",onChange:t=>{e(t),r(!1)},label:"",value:t,options:[{label:"Bucket",value:"bucket"},{label:"User",value:"user"},{label:"Group",value:"group"},{label:"Policy",value:"policy"}],disabled:!1})}),(0,m.jsx)(n.azJ,{sx:{flex:2},children:(0,m.jsx)(n.cl_,{id:"replicationLookupEntityValue",name:"replicationLookupEntityValue",onChange:t=>{i(t.target.value),r(!1)},placeholder:"test-".concat(t),label:"",value:a})}),(0,m.jsx)(n.azJ,{sx:{maxWidth:"80px"},children:(0,m.jsx)(T.A,{tooltip:"View across sites",children:(0,m.jsx)(n.$nd,{id:"view-across-sites",type:"button",onClick:()=>{!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(r(!1),t&&e){let a="api/v1/admin/site-replication/status?buckets=false&entityType=".concat(t,"&entityValue=").concat(e,"&groups=false&policies=false&users=false");x("GET",a)}}(t,a)},label:"View",icon:(0,m.jsx)(n.pHQ,{}),collapseOnSmall:!1,disabled:!a||!t})})})]}),u?(0,m.jsx)(n.xA9,{item:!0,xs:12,sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:45},children:(0,m.jsx)(n.aHM,{style:{width:25,height:25}})}):null,c?(0,m.jsxs)(n.azJ,{children:[!u&&"bucket"===t&&a?(0,m.jsx)(C,{bucketStats:d,sites:h,lookupValue:a}):null,!u&&"user"===t&&a?(0,m.jsx)(k,{userStats:f,sites:h,lookupValue:a}):null,!u&&"group"===t&&a?(0,m.jsx)(S,{groupStats:y,sites:h,lookupValue:a}):null,!u&&"policy"===t&&a?(0,m.jsx)(b,{policyStats:g,sites:h,lookupValue:a}):null]}):null]})};var z=a(48793),v=a(55968),J=a(56629),P=a(53518);const V=t=>{var e;let{maxValue:a=0,entityStatObj:s={},entityTextPlural:i="",icon:l=null}=t;const o=null===(e=Object.keys(s||{}))||void 0===e?void 0:e.length;return(0,m.jsx)(n.azJ,{withBorders:!0,sx:{padding:"25px",["@media (min-width: ".concat(n.nmC.sm,"px)")]:{maxWidth:"100%"}},children:(0,m.jsx)(r.A,{icon:l,onlineCount:a,offlineCount:o,okStatusText:"Synced",notOkStatusText:"Failed",label:i})})},I=()=>{const t=(0,i.Zp)(),[e,a]=(0,s.useState)({}),[r,p]=(0,s.useState)(!1),{maxBuckets:u=0,bucketStats:x={},maxGroups:d=0,groupStats:h={},maxUsers:f=0,userStats:g={},maxPolicies:y=0,policyStats:j={}}=e||{},C=()=>{p(!0),J.F.admin.getSiteReplicationStatus({buckets:!0,groups:!0,policies:!0,users:!0}).then((t=>{a(t.data)})).catch((t=>{a({}),b((0,c.C9)((0,P.S)(t.error)))})).finally((()=>p(!1)))};(0,s.useEffect)((()=>{C()}),[]);const b=(0,o.jL)();return(0,s.useEffect)((()=>{b((0,c.ph)("replication_status"))}),[]),(0,m.jsxs)(s.Fragment,{children:[(0,m.jsx)(z.A,{label:(0,m.jsx)(n.EGL,{label:"Site Replication",onClick:()=>t(l.zZ.SITE_REPLICATION)}),actions:(0,m.jsx)(v.A,{})}),(0,m.jsxs)(n.Mxu,{children:[(0,m.jsx)(n._xt,{actions:(0,m.jsx)(s.Fragment,{children:(0,m.jsx)(T.A,{tooltip:"Refresh",children:(0,m.jsx)(n.$nd,{id:"refresh",onClick:()=>{C()},label:"Refresh",icon:(0,m.jsx)(n.fNY,{}),variant:"regular",collapseOnSmall:!1})})}),separator:!0,children:"Replication status from all Sites"}),r?(0,m.jsx)(n.xA9,{item:!0,xs:12,sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:45},children:(0,m.jsx)(n.aHM,{style:{width:25,height:25}})}):(0,m.jsxs)(n.azJ,{sx:{display:"grid",marginTop:"25px",gridTemplateColumns:"1fr 1fr 1fr 1fr",["@media (max-width: ".concat(n.nmC.md,"px)")]:{gridTemplateColumns:"1fr 1fr"},["@media (max-width: ".concat(n.nmC.sm,"px)")]:{gridTemplateColumns:"1fr"},gap:"30px"},children:[(0,m.jsx)(V,{entityStatObj:x,entityTextPlural:"Buckets",maxValue:u,icon:(0,m.jsx)(n.brV,{})}),(0,m.jsx)(V,{entityStatObj:g,entityTextPlural:"Users",maxValue:f,icon:(0,m.jsx)(n.c2u,{})}),(0,m.jsx)(V,{entityStatObj:h,entityTextPlural:"Groups",maxValue:d,icon:(0,m.jsx)(n.YXz,{})}),(0,m.jsx)(V,{entityStatObj:j,entityTextPlural:"Policies",maxValue:y,icon:(0,m.jsx)(n.n$X,{})})]}),(0,m.jsx)(n.azJ,{withBorders:!0,sx:{minHeight:450,["@media (max-width: ".concat(n.nmC.sm,"px)")]:{minHeight:250},marginTop:"25px",padding:"25px"},children:(0,m.jsx)(w,{})})]})]})}},95109:(t,e,a)=>{a.d(e,{A:()=>r});a(65043);var s=a(94574),n=a(33097),i=a.n(n),l=a(89923),o=a(70579);const c=s.Ay.div((t=>{let{theme:e}=t;return{fontFamily:"Inter,sans-serif",maxWidth:"321px",display:"flex",marginLeft:"auto",marginRight:"auto",cursor:"default",color:i()(e,"signalColors.main","#07193E"),"& .mainBox":{flex:1,display:"flex",padding:"0 8px 0 8px",["@media (max-width: ".concat(l.nmC.sm,"px)")]:{padding:"0 10px 0 10px"},"& .indicatorIcon":{width:"20px",height:"20px",marginTop:"8px",maxWidth:"26px","& .min-icon":{width:"16px",height:"16px"}},"& .indicatorContainer":{flex:1,display:"flex",flexFlow:"column","& .indicatorLabel":{fontSize:"16px",fontWeight:600},"& .counterIndicator":{display:"flex",alignItems:"center",gap:"5px",justifyContent:"space-between",paddingBottom:0,fontSize:"55px",["@media (max-width: ".concat(l.nmC.sm,"px)")]:{paddingBottom:10,fontSize:"35px"},["@media (max-width: ".concat(l.nmC.lg,"px)")]:{fontSize:"45px"},["@media (max-width: ".concat(l.nmC.xl,"px)")]:{fontSize:"50px"},flexFlow:"row",fontWeight:600,"& .stat-text":{color:i()(e,"mutedText","#87888D"),fontSize:"12px",marginTop:"8px"},"& .stat-value":{textAlign:"center",height:"50px"},"& .min-icon":{marginRight:"8px",marginTop:"8px",height:"10px",width:"10px"}},"& .onlineCounter":{display:"flex",alignItems:"center",marginTop:"5px","& .min-icon":{fill:i()(e,"signalColors.good","#4CCB92")}},"& .offlineCount":{display:"flex",alignItems:"center",marginTop:"8px","& .min-icon":{fill:i()(e,"signalColors.danger","#C51B3F")}}}}}})),r=t=>{let{onlineCount:e=0,offlineCount:a=0,icon:s=null,label:n="",okStatusText:i="Online",notOkStatusText:r="Offline"}=t;return(0,o.jsx)(c,{children:(0,o.jsxs)(l.azJ,{className:"mainBox",children:[(0,o.jsxs)(l.azJ,{className:"indicatorContainer",children:[(0,o.jsx)(l.azJ,{className:"indicatorLabel",children:n}),(0,o.jsxs)(l.azJ,{className:"counterIndicator",children:[(0,o.jsxs)(l.azJ,{children:[(0,o.jsx)(l.azJ,{className:"stat-value",children:e}),(0,o.jsxs)(l.azJ,{className:"onlineCounter",children:[(0,o.jsx)(l.GQ2,{}),(0,o.jsx)("div",{className:"stat-text",children:i})]})]}),(0,o.jsxs)(l.azJ,{children:[(0,o.jsx)(l.azJ,{className:"stat-value",children:a}),(0,o.jsxs)(l.azJ,{className:"offlineCount",children:[(0,o.jsx)(l.GQ2,{})," ",(0,o.jsx)("div",{className:"stat-text",children:r})]})]})]})]}),(0,o.jsx)(l.azJ,{className:"indicatorIcon",children:s})]})})}}}]); 2 //# sourceMappingURL=4103.926c44ef.chunk.js.map