Files
object-browser/portal-ui/build/static/js/1892.e7ffbb89.chunk.js
2023-07-06 10:32:39 -07:00

2 lines
17 KiB
JavaScript

(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1892],{98521:function(e,n,t){"use strict";t.r(n),t.d(n,{SelectStyled:function(){return $},default:function(){return ne}});var r=t(29439),i=t(1413),o=t(72791),s=t(95087),l=t(29945),a=t(11135),c=t(25787),d=t(78687),u=t(886),f=t(61889),h=t(68096),p=t(58406),g=t(77865),x=t(81207),m=t(81551),v=t(26824),y=t(23814),j=t(59114),Z=t(35527),w=t(79836),b=t(53382),S=t(87462),C=t(63366),E=t(28182),T=t(94419),A=t(31402),k=t(66934),F=t(75878),L=t(21217);function R(e){return(0,L.Z)("MuiTableContainer",e)}(0,F.Z)("MuiTableContainer",["root"]);var N=t(80184),z=["className","component"],M=(0,k.ZP)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:function(e,n){return n.root}})({width:"100%",overflowX:"auto"}),O=o.forwardRef((function(e,n){var t=(0,A.Z)({props:e,name:"MuiTableContainer"}),r=t.className,i=t.component,o=void 0===i?"div":i,s=(0,C.Z)(t,z),l=(0,S.Z)({},t,{component:o}),a=function(e){var n=e.classes;return(0,T.Z)({root:["root"]},R,n)}(l);return(0,N.jsx)(M,(0,S.Z)({ref:n,as:o,className:(0,E.Z)(a.root,r),ownerState:l},s))})),I=t(99779),_=t(35855),P=t(53994),D=t(56125),H=t(64554),U=t(20890),W=t(26181),B=t.n(W),X="HH:mm:ss ZZZZ MM/dd/yyyy",q=function(e){var n=e.log,t=(0,o.useState)(!1),i=(0,r.Z)(t,2),s=i[0],a=i[1],c=function(e){return B()(n,e,"")},d="",u=c("ConsoleMsg"),f=c("error.message");""!==u?d=u:""!==f&&(d=f);var h=(d||"").replace(/\u2501|\u250f|\u2513|\u2503|\u2517|\u251b/g,"");h=h.replace(/([^\x20-\x7F])/g,"");var p=(0,N.jsx)(o.Fragment,{});""!==u?p=function(e){var n=e.ConsoleMsg;return n=(n=n.replace(/\x1B/g," ")).replace(/((\[[0-9;]+m))/g,""),(0,N.jsx)("div",{style:{display:"table",tableLayout:"fixed",width:"100%",paddingLeft:10,paddingRight:10},children:(0,N.jsx)("div",{style:{display:"table-cell",whiteSpace:"nowrap",textOverflow:"ellipsis",overflowX:"auto"},children:(0,N.jsx)("pre",{children:n})})})}(n):""!==f&&(p=function(e){var n={color:"#C83B51",fontWeight:400,fontFamily:"monospace",fontSize:"12px"},t={fontFamily:"monospace",fontSize:"12px"},r=function(n){return B()(e,n,"")},i=I.ou.fromFormat(e.time.toString(),"HH:mm:ss z MM/dd/yyyy",{zone:"UTC"});return(0,N.jsxs)(o.Fragment,{children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"API:\xa0"}),(0,N.jsx)("span",{style:n,children:r("api.name")})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"Time:\xa0"}),(0,N.jsx)("span",{style:n,children:i.toFormat(X)})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"DeploymentID:\xa0"}),(0,N.jsx)("span",{style:n,children:r("deploymentid")})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"RequestID:\xa0"}),(0,N.jsx)("span",{style:n,children:r("requestID")})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"RemoteHost:\xa0"}),(0,N.jsx)("span",{style:n,children:r("remotehost")})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"UserAgent:\xa0"}),(0,N.jsx)("span",{style:n,children:r("userAgent")})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("b",{style:t,children:"Error:\xa0"}),(0,N.jsx)("span",{style:n,children:r("error.message")})]}),(0,N.jsx)("br",{}),(0,N.jsx)("div",{children:(0,N.jsx)("b",{style:t,children:"Backtrace:\xa0"})}),(e.error.source||[]).map((function(e,r){return(0,N.jsxs)("div",{children:[(0,N.jsxs)("b",{style:t,children:[r,":\xa0"]}),(0,N.jsx)("span",{style:n,children:e})]})}))]})}(n)),h=(h||"").replace(/((\[[0-9;]+m))/g,"");var g=I.ou.fromFormat(n.time.toString(),"HH:mm:ss z MM/dd/yyyy",{zone:"UTC"}),x=g.toJSDate(),m=(0,N.jsx)(o.Fragment,{children:g.toFormat(X)});return 1===x.getFullYear()&&(m=(0,N.jsx)(o.Fragment,{children:"n/a"})),(0,N.jsxs)(o.Fragment,{children:[(0,N.jsxs)(_.Z,{sx:{"& > *":{borderBottom:"unset"},cursor:"pointer",borderLeft:"0",borderRight:"0"},style:{backgroundColor:"#FDFDFD"},children:[(0,N.jsx)(P.Z,{onClick:function(){return a(!s)},style:{width:280,color:"#989898",fontSize:12},children:(0,N.jsxs)(H.Z,{sx:{display:"flex",gap:1,alignItems:"center","& .min-icon":{width:12,marginRight:1},fontWeight:"bold",lineHeight:1},children:[(0,N.jsx)(l.AeX,{}),(0,N.jsx)("div",{children:m})]})}),(0,N.jsx)(P.Z,{onClick:function(){return a(!s)},style:{width:200,color:"#989898",fontSize:12},children:(0,N.jsx)(H.Z,{sx:{"& .min-icon":{width:12,marginRight:1},fontWeight:"bold",lineHeight:1},children:n.errKind})}),(0,N.jsx)(P.Z,{onClick:function(){return a(!s)},children:(0,N.jsx)("div",{style:{display:"table",tableLayout:"fixed",width:"100%",paddingLeft:10,paddingRight:10},children:(0,N.jsx)("div",{style:{display:"table-cell",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},children:h})})}),(0,N.jsx)(P.Z,{onClick:function(){return a(!s)},style:{width:40},children:(0,N.jsx)(H.Z,{sx:{"& .min-icon":{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"2px"},"&:hover .min-icon":{fill:"#eaeaea"}},children:s?(0,N.jsx)(l.Ekf,{}):(0,N.jsx)(l._f_,{})})})]}),s?(0,N.jsxs)(_.Z,{children:[(0,N.jsx)(P.Z,{style:{paddingBottom:0,paddingTop:0,width:200,textTransform:"uppercase",verticalAlign:"top",textAlign:"right",color:"#8399AB",fontWeight:"bold"},children:(0,N.jsx)(D.Z,{in:s,timeout:"auto",unmountOnExit:!0,children:(0,N.jsx)("div",{style:{marginTop:10},children:"Log Details"})})}),(0,N.jsx)(P.Z,{colSpan:2,style:{paddingBottom:0,paddingTop:0},children:(0,N.jsx)(D.Z,{in:s,timeout:"auto",unmountOnExit:!0,children:(0,N.jsx)(H.Z,{sx:{margin:1},children:(0,N.jsx)(U.Z,{style:{background:"#efefef",border:"1px solid #dedede",padding:4,fontSize:14,color:"#666666"},children:p})})})}),(0,N.jsx)(P.Z,{style:{paddingBottom:0,paddingTop:0,width:40}})]}):null]},g.toString())},G=t(69129),J=t(72455),K=t(47974),V=t(99670),Q=t(87995),Y=(0,J.Z)((function(e){return(0,a.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({logList:{background:"#fff",minHeight:400,height:"calc(100vh - 200px)",overflow:"auto",fontSize:13,borderRadius:4},logerror_tab:{color:"#A52A2A",paddingLeft:25},nodeField:{width:"100%"}},y.OR),{},{actionsTray:(0,i.Z)((0,i.Z)({},y.OR.actionsTray),{},{marginBottom:0})},y.qg),y.IX),y.Bz))})),$=(0,c.Z)((function(e){return(0,a.Z)({root:{lineHeight:"50px","label + &":{marginTop:e.spacing(3)},"& .MuiSelect-select:focus":{backgroundColor:"transparent"}}})}))(u.ZP),ee=null,ne=function(){var e=(0,m.TL)(),n=Y(),t=(0,d.v9)((function(e){return e.logs.logMessages})),i=(0,d.v9)((function(e){return e.logs.logsStarted})),a=(0,o.useState)(""),c=(0,r.Z)(a,2),u=c[0],y=c[1],S=(0,o.useState)([""]),C=(0,r.Z)(S,2),E=C[0],T=C[1],A=(0,o.useState)("all"),k=(0,r.Z)(A,2),F=k[0],L=k[1],R=(0,o.useState)("Select user agent"),z=(0,r.Z)(R,2),M=z[0],I=z[1],_=(0,o.useState)(["All User Agents"]),P=(0,r.Z)(_,2),D=P[0],H=P[1],U=(0,o.useState)("all"),W=(0,r.Z)(U,2),B=W[0],X=W[1],J=(0,o.useState)(!1),ne=(0,r.Z)(J,2),te=ne[0],re=ne[1],ie=u.toLowerCase(),oe=t.filter((function(e){return(e.userAgent===M||"All User Agents"===M||"Select user agent"===M)&&(""===u||(e.ConsoleMsg.toLowerCase().indexOf(ie)>=0||(!!(e.error&&e.error.source&&e.error.source.filter((function(e){return e.toLowerCase().indexOf(ie)>=0})).length>0)||(!!(e.error&&e.error.message.toLowerCase().indexOf(ie)>=0)||!!(e.api&&e.api.name.toLowerCase().indexOf(ie)>=0)))))}));return(0,o.useEffect)((function(){re(!0),x.Z.invoke("GET","/api/v1/nodes").then((function(e){T(e),re(!1)})).catch((function(e){re(!1)}))}),[]),(0,o.useEffect)((function(){e((0,Q.Sc)("error_logs"))}),[]),(0,N.jsxs)(o.Fragment,{children:[(0,N.jsx)(K.Z,{label:"Logs",actions:(0,N.jsx)(V.Z,{})}),(0,N.jsx)(l.Xgh,{children:(0,N.jsxs)(f.ZP,{container:!0,spacing:1,children:[(0,N.jsx)(f.ZP,{item:!0,xs:4,children:te?(0,N.jsx)("h3",{children:" Loading nodes"}):(0,N.jsx)(h.Z,{variant:"outlined",className:n.nodeField,children:(0,N.jsxs)(p.Z,{id:"node",name:"node","data-test-id":"node-selector",value:F,onChange:function(e){L(e.target.value)},className:n.searchField,disabled:te||i,input:(0,N.jsx)($,{}),placeholder:"Select Node",children:[(0,N.jsx)(g.Z,{value:"all",children:"All Nodes"},"select-node-all"),E.map((function(e){return(0,N.jsx)(g.Z,{value:e,children:e},"select-node-name-".concat(e))}))]})})}),(0,N.jsx)(f.ZP,{item:!0,xs:3,children:(0,N.jsx)(h.Z,{variant:"outlined",className:n.nodeField,children:(0,N.jsxs)(p.Z,{id:"logType",name:"logType","data-test-id":"log-type",value:B,onChange:function(e){X(e.target.value)},className:n.searchField,disabled:te||i,input:(0,N.jsx)($,{}),placeholder:"Select Log Type",children:[(0,N.jsx)(g.Z,{value:"all",children:"All Log Types"},"all-log-types"),(0,N.jsx)(g.Z,{value:"minio",children:"MinIO"},"minio-log-type"),(0,N.jsx)(g.Z,{value:"application",children:"Application"},"app-log-type")]})})}),(0,N.jsx)(f.ZP,{item:!0,xs:3,children:D.length>1&&(0,N.jsx)(h.Z,{variant:"outlined",className:n.nodeField,children:(0,N.jsxs)(p.Z,{id:"userAgent",name:"userAgent","data-test-id":"user-agent",value:M,onChange:function(e){I(e.target.value)},className:n.searchField,disabled:D.length<1||i,input:(0,N.jsx)($,{}),children:[(0,N.jsx)(g.Z,{value:M,disabled:!0,children:"Select User Agent"},"select-user-agent-default"),D.map((function(e){return(0,N.jsx)(g.Z,{value:e,children:e},"select-user-agent-".concat(e))}))]})})}),(0,N.jsxs)(f.ZP,{item:!0,xs:2,sx:{display:"flex",justifyContent:"flex-end"},children:[!i&&(0,N.jsx)(l.zxk,{id:"start-logs",type:"submit",variant:"callAction",disabled:!1,onClick:function(){e((0,G.i1)());var n=new URL(window.location.toString()),t=n.port,r=(0,v.x2)(n.protocol),i=new URL(document.baseURI).pathname;ee=new s.w3cwebsocket("".concat(r,"://").concat(n.hostname,":").concat(t).concat(i,"ws/console/?logType=").concat(B,"&node=").concat("Select node"===F?"":F));var o=null;if(null!==ee)return ee.onopen=function(){console.log("WebSocket Client Connected"),e((0,G.v0)(!0)),ee.send("ok"),o=setInterval((function(){ee.send("ok")}),1e4)},ee.onmessage=function(n){var t=JSON.parse(n.data.toString()),r=!0;""===t.level&&""===t.errKind&&"00:00:00 UTC 01/01/0001"===t.time&&""===t.ConsoleMsg&&""===t.node&&(r=!1),t.key=Math.random(),D.indexOf(t.userAgent)<0&&void 0!==t.userAgent&&(D.push(t.userAgent),H(D)),r&&e((0,G.Qo)(t))},ee.onclose=function(){clearInterval(o),console.log("connection closed by server"),e((0,G.v0)(!1))},function(){ee.close(1e3),clearInterval(o),console.log("closing websockets"),e((0,G.v0)(!1))}},label:"Start Logs"}),i&&(0,N.jsx)(l.zxk,{id:"stop-logs",type:"button",variant:"callAction",onClick:function(){null!==ee&&void 0!==ee&&(ee.close(1e3),e((0,G.v0)(!1)))},label:"Stop Logs"})]}),(0,N.jsx)(f.ZP,{item:!0,xs:12,className:n.actionsTray,children:(0,N.jsx)(j.Z,{placeholder:"Filter",onChange:function(e){y(e)},value:u})}),(0,N.jsx)(f.ZP,{item:!0,xs:12,children:(0,N.jsx)("div",{id:"logs-container",className:n.logList,"data-test-id":"logs-list-container",children:(0,N.jsxs)(O,{component:Z.Z,children:[(0,N.jsx)(w.Z,{"aria-label":"collapsible table",children:(0,N.jsx)(b.Z,{children:oe.map((function(e){return(0,N.jsx)(q,{log:e})}))})}),0===oe.length&&(0,N.jsx)("div",{style:{padding:20,textAlign:"center"},children:"No logs to display"})]})})})]})})]})}},26824:function(e,n,t){"use strict";t.d(n,{HE:function(){return o},V9:function(){return r},ci:function(){return i},x2:function(){return s}});var r=1006,i=1008,o=1011,s=function(e){var n="ws";return"https:"===e&&(n="wss"),n}},56125:function(e,n,t){"use strict";t.d(n,{Z:function(){return C}});var r=t(4942),i=t(63366),o=t(87462),s=t(72791),l=t(28182),a=t(18875),c=t(94419),d=t(66934),u=t(31402),f=t(81314),h=t(4999),p=t(13967),g=t(42071),x=t(75878),m=t(21217);function v(e){return(0,m.Z)("MuiCollapse",e)}(0,x.Z)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var y=t(80184),j=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],Z=(0,d.ZP)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:function(e,n){var t=e.ownerState;return[n.root,n[t.orientation],"entered"===t.state&&n.entered,"exited"===t.state&&!t.in&&"0px"===t.collapsedSize&&n.hidden]}})((function(e){var n=e.theme,t=e.ownerState;return(0,o.Z)({height:0,overflow:"hidden",transition:n.transitions.create("height")},"horizontal"===t.orientation&&{height:"auto",width:0,transition:n.transitions.create("width")},"entered"===t.state&&(0,o.Z)({height:"auto",overflow:"visible"},"horizontal"===t.orientation&&{width:"auto"}),"exited"===t.state&&!t.in&&"0px"===t.collapsedSize&&{visibility:"hidden"})})),w=(0,d.ZP)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:function(e,n){return n.wrapper}})((function(e){var n=e.ownerState;return(0,o.Z)({display:"flex",width:"100%"},"horizontal"===n.orientation&&{width:"auto",height:"100%"})})),b=(0,d.ZP)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:function(e,n){return n.wrapperInner}})((function(e){var n=e.ownerState;return(0,o.Z)({width:"100%"},"horizontal"===n.orientation&&{width:"auto",height:"100%"})})),S=s.forwardRef((function(e,n){var t=(0,u.Z)({props:e,name:"MuiCollapse"}),d=t.addEndListener,x=t.children,m=t.className,S=t.collapsedSize,C=void 0===S?"0px":S,E=t.component,T=t.easing,A=t.in,k=t.onEnter,F=t.onEntered,L=t.onEntering,R=t.onExit,N=t.onExited,z=t.onExiting,M=t.orientation,O=void 0===M?"vertical":M,I=t.style,_=t.timeout,P=void 0===_?f.x9.standard:_,D=t.TransitionComponent,H=void 0===D?a.ZP:D,U=(0,i.Z)(t,j),W=(0,o.Z)({},t,{orientation:O,collapsedSize:C}),B=function(e){var n=e.orientation,t=e.classes,r={root:["root","".concat(n)],entered:["entered"],hidden:["hidden"],wrapper:["wrapper","".concat(n)],wrapperInner:["wrapperInner","".concat(n)]};return(0,c.Z)(r,v,t)}(W),X=(0,p.Z)(),q=s.useRef(),G=s.useRef(null),J=s.useRef(),K="number"===typeof C?"".concat(C,"px"):C,V="horizontal"===O,Q=V?"width":"height";s.useEffect((function(){return function(){clearTimeout(q.current)}}),[]);var Y=s.useRef(null),$=(0,g.Z)(n,Y),ee=function(e){return function(n){if(e){var t=Y.current;void 0===n?e(t):e(t,n)}}},ne=function(){return G.current?G.current[V?"clientWidth":"clientHeight"]:0},te=ee((function(e,n){G.current&&V&&(G.current.style.position="absolute"),e.style[Q]=K,k&&k(e,n)})),re=ee((function(e,n){var t=ne();G.current&&V&&(G.current.style.position="");var r=(0,h.C)({style:I,timeout:P,easing:T},{mode:"enter"}),i=r.duration,o=r.easing;if("auto"===P){var s=X.transitions.getAutoHeightDuration(t);e.style.transitionDuration="".concat(s,"ms"),J.current=s}else e.style.transitionDuration="string"===typeof i?i:"".concat(i,"ms");e.style[Q]="".concat(t,"px"),e.style.transitionTimingFunction=o,L&&L(e,n)})),ie=ee((function(e,n){e.style[Q]="auto",F&&F(e,n)})),oe=ee((function(e){e.style[Q]="".concat(ne(),"px"),R&&R(e)})),se=ee(N),le=ee((function(e){var n=ne(),t=(0,h.C)({style:I,timeout:P,easing:T},{mode:"exit"}),r=t.duration,i=t.easing;if("auto"===P){var o=X.transitions.getAutoHeightDuration(n);e.style.transitionDuration="".concat(o,"ms"),J.current=o}else e.style.transitionDuration="string"===typeof r?r:"".concat(r,"ms");e.style[Q]=K,e.style.transitionTimingFunction=i,z&&z(e)}));return(0,y.jsx)(H,(0,o.Z)({in:A,onEnter:te,onEntered:ie,onEntering:re,onExit:oe,onExited:se,onExiting:le,addEndListener:function(e){"auto"===P&&(q.current=setTimeout(e,J.current||0)),d&&d(Y.current,e)},nodeRef:Y,timeout:"auto"===P?null:P},U,{children:function(e,n){return(0,y.jsx)(Z,(0,o.Z)({as:E,className:(0,l.Z)(B.root,m,{entered:B.entered,exited:!A&&"0px"===K&&B.hidden}[e]),style:(0,o.Z)((0,r.Z)({},V?"minWidth":"minHeight",K),I),ownerState:(0,o.Z)({},W,{state:e}),ref:$},n,{children:(0,y.jsx)(w,{ownerState:(0,o.Z)({},W,{state:e}),className:B.wrapper,ref:G,children:(0,y.jsx)(b,{ownerState:(0,o.Z)({},W,{state:e}),className:B.wrapperInner,children:x})})}))}}))}));S.muiSupportAuto=!0;var C=S},93840:function(e,n,t){"use strict";var r=t(72791).createContext(void 0);n.Z=r},76147:function(e,n,t){"use strict";function r(e){var n=e.props,t=e.states,r=e.muiFormControl;return t.reduce((function(e,t){return e[t]=n[t],r&&"undefined"===typeof n[t]&&(e[t]=r[t]),e}),{})}t.d(n,{Z:function(){return r}})},52930:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var r=t(72791),i=t(93840);function o(){return r.useContext(i.Z)}},19103:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(72791);var i=function(e,n){return r.isValidElement(e)&&-1!==n.indexOf(e.type.muiName)}},78949:function(e,n,t){"use strict";function r(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return n.reduce((function(e,n){return null==n?e:function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];e.apply(this,r),n.apply(this,r)}}),(function(){}))}t.d(n,{Z:function(){return r}})},94210:function(e){var n=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 n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},95087:function(e,n,t){var r;if("object"===typeof globalThis)r=globalThis;else try{r=t(94210)}catch(l){}finally{if(r||"undefined"===typeof window||(r=window),!r)throw new Error("Could not determine global this")}var i=r.WebSocket||r.MozWebSocket,o=t(51496);function s(e,n){return n?new i(e,n):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(s,e,{get:function(){return i[e]}})})),e.exports={w3cwebsocket:i?s:null,version:o}},51496:function(e,n,t){e.exports=t(19794).version},19794:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
//# sourceMappingURL=1892.e7ffbb89.chunk.js.map