mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
2 lines
3.8 KiB
JavaScript
2 lines
3.8 KiB
JavaScript
(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[483],{70483:function(e,t,n){"use strict";n.r(t);var o=n(93433),i=n(29439),l=n(72791),r=n(95087),c=n(29945),a=n(26824),u=n(57689),s=n(9478),f=n(81551),p=n(87995),b=n(31460),d=n(47974),h=n(99670),g=n(80184),w=null;t.default=function(){var e=(0,u.s0)(),t=(0,l.useState)(!1),n=(0,i.Z)(t,2),x=n[0],v=n[1],m=(0,l.useState)(["cpu","mem","block","mutex","goroutines"]),y=(0,i.Z)(m,2),j=y[0],k=y[1],_=(0,s.Yc)(),C=function(e){var t=[];t=j.indexOf(e.target.value)>-1?j.filter((function(t){return t!==e.target.value})):[].concat((0,o.Z)(j),[e.target.value]),k(t)},O=(0,f.TL)();return(0,l.useEffect)((function(){O((0,p.Sc)("profile"))}),[]),(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(d.Z,{label:"Profile",actions:(0,g.jsx)(h.Z,{})}),(0,g.jsxs)(c.Xgh,{children:[!_&&(0,g.jsx)(b.Z,{compactMode:!0}),(0,g.jsxs)(c.ltY,{children:[(0,g.jsxs)(c.xuv,{sx:{display:"flex",gap:10,"& div":{width:"initial"},"& .inputItem:not(:last-of-type)":{marginBottom:0}},children:[(0,g.jsx)(c.AZs,{noMinWidth:!0,children:"Types to profile:"}),[{label:"cpu",value:"cpu"},{label:"mem",value:"mem"},{label:"block",value:"block"},{label:"mutex",value:"mutex"},{label:"goroutines",value:"goroutines"}].map((function(e){return(0,g.jsx)(c.XZJ,{checked:j.indexOf(e.value)>-1,disabled:x,id:"checkbox-".concat(e.label),label:e.label,name:"checkbox-".concat(e.label),onChange:C,value:e.value},"checkbox-".concat(e.label))}))]}),(0,g.jsxs)(c.xuv,{sx:{display:"flex",justifyContent:"flex-end",marginTop:24,gap:10},children:[(0,g.jsx)(c.zxk,{id:"start-profiling",type:"submit",variant:_?"callAction":"regular",disabled:x||j.length<1,onClick:function(){_?function(){var e=j.join(","),t=new URL(window.location.toString()),n=t.port,o=new URL(document.baseURI).pathname,i=(0,a.x2)(t.protocol);if(null!==(w=new r.w3cwebsocket("".concat(i,"://").concat(t.hostname,":").concat(n).concat(o,"ws/profile?types=").concat(e))))w.onopen=function(){v(!0),w.send("ok")},w.onmessage=function(e){var t=new Blob([e.data],{type:"application/zip"});v(!1);var n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download="profile.zip",document.body.appendChild(n),n.click(),document.body.removeChild(n)},w.onclose=function(){console.log("connection closed by server"),v(!1)}}():e("/support/register")},label:"Start Profiling"}),(0,g.jsx)(c.zxk,{id:"stop-profiling",type:"submit",variant:"callAction",color:"primary",disabled:!x,onClick:function(){w.close(1e3),v(!1)},label:"Stop Profiling"})]})]})]})]})}},26824:function(e,t,n){"use strict";n.d(t,{HE:function(){return l},V9:function(){return o},ci:function(){return i},x2:function(){return r}});var o=1006,i=1008,l=1011,r=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 o;if("object"===typeof globalThis)o=globalThis;else try{o=n(94210)}catch(c){}finally{if(o||"undefined"===typeof window||(o=window),!o)throw new Error("Could not determine global this")}var i=o.WebSocket||o.MozWebSocket,l=n(51496);function r(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(r,e,{get:function(){return i[e]}})})),e.exports={w3cwebsocket:i?r:null,version:l}},51496:function(e,t,n){e.exports=n(19794).version},19794:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
|
|
//# sourceMappingURL=483.f00aef93.chunk.js.map
|