Files
openmaxio-object-browser/portal-ui/build/static/js/5088.8ed4fd39.chunk.js
2023-08-03 14:54:29 -07:00

2 lines
9.5 KiB
JavaScript

(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[5088],{75088:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return S}});var r=n(29439),s=n(72791),i=n(95087),o=n(78687),l=n(57689),c=n(29945),a="error",d="success",u="inProgress",x=n(81551),f=n(26824),h=n(87995),g=n(12808),p=n(9478),j=n(31776),m=n(80184),b=function(e){var t=e.title,n=e.children,i=(0,s.useState)("N/A"),o=(0,r.Z)(i,2),l=o[0],a=o[1],d=(0,s.useState)(0),u=(0,r.Z)(d,2),x=u[0],f=u[1],h=(0,s.useState)(0),g=(0,r.Z)(h,2),p=g[0],b=g[1],w=(0,s.useState)(!0),v=(0,r.Z)(w,2),y=v[0],S=v[1];return(0,s.useEffect)((function(){y&&j.h.admin.adminInfo({defaultOnly:!0}).then((function(e){var t,n=null===(t=e.data.servers)||void 0===t?void 0:t.length;if(f(n||0),e.data.servers&&e.data.servers.length>0){a(e.data.servers[0].version||"N/A");var r=e.data.servers.reduce((function(e,t){return e+(t.drives?t.drives.length:0)}),0);b(r)}S(!1)})).catch((function(){S(!1)}))}),[y]),(0,m.jsxs)(c.rjZ,{item:!0,xs:12,children:[(0,m.jsx)(c.NZf,{separator:!0,children:t}),(0,m.jsxs)(c.rjZ,{item:!0,xs:12,children:[(0,m.jsx)(c.rjZ,{item:!0,xs:12,sx:{padding:0,marginBottom:25},children:(0,m.jsx)(c.rjZ,{container:!0,sx:{padding:25},children:y?(0,m.jsx)(s.Fragment,{children:(0,m.jsx)(c.rjZ,{item:!0,xs:12,sx:{textAlign:"center"},children:(0,m.jsx)(c.aNw,{style:{width:25,height:25}})})}):(0,m.jsxs)(s.Fragment,{children:[(0,m.jsxs)(c.rjZ,{item:!0,xs:12,md:4,sx:{fontSize:18,display:"flex",alignItems:"center","& svg":{marginRight:10}},children:[(0,m.jsx)(c.FU8,{})," ",(0,m.jsx)("strong",{children:x}),"\xa0nodes,\xa0",(0,m.jsx)("strong",{children:p}),"\xa0 drives"]}),(0,m.jsxs)(c.rjZ,{item:!0,xs:12,md:4,sx:{fontSize:12,justifyContent:"center",alignSelf:"center",alignItems:"center",display:"flex"},children:[(0,m.jsx)("span",{style:{marginRight:20},children:(0,m.jsx)(c.Dbk,{})})," ","MinIO VERSION\xa0",(0,m.jsx)("strong",{children:l})]})]})})}),n]})]})},w=n(31460),v=n(47974),y=n(99670),S=function(){var e=(0,x.TL)(),t=(0,l.s0)(),n=(0,o.v9)((function(e){return e.healthInfo.message})),j=(0,o.v9)((function(e){return e.system.serverDiagnosticStatus})),S=(0,s.useState)(!1),Z=(0,r.Z)(S,2),C=Z[0],I=Z[1],k=(0,s.useState)(!0),D=(0,r.Z)(k,2),E=D[0],N=D[1],_=(0,s.useState)(""),R=(0,r.Z)(_,2),A=R[0],O=R[1],H=(0,s.useState)("Start Diagnostic"),z=(0,r.Z)(H,2),F=z[0],L=z[1],T=(0,s.useState)("New Diagnostic"),B=(0,r.Z)(T,2),P=B[0],K=B[1],U=(0,s.useState)(""),M=(0,r.Z)(U,2),Y=M[0],W=M[1],X=(0,s.useState)(""),G=(0,r.Z)(X,2),V=G[0],J=G[1],q=(0,p.Yc)();(0,s.useEffect)((function(){return j===u?(K("Diagnostic in progress..."),void O("Diagnostic started. Please do not refresh page during diagnosis.")):j===d?(K("Diagnostic complete"),O("Diagnostic file is ready to be downloaded."),void L("Start New Diagnostic")):j===a?(K("Error"),O("An error occurred while getting the Diagnostic file."),void L("Retry Diagnostic")):void 0}),[j,C]),(0,s.useEffect)((function(){j===d&&n!=={}&&N(!1),j===u&&N(!0),I(!1)}),[j,n]),(0,s.useEffect)((function(){if(C){e((0,g.Xp)()),W("");var t=new URL(window.location.toString()),n=t.port,r=(0,f.x2)(t.protocol),s=new URL(document.baseURI).pathname,o=new i.w3cwebsocket("".concat(r,"://").concat(t.hostname,":").concat(n).concat(s,"ws/health-info?deadline=1h")),l=null;null!==o&&(o.onopen=function(){console.log("WebSocket Client Connected"),o.send("ok"),l=setInterval((function(){o.send("ok")}),1e4),O("Diagnostic started. Please do not refresh page during diagnosis."),e((0,h.KY)(u))},o.onmessage=function(t){var n=JSON.parse(t.data.toString());n.serverHealthInfo&&(n.serverHealthInfo.timestamp=new Date(n.serverHealthInfo.timestamp.toString()),e((0,g.ec)(n.serverHealthInfo))),""!==n.encoded&&W(n.encoded),n.subnetResponse&&J(n.subnetResponse)},o.onerror=function(t){console.log("error closing websocket:",t.message),o.close(1e3),clearInterval(l),e((0,h.KY)(a))},o.onclose=function(t){clearInterval(l),t.code===f.HE||t.code===f.ci||t.code===f.V9?(console.log("connection closed by server with code:",t.code),O("An error occurred while getting the Diagnostic file."),e((0,h.KY)(a))):(console.log("connection closed by server"),O("Diagnostic file is ready to be downloaded."),e((0,h.KY)(d)))})}else I(!1)}),[C,e]);return(0,s.useEffect)((function(){e((0,h.Sc)("health_info"))}),[e]),(0,m.jsxs)(s.Fragment,{children:[(0,m.jsx)(v.Z,{label:"Health",actions:(0,m.jsx)(y.Z,{})}),(0,m.jsxs)(c.Xgh,{children:[!q&&(0,m.jsx)(w.Z,{compactMode:!0}),(0,m.jsx)(c.xuv,{withBorders:!0,children:(0,m.jsx)(b,{title:P,children:(0,m.jsx)(c.rjZ,{container:!0,sx:{justifyContent:"flex-start",gap:20},children:(0,m.jsxs)(c.rjZ,{item:!0,xs:12,sx:{textAlign:"center",marginBottom:25},children:[(0,m.jsx)("h2",{children:A}),(0,m.jsxs)(c.xuv,{sx:{textAlign:"center",marginBottom:25},children:[" ",""!==V&&!V.toLowerCase().includes("error")&&(0,m.jsxs)(c.rjZ,{item:!0,xs:12,children:[(0,m.jsx)("strong",{children:"Health report uploaded to Subnet successfully!"}),"\xa0"," ",(0,m.jsxs)("strong",{children:["See the results on your"," ",(0,m.jsx)("a",{href:V,children:"Subnet Dashboard"})," "]})]}),(""===V||V.toLowerCase().includes("error"))&&j===d&&(0,m.jsxs)(c.rjZ,{item:!0,xs:12,children:[(0,m.jsx)("strong",{children:"Something went wrong uploading your Health report to Subnet."}),"\xa0"," ",(0,m.jsxs)("strong",{children:["Log into your"," ",(0,m.jsx)("a",{href:"https://subnet.min.io",children:"Subnet Account"})," to manually upload your Health report."]})]})]}),j===u?(0,m.jsx)(c.xuv,{sx:{paddingTop:8,paddingLeft:40},children:(0,m.jsx)(c.aNw,{style:{width:25,height:25}})}):(0,m.jsx)(s.Fragment,{children:(0,m.jsxs)(c.xuv,{sx:{display:"flex",gap:10,alignItems:"center",justifyContent:"center"},children:[(0,m.jsx)(c.xuv,{children:j!==a&&!E&&(0,m.jsx)(c.zxk,{id:"download",type:"submit",variant:"callAction",onClick:function(){return function(){var e=document.createElement("a");e.setAttribute("href","data:application/gzip;base64,".concat(Y)),e.setAttribute("download","diagnostic.json.gz"),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}()},disabled:E,label:"Download"})}),(0,m.jsx)(c.xuv,{children:(0,m.jsx)(c.zxk,{id:"start-new-diagnostic",type:"submit",variant:q?"callAction":"regular",disabled:C,onClick:function(){q?I(!0):t("/support/register")},label:F})})]})})]},"start-download")})})}),!C&&q&&(0,m.jsxs)(s.Fragment,{children:[(0,m.jsx)("br",{}),(0,m.jsx)(c.KfX,{title:"Cluster Health Report will be uploaded to Subnet, and is viewable from your Subnet Diagnostics dashboard.",iconComponent:(0,m.jsx)(c.szr,{}),help:"If the Health report cannot be generated at this time, please wait a moment and try again."})]})]})]})}},31460:function(e,t,n){"use strict";var r=n(72791),s=n(57689),i=n(64554),o=n(29945),l=n(80184);t.Z=function(e){var t=e.compactMode,n=void 0!==t&&t,c=(0,s.s0)(),a=(0,l.jsx)(o.zxk,{id:"go-to-register",type:"submit",variant:"callAction",color:"primary",onClick:function(){return c("/support/register")},children:"Register your Cluster"}),d="Use your MinIO Subscription Network login credentials to register this cluster.";return n?(0,l.jsxs)(r.Fragment,{children:[(0,l.jsx)(o.rjZ,{sx:{"& div.leftItems":{marginBottom:0}},children:(0,l.jsx)(o.KfX,{title:(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexGrow:1},children:[(0,l.jsx)("span",{children:d})," ",a]}),iconComponent:(0,l.jsx)(o.e6P,{}),help:null})}),(0,l.jsx)("br",{})]}):(0,l.jsx)(i.Z,{sx:{padding:"25px",border:"1px solid #eaeaea",display:"flex",alignItems:"center",justifyContent:"center",flexFlow:{sm:"row",xs:"column"},marginBottom:"15px"},children:(0,l.jsxs)(o.rjZ,{container:!0,children:[(0,l.jsx)(o.rjZ,{item:!0,xs:12,children:(0,l.jsx)(i.Z,{sx:{marginRight:"8px",fontSize:"16px",fontWeight:600,display:"flex",alignItems:"center","& .min-icon":{width:"83px",height:"14px",marginLeft:"5px",marginRight:"5px"}},children:"Register your cluster"})}),(0,l.jsx)(o.rjZ,{item:!0,xs:12,children:(0,l.jsx)(i.Z,{sx:{display:"flex",flexFlow:{xs:"column",md:"row"}},children:(0,l.jsxs)(i.Z,{sx:{display:"flex",flexFlow:"column",flex:"2"},children:[(0,l.jsx)(i.Z,{sx:{fontSize:"16px",display:"flex",flexFlow:"column",marginTop:"15px",marginBottom:"15px"},children:d}),(0,l.jsx)(i.Z,{sx:{flex:"1"},children:(0,l.jsx)(i.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:a})})]})})})]})})}},26824:function(e,t,n){"use strict";n.d(t,{HE:function(){return i},V9:function(){return r},ci:function(){return s},x2:function(){return o}});var r=1006,s=1008,i=1011,o=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__}}()},95087:function(e,t,n){var r;if("object"===typeof globalThis)r=globalThis;else try{r=n(94210)}catch(l){}finally{if(r||"undefined"===typeof window||(r=window),!r)throw new Error("Could not determine global this")}var s=r.WebSocket||r.MozWebSocket,i=n(51496);function o(e,t){return t?new s(e,t):new s(e)}s&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(o,e,{get:function(){return s[e]}})})),e.exports={w3cwebsocket:s?o:null,version:i}},51496:function(e,t,n){e.exports=n(19794).version},19794:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=5088.8ed4fd39.chunk.js.map