mirror of
https://github.com/OpenMaxIO/openmaxio-object-browser
synced 2026-07-01 07:41:18 -07:00
2 lines
7.7 KiB
JavaScript
2 lines
7.7 KiB
JavaScript
(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3132],{93132:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f});var l=a(69060),n=a(39427),o=a(19536),s=a(47600),c=a(66152),r=a(66156),i=a(61060),d=a(55707),h=a(12608),u=a(95705),x=a(84612),p=a(3428),b=a(48504),g=a(82496),m=null;const f=()=>{const e=(0,r.Ab)(),t=(0,o.w1)((e=>e.trace.messages)),a=(0,o.w1)((e=>e.trace.traceStarted)),[f,w]=(0,l.useState)(""),[y,v]=(0,l.useState)(""),[j,S]=(0,l.useState)(""),[k,C]=(0,l.useState)(""),[_,N]=(0,l.useState)(0),[T,F]=(0,l.useState)(!1),[O,I]=(0,l.useState)(!0),[q,E]=(0,l.useState)(!1),[L,W]=(0,l.useState)(!1),[K,U]=(0,l.useState)(!1),[M,z]=(0,l.useState)(!1),[D,R]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{e((0,u.i8)("trace"))}),[]),(0,g.jsxs)(l.Fragment,{children:[(0,g.jsx)(p.c,{label:"Trace",actions:(0,g.jsx)(b.c,{})}),(0,g.jsx)(c._al,{children:(0,g.jsx)(c.kvh,{withBorders:!0,children:(0,g.jsxs)(c.yeN,{container:!0,children:[(0,g.jsxs)(c.yeN,{item:!0,xs:12,sx:{display:"flex",flexFlow:"column","& .trace-Checkbox-label":{fontSize:"14px",fontWeight:"normal"}},children:[(0,g.jsx)(c.kvh,{sx:{fontSize:"16px",fontWeight:600,padding:"20px 0px 20px 0"},children:"Calls to Trace"}),(0,g.jsxs)(c.kvh,{className:"".concat(a?"inactive-state":""),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,g.jsxs)(c.kvh,{sx:{display:"flex",flexFlow:"row","& .trace-checked-icon":{border:"1px solid red"},["@media (min-width: ".concat(c.WQo.md,"px)")]:{gap:30}},children:[(0,g.jsx)(c.ywS,{checked:T,id:"all_calls",name:"all_calls",label:"All",onChange:()=>{F(!T)},value:"all",disabled:a}),(0,g.jsx)(c.ywS,{checked:O||T,id:"s3_calls",name:"s3_calls",label:"S3",onChange:()=>{I(!O)},value:"s3",disabled:T||a}),(0,g.jsx)(c.ywS,{checked:q||T,id:"internal_calls",name:"internal_calls",label:"Internal",onChange:()=>{E(!q)},value:"internal",disabled:T||a}),(0,g.jsx)(c.ywS,{checked:L||T,id:"storage_calls",name:"storage_calls",label:"Storage",onChange:()=>{W(!L)},value:"storage",disabled:T||a}),(0,g.jsx)(c.ywS,{checked:K||T,id:"os_calls",name:"os_calls",label:"OS",onChange:()=>{U(!K)},value:"os",disabled:T||a})]}),(0,g.jsxs)(c.kvh,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"15px"},children:[(0,g.jsx)(x.c,{tooltip:"More filter options",children:(0,g.jsx)(c.qaq,{id:"filter-toggle",onClick:()=>{R(!D)},label:"Filters",icon:(0,g.jsx)(c.yUv,{}),variant:"regular",className:"filters-toggle-button",style:{width:"118px",background:D?"rgba(8, 28, 66, 0.04)":""}})}),!a&&(0,g.jsx)(c.qaq,{id:"start-trace",label:"Start","data-test-id":"trace-start-button",variant:"callAction",onClick:()=>{e((0,h.us)());const t=new URL(window.location.toString()),a=t.port;let l="".concat(O?"s3,":"").concat(q?"internal,":"").concat(L?"storage,":"").concat(K?"os,":"");T&&(l="all");const o=new URL(document.baseURI).pathname,c=(0,d.K_)(t.protocol);m=new s.w3cwebsocket("".concat(c,"://").concat(t.hostname,":").concat(a).concat(o,"ws/trace?calls=").concat(l,"&threshold=").concat(_,"&onlyErrors=").concat(M?"yes":"no","&statusCode=").concat(f,"&method=").concat(y,"&funcname=").concat(j,"&path=").concat(k));let r=null;if(null!==m)return m.onopen=()=>{console.log("WebSocket Client Connected"),e((0,h.sh)(!0)),m.send("ok"),r=setInterval((()=>{m.send("ok")}),1e4)},m.onmessage=t=>{let a=JSON.parse(t.data.toString());a.ptime=n.CS.fromISO(a.time).toJSDate(),a.key=Math.random(),e((0,h.Ez)(a))},m.onclose=()=>{clearInterval(r),console.log("connection closed by server"),e((0,h.sh)(!1))},()=>{m.close(1e3),clearInterval(r),console.log("closing websockets"),(0,h.sh)(!1)}},style:{width:"118px"}}),a&&(0,g.jsx)(c.qaq,{id:"stop-trace",label:"Stop Trace","data-test-id":"trace-stop-button",variant:"callAction",onClick:()=>{m.close(1e3),e((0,h.sh)(!1))},style:{width:"118px"}})]})]})]}),D?(0,g.jsxs)(c.kvh,{useBackground:!0,className:"".concat(a?"inactive-state":""),sx:{marginTop:"25px",display:"flex",flexFlow:"column",padding:"30px",width:"100%","& .orient-vertical":{flexFlow:"column","& label":{marginBottom:"10px",fontWeight:600},"& .inputRebase":{width:"90%"}},"& .trace-Checkbox-label":{fontSize:"14px",fontWeight:"normal"}},children:[(0,g.jsxs)(c.kvh,{sx:{display:"flex"},children:[(0,g.jsx)(c.q22,{className:"orient-vertical",id:"trace-status-code",name:"trace-status-code",label:"Status Code",placeholder:"e.g. 503",value:f,onChange:e=>{w(e.target.value)},disabled:a}),(0,g.jsx)(c.q22,{className:"orient-vertical",id:"trace-function-name",name:"trace-function-name",label:"Function Name",placeholder:"e.g. FunctionName2055",value:j,onChange:e=>{S(e.target.value)},disabled:a}),(0,g.jsx)(c.q22,{className:"orient-vertical",id:"trace-method",name:"trace-method",label:"Method",placeholder:"e.g. Method 2056",value:y,onChange:e=>{v(e.target.value)},disabled:a})]}),(0,g.jsxs)(c.kvh,{sx:{gap:"30px",display:"grid",gridTemplateColumns:"2fr 1fr",width:"100%",marginTop:"33px"},children:[(0,g.jsx)(c.kvh,{sx:{flex:2,width:"calc( 100% + 10px)"},children:(0,g.jsx)(c.q22,{className:"orient-vertical",id:"trace-path",name:"trace-path",label:"Path",placeholder:"e.g. my-bucket/my-prefix/*",value:k,onChange:e=>{C(e.target.value)},disabled:a})}),(0,g.jsx)(c.kvh,{sx:{marginLeft:"15px"},children:(0,g.jsx)(c.q22,{className:"orient-vertical",id:"trace-fthreshold",name:"trace-fthreshold",label:"Response Threshold",type:"number",placeholder:"e.g. website.io.3249.114.12",value:"".concat(_),onChange:e=>{N(parseInt(e.target.value))},disabled:a})})]}),(0,g.jsx)(c.kvh,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",marginTop:"40px"},children:(0,g.jsx)(c.ywS,{checked:M,id:"only_errors",name:"only_errors",label:"Display only Errors",onChange:()=>{z(!M)},value:"only_errors",disabled:a})})]}):null,(0,g.jsx)(c.yeN,{item:!0,xs:12,children:(0,g.jsx)(c.kvh,{sx:{fontSize:"16px",fontWeight:600,marginBottom:"30px",marginTop:"30px"},children:"Trace Results"})}),(0,g.jsx)(c.yeN,{item:!0,xs:12,children:(0,g.jsx)(c.iSL,{columns:[{label:"Time",elementKey:"ptime",renderFunction:e=>{const t=new Date(e);return(0,i.gD)(t)},width:100},{label:"Name",elementKey:"api"},{label:"Status",elementKey:"",renderFunction:e=>"".concat(e.statusCode," ").concat(e.statusMsg),renderFullObject:!0},{label:"Location",elementKey:"configuration_id",renderFunction:e=>"".concat(e.host," ").concat(e.client),renderFullObject:!0},{label:"Load Time",elementKey:"callStats.duration",width:150},{label:"Upload",elementKey:"callStats.rx",renderFunction:i.U7,width:150},{label:"Download",elementKey:"callStats.tx",renderFunction:i.U7,width:150}],isLoading:!1,records:t,entityName:"Traces",idField:"api",customEmptyMessage:a?"No Traced elements received yet":"Trace is not started yet",customPaperHeight:"calc(100vh - 292px)",autoScrollToBottom:!0})})]})})})]})}},7504: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__}}()},47600:(e,t,a)=>{var l;if("object"===typeof globalThis)l=globalThis;else try{l=a(7504)}catch(c){}finally{if(l||"undefined"===typeof window||(l=window),!l)throw new Error("Could not determine global this")}var n=l.WebSocket||l.MozWebSocket,o=a(3068);function s(e,t){return t?new n(e,t):new n(e)}n&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(s,e,{get:function(){return n[e]}})})),e.exports={w3cwebsocket:n?s:null,version:o}},3068:(e,t,a)=>{e.exports=a(40648).version},40648:e=>{"use strict";e.exports={version:"1.0.34"}}}]);
|
|
//# sourceMappingURL=3132.68faa431.chunk.js.map
|