Files
openmaxio-object-browser/portal-ui/build/static/js/9121.c6510250.chunk.js
2023-08-16 10:03:02 -07:00

2 lines
8.5 KiB
JavaScript

(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9121],{59121:function(e,t,n){"use strict";n.r(t);var a=n(4942),l=n(29439),o=n(72791),c=n(99779),r=n(78687),s=n(95087),i=n(29945),u=n(81551),d=n(45248),x=n(26824),f=n(5172),h=n(87995),p=n(27454),g=n(47974),m=n(99670),b=n(80184),v=null;t.default=function(){var e=(0,u.TL)(),t=(0,r.v9)((function(e){return e.trace.messages})),n=(0,r.v9)((function(e){return e.trace.traceStarted})),j=(0,o.useState)(""),w=(0,l.Z)(j,2),y=w[0],S=w[1],k=(0,o.useState)(""),C=(0,l.Z)(k,2),_=C[0],Z=C[1],T=(0,o.useState)(""),N=(0,l.Z)(T,2),F=N[0],z=N[1],O=(0,o.useState)(""),W=(0,l.Z)(O,2),E=W[0],I=W[1],L=(0,o.useState)(0),J=(0,l.Z)(L,2),K=J[0],M=J[1],X=(0,o.useState)(!1),R=(0,l.Z)(X,2),B=R[0],D=R[1],P=(0,o.useState)(!0),U=(0,l.Z)(P,2),q=U[0],A=U[1],G=(0,o.useState)(!1),H=(0,l.Z)(G,2),Q=H[0],V=H[1],Y=(0,o.useState)(!1),$=(0,l.Z)(Y,2),ee=$[0],te=$[1],ne=(0,o.useState)(!1),ae=(0,l.Z)(ne,2),le=ae[0],oe=ae[1],ce=(0,o.useState)(!1),re=(0,l.Z)(ce,2),se=re[0],ie=re[1],ue=(0,o.useState)(!1),de=(0,l.Z)(ue,2),xe=de[0],fe=de[1];return(0,o.useEffect)((function(){e((0,h.Sc)("trace"))}),[]),(0,b.jsxs)(o.Fragment,{children:[(0,b.jsx)(g.Z,{label:"Trace",actions:(0,b.jsx)(m.Z,{})}),(0,b.jsx)(i.Xgh,{children:(0,b.jsx)(i.xuv,{withBorders:!0,children:(0,b.jsxs)(i.rjZ,{container:!0,children:[(0,b.jsxs)(i.rjZ,{item:!0,xs:12,sx:{display:"flex",flexFlow:"column","& .trace-Checkbox-label":{fontSize:"14px",fontWeight:"normal"}},children:[(0,b.jsx)(i.xuv,{sx:{fontSize:"16px",fontWeight:600,padding:"20px 0px 20px 0"},children:"Calls to Trace"}),(0,b.jsxs)(i.xuv,{className:"".concat(n?"inactive-state":""),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,b.jsxs)(i.xuv,{sx:(0,a.Z)({display:"flex",flexFlow:"row","& .trace-checked-icon":{border:"1px solid red"}},"@media (min-width: ".concat(i.Egj.md,"px)"),{gap:30}),children:[(0,b.jsx)(i.XZJ,{checked:B,id:"all_calls",name:"all_calls",label:"All",onChange:function(){D(!B)},value:"all",disabled:n}),(0,b.jsx)(i.XZJ,{checked:q||B,id:"s3_calls",name:"s3_calls",label:"S3",onChange:function(){A(!q)},value:"s3",disabled:B||n}),(0,b.jsx)(i.XZJ,{checked:Q||B,id:"internal_calls",name:"internal_calls",label:"Internal",onChange:function(){V(!Q)},value:"internal",disabled:B||n}),(0,b.jsx)(i.XZJ,{checked:ee||B,id:"storage_calls",name:"storage_calls",label:"Storage",onChange:function(){te(!ee)},value:"storage",disabled:B||n}),(0,b.jsx)(i.XZJ,{checked:le||B,id:"os_calls",name:"os_calls",label:"OS",onChange:function(){oe(!le)},value:"os",disabled:B||n})]}),(0,b.jsxs)(i.xuv,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"15px"},children:[(0,b.jsx)(p.Z,{tooltip:"More filter options",children:(0,b.jsx)(i.zxk,{id:"filter-toggle",onClick:function(){fe(!xe)},label:"Filters",icon:(0,b.jsx)(i.k1n,{}),variant:"regular",className:"filters-toggle-button",style:{width:"118px",background:xe?"rgba(8, 28, 66, 0.04)":""}})}),!n&&(0,b.jsx)(i.zxk,{id:"start-trace",label:"Start","data-test-id":"trace-start-button",variant:"callAction",onClick:function(){e((0,f.At)());var t=new URL(window.location.toString()),n=t.port,a="".concat(q?"s3,":"").concat(Q?"internal,":"").concat(ee?"storage,":"").concat(le?"os,":"");B&&(a="all");var l=new URL(document.baseURI).pathname,o=(0,x.x2)(t.protocol);v=new s.w3cwebsocket("".concat(o,"://").concat(t.hostname,":").concat(n).concat(l,"ws/trace?calls=").concat(a,"&threshold=").concat(K,"&onlyErrors=").concat(se?"yes":"no","&statusCode=").concat(y,"&method=").concat(_,"&funcname=").concat(F,"&path=").concat(E));var r=null;if(null!==v)return v.onopen=function(){console.log("WebSocket Client Connected"),e((0,f.qv)(!0)),v.send("ok"),r=setInterval((function(){v.send("ok")}),1e4)},v.onmessage=function(t){var n=JSON.parse(t.data.toString());n.ptime=c.ou.fromISO(n.time).toJSDate(),n.key=Math.random(),e((0,f.ho)(n))},v.onclose=function(){clearInterval(r),console.log("connection closed by server"),e((0,f.qv)(!1))},function(){v.close(1e3),clearInterval(r),console.log("closing websockets"),(0,f.qv)(!1)}},style:{width:"118px"}}),n&&(0,b.jsx)(i.zxk,{id:"stop-trace",label:"Stop Trace","data-test-id":"trace-stop-button",variant:"callAction",onClick:function(){v.close(1e3),e((0,f.qv)(!1))},style:{width:"118px"}})]})]})]}),xe?(0,b.jsxs)(i.xuv,{useBackground:!0,className:"".concat(n?"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,b.jsxs)(i.xuv,{sx:{display:"flex"},children:[(0,b.jsx)(i.Wzg,{className:"orient-vertical",id:"trace-status-code",name:"trace-status-code",label:"Status Code",placeholder:"e.g. 503",value:y,onChange:function(e){S(e.target.value)},disabled:n}),(0,b.jsx)(i.Wzg,{className:"orient-vertical",id:"trace-function-name",name:"trace-function-name",label:"Function Name",placeholder:"e.g. FunctionName2055",value:F,onChange:function(e){z(e.target.value)},disabled:n}),(0,b.jsx)(i.Wzg,{className:"orient-vertical",id:"trace-method",name:"trace-method",label:"Method",placeholder:"e.g. Method 2056",value:_,onChange:function(e){Z(e.target.value)},disabled:n})]}),(0,b.jsxs)(i.xuv,{sx:{gap:"30px",display:"grid",gridTemplateColumns:"2fr 1fr",width:"100%",marginTop:"33px"},children:[(0,b.jsx)(i.xuv,{sx:{flex:2,width:"calc( 100% + 10px)"},children:(0,b.jsx)(i.Wzg,{className:"orient-vertical",id:"trace-path",name:"trace-path",label:"Path",placeholder:"e.g. my-bucket/my-prefix/*",value:E,onChange:function(e){I(e.target.value)},disabled:n})}),(0,b.jsx)(i.xuv,{sx:{marginLeft:"15px"},children:(0,b.jsx)(i.Wzg,{className:"orient-vertical",id:"trace-fthreshold",name:"trace-fthreshold",label:"Response Threshold",type:"number",placeholder:"e.g. website.io.3249.114.12",value:"".concat(K),onChange:function(e){M(parseInt(e.target.value))},disabled:n})})]}),(0,b.jsx)(i.xuv,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",marginTop:"40px"},children:(0,b.jsx)(i.XZJ,{checked:se,id:"only_errors",name:"only_errors",label:"Display only Errors",onChange:function(){ie(!se)},value:"only_errors",disabled:n})})]}):null,(0,b.jsx)(i.rjZ,{item:!0,xs:12,children:(0,b.jsx)(i.xuv,{sx:{fontSize:"16px",fontWeight:600,marginBottom:"30px",marginTop:"30px"},children:"Trace Results"})}),(0,b.jsx)(i.rjZ,{item:!0,xs:12,children:(0,b.jsx)(i.wQF,{columns:[{label:"Time",elementKey:"ptime",renderFunction:function(e){var t=new Date(e);return(0,d.zk)(t)},width:100},{label:"Name",elementKey:"api"},{label:"Status",elementKey:"",renderFunction:function(e){return"".concat(e.statusCode," ").concat(e.statusMsg)},renderFullObject:!0},{label:"Location",elementKey:"configuration_id",renderFunction:function(e){return"".concat(e.host," ").concat(e.client)},renderFullObject:!0},{label:"Load Time",elementKey:"callStats.duration",width:150},{label:"Upload",elementKey:"callStats.rx",renderFunction:d.ae,width:150},{label:"Download",elementKey:"callStats.tx",renderFunction:d.ae,width:150}],isLoading:!1,records:t,entityName:"Traces",idField:"api",customEmptyMessage:n?"No Traced elements received yet":"Trace is not started yet",customPaperHeight:"calc(100vh - 292px)",autoScrollToBottom:!0})})]})})})]})}},26824:function(e,t,n){"use strict";n.d(t,{HE:function(){return o},V9:function(){return a},ci:function(){return l},x2:function(){return c}});var a=1006,l=1008,o=1011,c=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 a;if("object"===typeof globalThis)a=globalThis;else try{a=n(94210)}catch(r){}finally{if(a||"undefined"===typeof window||(a=window),!a)throw new Error("Could not determine global this")}var l=a.WebSocket||a.MozWebSocket,o=n(51496);function c(e,t){return t?new l(e,t):new l(e)}l&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(c,e,{get:function(){return l[e]}})})),e.exports={w3cwebsocket:l?c:null,version:o}},51496:function(e,t,n){e.exports=n(19794).version},19794:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=9121.c6510250.chunk.js.map