2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[2372],{71102:(e,t,n)=>{n.d(t,{A:()=>o});var s=n(65043),a=n(89923),i=n(70579);const o=e=>{let{timeStart:t,setTimeStart:n,timeEnd:o,setTimeEnd:l,triggerSync:r,label:c="Filter:",startLabel:d="Start Time:",endLabel:m="End Time:"}=e;return(0,i.jsx)(a.xA9,{item:!0,xs:12,sx:{"& .filter-date-input-label, .end-time-input-label":{display:"none"},"& .MuiInputBase-adornedEnd.filter-date-date-time-input":{width:"100%",border:"1px solid #eaeaea",paddingLeft:"8px",paddingRight:"8px",borderRadius:"1px"},"& .MuiInputAdornment-root button":{height:"20px",width:"20px",marginRight:"5px"},"& .filter-date-input-wrapper":{height:"30px",width:"100%","& .MuiTextField-root":{height:"30px",width:"90%","& input.Mui-disabled":{color:"#000000",WebkitTextFillColor:"#101010"}}}},children:(0,i.jsxs)(a.azJ,{sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"auto 2fr auto",padding:0,["@media (max-width: ".concat(a.nmC.sm,"px)")]:{padding:5},["@media (max-width: ".concat(a.nmC.md,"px)")]:{gridTemplateColumns:"1fr",height:"auto"},gap:"5px"},children:[(0,i.jsx)(a.azJ,{sx:{fontSize:"14px",fontWeight:500,marginRight:"5px"},className:"muted",children:c}),(0,i.jsxs)(a.azJ,{customBorderPadding:"0px",sx:{display:"grid",height:40,alignItems:"center",gridTemplateColumns:"1fr 1fr",gap:"8px",paddingLeft:"8px",paddingRight:"8px",["@media (max-width: ".concat(a.nmC.md,"px)")]:{height:"auto",gridTemplateColumns:"1fr"}},children:[(0,i.jsx)(a.e8j,{value:t,onChange:n,id:"stTime",secondsSelector:!1,pickerStartComponent:(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(a.b1c,{}),(0,i.jsx)("span",{children:d})]})}),(0,i.jsx)(a.e8j,{value:o,onChange:l,id:"endTime",secondsSelector:!1,pickerStartComponent:(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(a.b1c,{}),(0,i.jsx)("span",{children:m})]})})]}),r&&(0,i.jsx)(a.azJ,{sx:{alignItems:"flex-end",display:"flex",justifyContent:"flex-end"},children:(0,i.jsx)(a.$nd,{id:"sync",type:"button",variant:"callAction",onClick:r,icon:(0,i.jsx)(a.Fjq,{}),label:"Sync"})})]})})}},94141:(e,t,n)=>{n.d(t,{A:()=>d});var s=n(65043),a=n(22166),i=n(89923),o=n(21383),l=n(64159),r=n(49555),c=n(70579);const d=e=>{let{onClose:t,modalOpen:n,title:d,children:m,wideLimit:u=!0,titleIcon:x=null,iconColor:p="default",sx:h}=e;const g=(0,o.jL)(),[j,b]=(0,s.useState)(!1),f=(0,a.d4)((e=>e.system.modalSnackBar));(0,s.useEffect)((()=>{g((0,l.h0)(""))}),[g]),(0,s.useEffect)((()=>{if(f){if(""===f.message)return void b(!1);"error"!==f.type&&b(!0)}}),[f]);let _="";return f&&(_=f.detailedErrorMsg,(""===_||_&&_.length<5)&&(_=f.message)),(0,c.jsxs)(i.ngX,{onClose:t,open:n,title:d,titleIcon:x,widthLimit:u,sx:h,iconColor:p,children:[(0,c.jsx)(r.A,{isModal:!0}),(0,c.jsx)(i.qb_,{onClose:()=>{b(!1),g((0,l.h0)(""))},open:j,message:_,mode:"inline",variant:"error"===f.type?"error":"default",autoHideDuration:"error"===f.type?10:5,condensed:!0}),m]})}},52372:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var s=n(65043),a=n(33097),i=n.n(a),o=n(22166),l=n(89923),r=n(56483);const c={time:"Timestamp",api_name:"API Name",access_key:"Access Key",bucket:"Bucket",object:"Object",remote_host:"Remote Host",request_id:"Request ID",user_agent:"User Agent",response_status:"Response Status",response_status_code:"Response Status Code",request_content_length:"Request Content Length",response_content_length:"Response Content Length",time_to_response_ns:"Time to Response NS"};var d=n(99161),m=n(64159),u=n(46537),x=n(21383),p=n(77938),h=n(20649),g=n(70579);const j=e=>{let{label:t,onChange:n,value:a,placeholder:i="",id:o,name:r}=e;return(0,g.jsx)(s.Fragment,{children:(0,g.jsxs)(l.azJ,{sx:{flexGrow:1,margin:"0 15px"},children:[(0,g.jsx)(l.l1Y,{children:t}),(0,g.jsx)(l.cl_,{placeholder:i,id:o,name:r,label:"",onChange:e=>{n(e.target.value)},sx:{"& input":{height:30}},value:a})]})})};var b=n(94141);const f=e=>{let{modalOpen:t,logSearchElement:n,onClose:a}=e;const o=Object.keys(n);return(0,g.jsx)(s.Fragment,{children:(0,g.jsx)(b.A,{modalOpen:t,title:"Full Log Information",onClose:()=>{a()},children:(0,g.jsxs)(l.xA9,{container:!0,children:[(0,g.jsx)(l.xA9,{item:!0,xs:12,children:(0,g.jsx)("table",{children:(0,g.jsx)("tbody",{children:o.map(((e,t)=>(0,g.jsxs)("tr",{children:[(0,g.jsx)("th",{style:{fontWeight:700,paddingRight:"10px",textAlign:"left"},children:i()(c,e,"".concat(e))}),(0,g.jsx)("td",{children:i()(n,e,"")})]},"logSearch-".concat(t.toString()))))})})}),(0,g.jsx)(l.xA9,{item:!0,xs:12,sx:{display:"flex",justifyContent:"flex-end"},children:(0,g.jsx)(l.$nd,{id:"close-log-search",variant:"callAction",color:"primary",onClick:a,label:"Close"})})]})})})};var _=n(71102);const C=e=>{let{iconComponent:t,entity:n,documentationLink:a}=e;return(0,g.jsx)(l.xA9,{container:!0,sx:{justifyContent:"center",alignContent:"center",alignItems:"center"},children:(0,g.jsx)(l.xA9,{item:!0,xs:8,children:(0,g.jsx)(l.lVp,{title:"".concat(n," not available"),iconComponent:t,help:(0,g.jsxs)(s.Fragment,{children:["This feature is not available.",(0,g.jsx)("br",{}),"Please configure"," ",(0,g.jsx)("a",{href:a,target:"_blank",rel:"noopener",children:n})," ","first to use this feature."]})})})})};var y=n(48793),S=n(55968);const k={display:"flex",justifyContent:"space-between",marginBottom:12},A=()=>{const e=(0,x.jL)(),t=(0,o.d4)(u.s$),[n,a]=(0,s.useState)(!0),[b,A]=(0,s.useState)(null),[v,w]=(0,s.useState)(null),[E,T]=(0,s.useState)(!1),[F,I]=(0,s.useState)([]),[L,q]=(0,s.useState)(""),[R,z]=(0,s.useState)(""),[K,O]=(0,s.useState)(""),[J,B]=(0,s.useState)(""),[M,D]=(0,s.useState)(""),[N,P]=(0,s.useState)(""),[H,W]=(0,s.useState)(""),[U,$]=(0,s.useState)("DESC"),[G,Y]=(0,s.useState)(["time","api_name","access_key","bucket","object","remote_host","request_id","user_agent","response_status"]),[V,Q]=(0,s.useState)(0),[X,Z]=(0,s.useState)(!1),[ee,te]=(0,s.useState)(!1),[ne,se]=(0,s.useState)(null);let ae=null;const ie=t&&t.includes("log-search"),oe=(0,s.useCallback)((()=>{if(!X&&ie){Z(!0);let t="".concat(""!==L?"&fp=bucket:".concat(L):"").concat(""!==M?"&fp=object:".concat(M):"").concat(""!==R?"&fp=api_name:".concat(R):"").concat(""!==K?"&fp=access_key:".concat(K):"").concat(""!==N?"&fp=request_id:".concat(N):"").concat(""!==J?"&fp=user_agent:".concat(J):"").concat(""!==H?"&fp=response_status:".concat(H):"");t=t.trim(),t.endsWith(",")&&(t=t.slice(0,-1)),h.A.invoke("GET","/api/v1/logs/search?q=reqinfo".concat(""!==t?"".concat(t):"","&pageSize=100&pageNo=").concat(V,"&order=").concat("DESC"===U?"timeDesc":"timeAsc").concat(null!==b?"&timeStart=".concat(b.toUTC().toISO()):"").concat(null!==v?"&timeEnd=".concat(v.toUTC().toISO()):"")).then((e=>{const t=e.results||[];a(!1),Z(!1),I(t),Q(V+1),null!==ae&&ae()})).catch((t=>{a(!1),Z(!1),e((0,m.C9)(t))}))}else a(!1),Z(!1)}),[X,ie,L,M,R,K,N,J,H,V,U,b,v,ae,e]);(0,s.useEffect)((()=>{n&&(I([]),oe())}),[n,U,oe]);return(0,s.useEffect)((()=>{e((0,m.ph)("audit_logs"))}),[]),(0,g.jsxs)(s.Fragment,{children:[ee&&null!==ne&&(0,g.jsx)(f,{logSearchElement:ne,modalOpen:ee,onClose:()=>{se(null),te(!1)}}),(0,g.jsx)(y.A,{label:"Audit Logs",actions:(0,g.jsx)(S.A,{})}),(0,g.jsx)(l.Mxu,{children:ie?(0,g.jsxs)(s.Fragment,{children:[" ",(0,g.jsxs)(l.azJ,{withBorders:!0,sx:{marginBottom:15},children:[(0,g.jsxs)(l.xA9,{item:!0,xs:12,sx:{display:"flex",padding:15,["@media (max-width: ".concat(l.nmC.lg,"px)")]:{flexFlow:"column"}},children:[(0,g.jsx)(l.azJ,{children:(0,g.jsx)(_.A,{setTimeEnd:e=>w(e),setTimeStart:e=>A(e),timeEnd:v,timeStart:b})}),(0,g.jsx)(l.azJ,{sx:{display:"flex",alignItems:"center"},children:(0,g.jsx)(l.J2w,{label:"".concat(E?"Hide":"Show"," advanced Filters"),open:E,onClick:()=>{T(!E)}})})]}),(0,g.jsxs)(l.xA9,{item:!0,xs:12,sx:{display:E?"block":"none",overflowY:"hidden",marginBottom:E?12:0},children:[(0,g.jsxs)(l.azJ,{sx:{marginLeft:15,marginBottom:15,fontSize:12,color:"#9C9C9C"},children:["Enable your preferred options to get filtered records.",(0,g.jsx)("br",{}),"You can use '*' to match any character, '.' to signify a single character or '\\' to scape an special character (E.g. mybucket-*)"]}),(0,g.jsxs)(l.azJ,{sx:k,children:[(0,g.jsx)(j,{onChange:q,value:L,label:"Bucket",id:"bucket",name:"bucket"}),(0,g.jsx)(j,{onChange:z,value:R,label:"API Name",id:"api_name",name:"api_name"}),(0,g.jsx)(j,{onChange:O,value:K,label:"Access Key",id:"access_key",name:"access_key"}),(0,g.jsx)(j,{onChange:B,value:J,label:"User Agent",id:"user_agent",name:"user_agent"})]}),(0,g.jsxs)(l.azJ,{sx:k,children:[(0,g.jsx)(j,{onChange:D,value:M,label:"Object",id:"object",name:"object"}),(0,g.jsx)(j,{onChange:P,value:N,label:"Request ID",id:"request_id",name:"request_id"}),(0,g.jsx)(j,{onChange:W,value:H,label:"Response Status",id:"response_status",name:"response_status"})]})]}),(0,g.jsx)(l.xA9,{item:!0,xs:12,sx:{marginBottom:15,padding:"0 15px 0 15px",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:(0,g.jsx)(l.$nd,{id:"get-information",type:"button",variant:"callAction",onClick:()=>{Q(0),a(!0)},label:"Get Information"})})]}),(0,g.jsx)(l.xA9,{item:!0,xs:12,children:(0,g.jsx)(p.R,{scopes:[d.OV.ADMIN_HEALTH_INFO],resource:d.Ms,errorProps:{disabled:!0},children:(0,g.jsx)(l.bQt,{columns:[{label:c.time,elementKey:"time",enableSort:!0},{label:c.api_name,elementKey:"api_name"},{label:c.access_key,elementKey:"access_key"},{label:c.bucket,elementKey:"bucket"},{label:c.object,elementKey:"object"},{label:c.remote_host,elementKey:"remote_host"},{label:c.request_id,elementKey:"request_id"},{label:c.user_agent,elementKey:"user_agent"},{label:c.response_status,elementKey:"response_status",renderFunction:e=>(0,g.jsx)(s.Fragment,{children:(0,g.jsxs)("span",{children:[e.response_status_code," (",e.response_status,")"]})}),renderFullObject:!0},{label:c.request_content_length,elementKey:"request_content_length",renderFunction:r.nO},{label:c.response_content_length,elementKey:"response_content_length",renderFunction:r.nO},{label:c.time_to_response_ns,elementKey:"time_to_response_ns",renderFunction:r.Wi,contentTextAlign:"right"}],isLoading:n,records:F,entityName:"Logs",customEmptyMessage:"There is no information with this criteria",idField:"request_id",columnsSelector:!0,columnsShown:G,onColumnChange:e=>{let t;t=G.findIndex((t=>t===e))>=0?G.filter((t=>t!==e)):[...G,e],Y(t)},customPaperHeight:E?"calc(100vh - 520px)":"calc(100vh - 320px)",sortEnabled:{currentSort:"time",currentDirection:U,onSortClick:e=>{const t=i()(e,"sortDirection","DESC");$(t),Q(0),a(!0)}},infiniteScrollConfig:{recordsCount:1e6,loadMoreRecords:e=>(oe(),new Promise((e=>{ae=e})))},itemActions:[{type:"view",onClick:e=>{se(e),te(!0)}}],textSelectable:!0})})})]}):(0,g.jsx)(C,{entity:"Audit Logs",iconComponent:(0,g.jsx)(l.WIv,{}),documentationLink:"https://min.io/docs/minio/windows/operations/monitoring/minio-logging.html?ref=con"})})]})}}}]);
|
|
//# sourceMappingURL=2372.d67d02b5.chunk.js.map
|