Files
object-browser/portal-ui/build/static/js/1829.4291766b.chunk.js
Alex fa1f84bd0a Release v0.25.1 (#2723)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
2023-03-17 17:34:30 -07:00

2 lines
8.8 KiB
JavaScript

(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1829],{47986:function(e,t,n){"use strict";n(72791);var a=n(61889),o=n(64554),r=n(75952),i=n(80184);t.Z=function(e){var t=e.iconComponent,n=e.entity;return(0,i.jsx)(a.ZP,{container:!0,alignItems:"center",children:(0,i.jsx)(a.ZP,{item:!0,xs:12,children:(0,i.jsx)(r.KfX,{title:"".concat(n," not available"),iconComponent:t,help:(0,i.jsxs)(o.Z,{sx:{fontSize:"14px",display:"flex",border:"none",flexFlow:{xs:"column",md:"row"},"& a":{color:function(e){return e.colors.link},textDecoration:"underline"}},children:[(0,i.jsx)("div",{children:"This feature is not available for a single-disk setup."}),(0,i.jsxs)("div",{children:["Please deploy a server in"," ",(0,i.jsx)("a",{href:"https://min.io/docs/minio/linux/operations/install-deploy-manage/deploy-minio-multi-node-multi-drive.html?ref=con",target:"_blank",rel:"noopener",children:"Distributed Mode"})," ","to use this feature."]})]})})})})}},61829:function(e,t,n){"use strict";n.r(t);var a=n(29439),o=n(1413),r=n(72791),i=n(78687),s=n(4834),c=n(61889),l=n(68096),u=n(58406),d=n(77865),f=n(27391),h=n(95087),b=n(75952),x=n(11135),p=n(25787),m=n(26824),g=n(45248),j=n(23814),v=n(56087),y=n(34866),Z=n(81207),w=n(74794),S=n(38442),k=n(47986),C=n(87995),E=n(72455),H=n(47974),N=n(20601),T=n(38725),D=n(82839),_=n(90466),A=n(12891),P=n(35667),B=n(57702),O=n(83672),G=n(80184),F=(0,E.Z)((function(e){return(0,x.Z)((0,o.Z)((0,o.Z)((0,o.Z)({graphContainer:{backgroundColor:"#fff",border:"#EAEDEE 1px solid",borderRadius:3,padding:"19px 38px",marginTop:15},scanInfo:{marginTop:20,display:"flex",flexDirection:"row",justifyContent:"space-between"},scanData:{fontSize:13},formBox:{padding:15,border:"1px solid #EAEAEA"},buttonBar:{display:"flex",alignItems:"center",justifyContent:"flex-end"},bucketField:{flex:1},prefixField:(0,o.Z)((0,o.Z)({},j.qg.searchField),{},{marginLeft:10,flex:1}),actionsTray:(0,o.Z)((0,o.Z)({},j.OR.actionsTray),{},{marginBottom:0})},j.IX),j.qg),j.Bz))})),I=(0,p.Z)((function(e){return(0,x.Z)({root:{lineHeight:"50px",marginRight:15,"label + &":{marginTop:e.spacing(3)},"& .MuiSelect-select:focus":{backgroundColor:"transparent"}}})}))(s.ZP);t.default=function(){var e=F(),t=(0,i.v9)(C.N5),n=(0,r.useState)(!1),o=(0,a.Z)(n,2),s=o[0],x=o[1],p=(0,r.useState)(""),j=(0,a.Z)(p,2),E=j[0],R=j[1],z=(0,r.useState)([]),K=(0,a.Z)(z,2),L=K[0],M=K[1],U=(0,r.useState)(""),Y=(0,a.Z)(U,2),q=Y[0],W=Y[1],$=(0,r.useState)(!1),X=(0,a.Z)($,2),J=X[0],V=X[1],Q=(0,r.useState)(!1),ee=(0,a.Z)(Q,2),te=ee[0],ne=ee[1],ae=(0,r.useState)(!1),oe=(0,a.Z)(ae,2),re=oe[0],ie=oe[1],se=(0,r.useState)({beforeHeal:[0,0,0,0],afterHeal:[0,0,0,0],objectsHealed:0,objectsScanned:0,healDuration:0,sizeScanned:""}),ce=(0,a.Z)(se,2),le=ce[0],ue=ce[1];(0,r.useEffect)((function(){Z.Z.invoke("GET","/api/v1/buckets").then((function(e){var t=[];null!==e.buckets&&(t=e.buckets),M(t)})).catch((function(e){console.error(e)}))}),[]),(0,r.useEffect)((function(){!0===te&&ie(!1)}),[te]),(0,r.useEffect)((function(){!0===re&&ne(!1)}),[re]);var de=function(e){return[e.Green,e.Yellow,e.Red,e.Grey]};(0,r.useEffect)((function(){if(s){var e={Green:0,Yellow:0,Red:0,Grey:0},t={Green:0,Yellow:0,Red:0,Grey:0},n=new URL(window.location.toString()),o=n.port,r=new URL(document.baseURI).pathname,i=(0,m.x2)(n.protocol),c=new h.w3cwebsocket("".concat(i,"://").concat(n.hostname,":").concat(o).concat(r,"ws/heal/").concat(E,"?prefix=").concat(q,"&recursive=").concat(J,"&force-start=").concat(te,"&force-stop=").concat(re));if(null!==c)return c.onopen=function(){console.log("WebSocket Client Connected"),c.send("ok")},c.onmessage=function(n){for(var o=JSON.parse(n.data.toString()),r=0,i=Object.entries(o.healthAfterCols);r<i.length;r++){var s=(0,a.Z)(i[r],2),c=s[0],l=s[1];t[c]=100*l/o.itemsScanned}for(var u=0,d=Object.entries(o.healthBeforeCols);u<d.length;u++){var f=(0,a.Z)(d[u],2),h=f[0],b=f[1];e[h]=100*b/o.itemsScanned}ue({beforeHeal:de(e),afterHeal:de(t),objectsHealed:o.objectsHealed,objectsScanned:o.objectsScanned,healDuration:o.healDuration,sizeScanned:(0,g.ae)(o.bytesScanned.toString())})},c.onclose=function(){x(!1),console.log("connection closed by server")},function(){c.close(1e3),console.log("closing websockets")}}}),[s,E,te,re,q,J]);var fe=[{name:"Green",ah:le.afterHeal[0],bh:le.beforeHeal[0],amt:100},{name:"Yellow",ah:le.afterHeal[1],bh:le.beforeHeal[1],amt:100},{name:"Red",ah:le.afterHeal[2],bh:le.beforeHeal[2],amt:100},{name:"Grey",ah:le.afterHeal[3],bh:le.beforeHeal[3],amt:100}],he=L.map((function(e){return{label:e.name,value:e.name}}));return(0,G.jsxs)(r.Fragment,{children:[(0,G.jsx)(H.Z,{label:"Drives"}),(0,G.jsx)(w.Z,{children:t?(0,G.jsxs)(S.s,{scopes:[v.Ft.ADMIN_HEAL],resource:v.C3,children:[(0,G.jsxs)(c.ZP,{xs:12,item:!0,className:e.formBox,children:[(0,G.jsxs)(c.ZP,{item:!0,xs:12,className:e.actionsTray,children:[(0,G.jsx)(l.Z,{variant:"outlined",className:e.bucketField,children:(0,G.jsxs)(u.Z,{label:"Bucket",id:"bucket-name",name:"bucket-name",value:E,onChange:function(e){R(e.target.value)},className:e.searchField,input:(0,G.jsx)(I,{}),displayEmpty:!0,children:[(0,G.jsx)(d.Z,{value:"",children:"Select Bucket"},"select-bucket-name-default"),he.map((function(e){return(0,G.jsx)(d.Z,{value:e.value,children:e.label},"select-bucket-name-".concat(e.label))}))]})}),(0,G.jsx)(f.Z,{label:"Prefix",className:e.prefixField,id:"prefix-resource",disabled:!1,InputProps:{disableUnderline:!0},onChange:function(e){W(e.target.value)},variant:"standard"})]}),(0,G.jsxs)(c.ZP,{item:!0,xs:12,className:e.inlineCheckboxes,children:[(0,G.jsx)(y.Z,{name:"recursive",id:"recursive",value:"recursive",checked:J,onChange:function(e){V(e.target.checked)},disabled:!1,label:"Recursive"}),(0,G.jsx)(y.Z,{name:"forceStart",id:"forceStart",value:"forceStart",checked:te,onChange:function(e){ne(e.target.checked)},disabled:!1,label:"Force Start"}),(0,G.jsx)(y.Z,{name:"forceStop",id:"forceStop",value:"forceStop",checked:re,onChange:function(e){ie(e.target.checked)},disabled:!1,label:"Force Stop"})]}),(0,G.jsx)(c.ZP,{item:!0,xs:12,className:e.buttonBar,children:(0,G.jsx)(b.zxk,{id:"start-heal",type:"submit",variant:"callAction",color:"primary",disabled:s,onClick:function(){return x(!0)},label:"Start"})})]}),(0,G.jsxs)(c.ZP,{item:!0,xs:12,className:e.graphContainer,children:[(0,G.jsx)(N.h,{width:"90%",height:400,children:(0,G.jsxs)(T.v,{width:600,height:400,data:fe,margin:{top:5,right:30,left:20,bottom:5},children:[(0,G.jsx)(D.q,{strokeDasharray:"3 3"}),(0,G.jsx)(_.K,{dataKey:"name"}),(0,G.jsx)(A.B,{}),(0,G.jsx)(P.u,{}),(0,G.jsx)(O.D,{verticalAlign:"top",layout:"vertical"}),(0,G.jsx)(B.$,{dataKey:"ah",name:"After Healing",fill:"rgba(0, 0, 255, 0.2)",stroke:"rgba(0, 0, 255, 1)"}),(0,G.jsx)(B.$,{dataKey:"bh",name:"Before Healing",fill:"rgba(153, 102, 255, 0.2)",stroke:"rgba(153, 102, 255, 1)"})]})}),(0,G.jsxs)(c.ZP,{item:!0,xs:12,className:e.scanInfo,children:[(0,G.jsxs)("div",{className:e.scanData,children:[(0,G.jsx)("strong",{children:"Size scanned:"})," ",le.sizeScanned]}),(0,G.jsxs)("div",{className:e.scanData,children:[(0,G.jsx)("strong",{children:"Objects healed:"})," ",le.objectsHealed," /"," ",le.objectsScanned]}),(0,G.jsxs)("div",{className:e.scanData,children:[(0,G.jsx)("strong",{children:"Healing time:"})," ",le.healDuration,"s"]})]})]})]}):(0,G.jsx)(k.Z,{entity:"Heal",iconComponent:(0,G.jsx)(b.lnI,{})})})]})}},26824:function(e,t,n){"use strict";n.d(t,{HE:function(){return r},V9:function(){return a},ci:function(){return o},x2:function(){return i}});var a=1006,o=1008,r=1011,i=function(e){var t="ws";return"https:"===e&&(t="wss"),t}},94210:function(e){var t=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"===typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},38725:function(e,t,n){"use strict";n.d(t,{v:function(){return c}});var a=n(75095),o=n(57702),r=n(90466),i=n(12891),s=n(93137),c=(0,a.z)({chartName:"BarChart",GraphicalChild:o.$,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:r.K},{axisType:"yAxis",AxisComp:i.B}],formatAxisMap:s.t9})},95087:function(e,t,n){var a;if("object"===typeof globalThis)a=globalThis;else try{a=n(94210)}catch(s){}finally{if(a||"undefined"===typeof window||(a=window),!a)throw new Error("Could not determine global this")}var o=a.WebSocket||a.MozWebSocket,r=n(51496);function i(e,t){return t?new o(e,t):new o(e)}o&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(i,e,{get:function(){return o[e]}})})),e.exports={w3cwebsocket:o?i:null,version:r}},51496:function(e,t,n){e.exports=n(19794).version},19794:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=1829.4291766b.chunk.js.map