github.com/minio/console@v1.3.0/web-app/build/static/js/843.8502a4fd.chunk.js (about) 1 "use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[843],{30843:(e,a,t)=>{t.r(a),t.d(a,{default:()=>b});var l=t(65043),n=t(24241),s=t(22166),c=t(89923),o=t(20554),r=t(56483),i=t(32511),d=t(65259),x=t(64159),h=t(6681),p=t(48793),u=t(92452),m=t(70579),g=null;const b=()=>{const e=(0,o.jL)(),a=(0,s.d4)((e=>e.trace.messages)),t=(0,s.d4)((e=>e.trace.traceStarted)),[b,f]=(0,l.useState)(""),[j,S]=(0,l.useState)(""),[y,w]=(0,l.useState)(""),[v,C]=(0,l.useState)(""),[k,_]=(0,l.useState)(0),[z,F]=(0,l.useState)(!1),[T,J]=(0,l.useState)(!0),[N,I]=(0,l.useState)(!1),[A,K]=(0,l.useState)(!1),[L,M]=(0,l.useState)(!1),[O,W]=(0,l.useState)(!1),[R,B]=(0,l.useState)(!1);return(0,l.useEffect)((()=>{e((0,x.ph)("trace"))}),[]),(0,m.jsxs)(l.Fragment,{children:[(0,m.jsx)(p.A,{label:"Trace",actions:(0,m.jsx)(u.A,{})}),(0,m.jsx)(c.Mxu,{children:(0,m.jsx)(c.azJ,{withBorders:!0,children:(0,m.jsxs)(c.xA9,{container:!0,children:[(0,m.jsxs)(c.xA9,{item:!0,xs:12,sx:{display:"flex",flexFlow:"column","& .trace-Checkbox-label":{fontSize:"14px",fontWeight:"normal"}},children:[(0,m.jsx)(c.azJ,{sx:{fontSize:"16px",fontWeight:600,padding:"20px 0px 20px 0"},children:"Calls to Trace"}),(0,m.jsxs)(c.azJ,{className:"".concat(t?"inactive-state":""),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,m.jsxs)(c.azJ,{sx:{display:"flex",flexFlow:"row","& .trace-checked-icon":{border:"1px solid red"},["@media (min-width: ".concat(c.nmC.md,"px)")]:{gap:30}},children:[(0,m.jsx)(c.Sc0,{checked:z,id:"all_calls",name:"all_calls",label:"All",onChange:()=>{F(!z)},value:"all",disabled:t}),(0,m.jsx)(c.Sc0,{checked:T||z,id:"s3_calls",name:"s3_calls",label:"S3",onChange:()=>{J(!T)},value:"s3",disabled:z||t}),(0,m.jsx)(c.Sc0,{checked:N||z,id:"internal_calls",name:"internal_calls",label:"Internal",onChange:()=>{I(!N)},value:"internal",disabled:z||t}),(0,m.jsx)(c.Sc0,{checked:A||z,id:"storage_calls",name:"storage_calls",label:"Storage",onChange:()=>{K(!A)},value:"storage",disabled:z||t}),(0,m.jsx)(c.Sc0,{checked:L||z,id:"os_calls",name:"os_calls",label:"OS",onChange:()=>{M(!L)},value:"os",disabled:z||t})]}),(0,m.jsxs)(c.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"15px"},children:[(0,m.jsx)(h.A,{tooltip:"More filter options",children:(0,m.jsx)(c.$nd,{id:"filter-toggle",onClick:()=>{B(!R)},label:"Filters",icon:(0,m.jsx)(c.YGH,{}),variant:"regular",className:"filters-toggle-button",style:{width:"118px",background:R?"rgba(8, 28, 66, 0.04)":""}})}),!t&&(0,m.jsx)(c.$nd,{id:"start-trace",label:"Start","data-test-id":"trace-start-button",variant:"callAction",onClick:()=>{e((0,d.rZ)());const a=new URL(window.location.toString()),t=a.port;let l="".concat(T?"s3,":"").concat(N?"internal,":"").concat(A?"storage,":"").concat(L?"os,":"");z&&(l="all");const s=new URL(document.baseURI).pathname,c=(0,i.nw)(a.protocol);g=new WebSocket("".concat(c,"://").concat(a.hostname,":").concat(t).concat(s,"ws/trace?calls=").concat(l,"&threshold=").concat(k,"&onlyErrors=").concat(O?"yes":"no","&statusCode=").concat(b,"&method=").concat(j,"&funcname=").concat(y,"&path=").concat(v));let o=null;if(null!==g)return g.onopen=()=>{console.log("WebSocket Client Connected"),e((0,d.p)(!0)),g.send("ok"),o=setInterval((()=>{g.send("ok")}),1e4)},g.onmessage=a=>{let t=JSON.parse(a.data.toString());t.ptime=n.c9.fromISO(t.time).toJSDate(),t.key=Math.random(),e((0,d.cI)(t))},g.onclose=()=>{clearInterval(o),console.log("connection closed by server"),e((0,d.p)(!1))},()=>{g.close(1e3),clearInterval(o),console.log("closing websockets"),(0,d.p)(!1)}},style:{width:"118px"}}),t&&(0,m.jsx)(c.$nd,{id:"stop-trace",label:"Stop Trace","data-test-id":"trace-stop-button",variant:"callAction",onClick:()=>{g.close(1e3),e((0,d.p)(!1))},style:{width:"118px"}})]})]})]}),R?(0,m.jsxs)(c.azJ,{useBackground:!0,className:"".concat(t?"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,m.jsxs)(c.azJ,{sx:{display:"flex"},children:[(0,m.jsx)(c.cl_,{className:"orient-vertical",id:"trace-status-code",name:"trace-status-code",label:"Status Code",placeholder:"e.g. 503",value:b,onChange:e=>{f(e.target.value)},disabled:t}),(0,m.jsx)(c.cl_,{className:"orient-vertical",id:"trace-function-name",name:"trace-function-name",label:"Function Name",placeholder:"e.g. FunctionName2055",value:y,onChange:e=>{w(e.target.value)},disabled:t}),(0,m.jsx)(c.cl_,{className:"orient-vertical",id:"trace-method",name:"trace-method",label:"Method",placeholder:"e.g. Method 2056",value:j,onChange:e=>{S(e.target.value)},disabled:t})]}),(0,m.jsxs)(c.azJ,{sx:{gap:"30px",display:"grid",gridTemplateColumns:"2fr 1fr",width:"100%",marginTop:"33px"},children:[(0,m.jsx)(c.azJ,{sx:{flex:2,width:"calc( 100% + 10px)"},children:(0,m.jsx)(c.cl_,{className:"orient-vertical",id:"trace-path",name:"trace-path",label:"Path",placeholder:"e.g. my-bucket/my-prefix/*",value:v,onChange:e=>{C(e.target.value)},disabled:t})}),(0,m.jsx)(c.azJ,{sx:{marginLeft:"15px"},children:(0,m.jsx)(c.cl_,{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:e=>{_(parseInt(e.target.value))},disabled:t})})]}),(0,m.jsx)(c.azJ,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",marginTop:"40px"},children:(0,m.jsx)(c.Sc0,{checked:O,id:"only_errors",name:"only_errors",label:"Display only Errors",onChange:()=>{W(!O)},value:"only_errors",disabled:t})})]}):null,(0,m.jsx)(c.xA9,{item:!0,xs:12,children:(0,m.jsx)(c.azJ,{sx:{fontSize:"16px",fontWeight:600,marginBottom:"30px",marginTop:"30px"},children:"Trace Results"})}),(0,m.jsx)(c.xA9,{item:!0,xs:12,children:(0,m.jsx)(c.bQt,{columns:[{label:"Time",elementKey:"ptime",renderFunction:e=>{const a=new Date(e);return(0,r.cj)(a)},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:r.nO,width:150},{label:"Download",elementKey:"callStats.tx",renderFunction:r.nO,width:150}],isLoading:!1,records:a,entityName:"Traces",idField:"api",customEmptyMessage:t?"No Traced elements received yet":"Trace is not started yet",customPaperHeight:"calc(100vh - 292px)",autoScrollToBottom:!0})})]})})})]})}}}]); 2 //# sourceMappingURL=843.8502a4fd.chunk.js.map