2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[3543],{33543:function(e,t,n){n.r(t),n.d(t,{default:function(){return L}});var s=n(93433),a=n(29439),o=n(1413),i=n(72791),l=n(60364),c=n(75952),r=n(61889),u=n(26181),d=n.n(u),m=n(11135),h=n(25787),p=n(23814),g=n(45248),x=n(81207),f=n(92983),b=n(27391),j=n(80184),_=(0,h.Z)((function(e){return(0,m.Z)({searchField:(0,o.Z)((0,o.Z)({},p.qg.searchField),{},{height:30,padding:0,"& input":{padding:"0 12px",height:28,fontSize:12,fontWeight:600,color:"#393939"},"&.isDisabled":{"&:hover":{borderColor:"#EAEDEE"}},"& input.Mui-disabled":{backgroundColor:"#EAEAEA"}}),labelStyle:{color:"#393939",fontSize:12,marginBottom:4},buttonKit:{display:"flex",alignItems:"center"},fieldContainer:{flexGrow:1,margin:"0 15px"}})}))((function(e){var t=e.classes,n=e.label,s=e.onChange,a=e.value,o=e.placeholder,l=void 0===o?"":o,c=e.id,r=e.name;return(0,j.jsx)(i.Fragment,{children:(0,j.jsxs)("div",{className:t.fieldContainer,children:[(0,j.jsx)("div",{className:t.labelStyle,children:n}),(0,j.jsx)("div",{className:t.buttonKit,children:(0,j.jsx)(b.Z,{placeholder:l,id:c,name:r,label:"",onChange:function(e){s(e.target.value)},InputProps:{disableUnderline:!0},className:t.searchField,value:a})})]})})})),C=n(56028),Z={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"},S=(0,h.Z)((function(e){return(0,m.Z)((0,o.Z)({buttonContainer:{textAlign:"right"},objectKeyCol:{fontWeight:700,paddingRight:"10px",textAlign:"left"}},p.oO))}))((function(e){var t=e.modalOpen,n=e.logSearchElement,s=e.onClose,a=e.classes,o=Object.keys(n);return(0,j.jsx)(i.Fragment,{children:(0,j.jsx)(C.Z,{modalOpen:t,title:"Full Log Information",onClose:function(){s()},children:(0,j.jsxs)(r.ZP,{container:!0,children:[(0,j.jsx)(r.ZP,{item:!0,xs:12,children:(0,j.jsx)("table",{children:(0,j.jsx)("tbody",{children:o.map((function(e,t){return(0,j.jsxs)("tr",{children:[(0,j.jsx)("th",{className:a.objectKeyCol,children:d()(Z,e,"".concat(e))}),(0,j.jsx)("td",{children:d()(n,e,"")})]},"logSearch-".concat(t.toString()))}))})})}),(0,j.jsx)(r.ZP,{item:!0,xs:12,className:a.buttonContainer,children:(0,j.jsx)(c.zx,{id:"close-log-search",variant:"callAction",color:"primary",onClick:s,label:"Close"})})]})})})})),y=n(63856),v=n(32291),k=n(74794),A=n(93385),N=n(56087),E=n(38442),F=n(38588),P=n(23804),K=function(e){var t=e.iconComponent,n=e.entity,s=e.documentationLink;return(0,j.jsx)(r.ZP,{container:!0,justifyContent:"center",alignContent:"center",alignItems:"center",children:(0,j.jsx)(r.ZP,{item:!0,xs:8,children:(0,j.jsx)(P.Z,{title:"".concat(n," not available"),iconComponent:t,help:(0,j.jsxs)(i.Fragment,{children:["This feature is not available.",(0,j.jsx)("br",{}),"Please configure"," ",(0,j.jsx)("a",{href:s,target:"_blank",rel:"noreferrer",children:n})," ","first to use this feature."]})})})})},O=n(87995),q=n(46078),I=n(25469),L=(0,h.Z)((function(e){return(0,m.Z)((0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({blockCollapsed:{display:"none",overflowY:"hidden"},filterOpen:{display:"block",marginBottom:12},endLineAction:{marginBottom:15,padding:"0 15px 0 15px",display:"flex",alignItems:"center",justifyContent:"flex-end"},filtersContainer:{display:"flex",justifyContent:"space-between",marginBottom:12},innerContainer:{backgroundColor:"#fff"},noticeLabel:{marginLeft:15,marginBottom:15,fontSize:12,color:"#9C9C9C"},tableFOpen:{height:"calc(100vh - 520px)"},tableFClosed:{height:"calc(100vh - 320px)"}},p.VX),p.S),{},{searchOptions:{display:"flex",padding:15,"@media (max-width: 900px)":{flexFlow:"column"}},formBox:{border:"1px solid #EAEAEA",marginBottom:15},dateRangePicker:{"& div":{marginBottom:0}},advancedButton:{display:"flex",alignItems:"center",justifyContent:"flex-start"}},p.o$),(0,p.Bz)(e.spacing(4))))}))((function(e){var t=e.classes,n=(0,I.TL)(),o=(0,l.v9)(q.$4),u=(0,i.useState)(!0),m=(0,a.Z)(u,2),h=m[0],p=m[1],b=(0,i.useState)(null),C=(0,a.Z)(b,2),P=C[0],L=C[1],B=(0,i.useState)(null),R=(0,a.Z)(B,2),w=R[0],D=R[1],T=(0,i.useState)(!1),z=(0,a.Z)(T,2),H=z[0],M=z[1],W=(0,i.useState)([]),G=(0,a.Z)(W,2),U=G[0],Y=G[1],$=(0,i.useState)(""),V=(0,a.Z)($,2),X=V[0],J=V[1],Q=(0,i.useState)(""),ee=(0,a.Z)(Q,2),te=ee[0],ne=ee[1],se=(0,i.useState)(""),ae=(0,a.Z)(se,2),oe=ae[0],ie=ae[1],le=(0,i.useState)(""),ce=(0,a.Z)(le,2),re=ce[0],ue=ce[1],de=(0,i.useState)(""),me=(0,a.Z)(de,2),he=me[0],pe=me[1],ge=(0,i.useState)(""),xe=(0,a.Z)(ge,2),fe=xe[0],be=xe[1],je=(0,i.useState)(""),_e=(0,a.Z)(je,2),Ce=_e[0],Ze=_e[1],Se=(0,i.useState)("DESC"),ye=(0,a.Z)(Se,2),ve=ye[0],ke=ye[1],Ae=(0,i.useState)(["time","api_name","access_key","bucket","object","remote_host","request_id","user_agent","response_status"]),Ne=(0,a.Z)(Ae,2),Ee=Ne[0],Fe=Ne[1],Pe=(0,i.useState)(0),Ke=(0,a.Z)(Pe,2),Oe=Ke[0],qe=Ke[1],Ie=(0,i.useState)(!1),Le=(0,a.Z)(Ie,2),Be=Le[0],Re=Le[1],we=(0,i.useState)(!1),De=(0,a.Z)(we,2),Te=De[0],ze=De[1],He=(0,i.useState)(null),Me=(0,a.Z)(He,2),We=Me[0],Ge=Me[1],Ue=null,Ye=o&&o.includes("log-search"),$e=(0,i.useCallback)((function(){if(!Be&&Ye){Re(!0);var e="".concat(""!==X?"&fp=bucket:".concat(X):"").concat(""!==he?"&fp=object:".concat(he):"").concat(""!==te?"&fp=api_name:".concat(te):"").concat(""!==oe?"&fp=access_key:".concat(oe):"").concat(""!==fe?"&fp=request_id:".concat(fe):"").concat(""!==re?"&fp=user_agent:".concat(re):"").concat(""!==Ce?"&fp=response_status:".concat(Ce):"");(e=e.trim()).endsWith(",")&&(e=e.slice(0,-1)),x.Z.invoke("GET","/api/v1/logs/search?q=reqinfo".concat(""!==e?"".concat(e):"","&pageSize=100&pageNo=").concat(Oe,"&order=").concat("DESC"===ve?"timeDesc":"timeAsc").concat(null!==P?"&timeStart=".concat(P.toISOString()):"").concat(null!==w?"&timeEnd=".concat(w.toISOString()):"")).then((function(e){var t=e.results||[];p(!1),Re(!1),Y(t),qe(Oe+1),null!==Ue&&Ue()})).catch((function(e){p(!1),Re(!1),n((0,O.Ih)(e))}))}else p(!1),Re(!1)}),[Be,Ye,X,he,te,oe,fe,re,Ce,Oe,ve,P,w,Ue,n]);(0,i.useEffect)((function(){h&&(Y([]),$e())}),[h,ve,$e]);return(0,j.jsxs)(i.Fragment,{children:[Te&&null!==We&&(0,j.jsx)(S,{logSearchElement:We,modalOpen:Te,onClose:function(){Ge(null),ze(!1)}}),(0,j.jsx)(v.Z,{label:"Audit Logs"}),(0,j.jsx)(k.Z,{children:Ye?(0,j.jsxs)(i.Fragment,{children:[" ",(0,j.jsxs)(r.ZP,{xs:12,className:t.formBox,children:[(0,j.jsxs)(r.ZP,{item:!0,xs:12,className:"".concat(t.searchOptions),children:[(0,j.jsx)("div",{className:t.dateRangePicker,children:(0,j.jsx)(y.Z,{setTimeEnd:D,setTimeStart:L,timeEnd:w,timeStart:P})}),(0,j.jsx)(r.ZP,{item:!0,className:t.advancedButton,children:(0,j.jsxs)("button",{onClick:function(){M(!H)},className:t.advancedConfiguration,children:[H?"Hide":"Show"," advanced Filters"," ",(0,j.jsx)("span",{className:H?t.advancedOpen:t.advancedClosed,children:(0,j.jsx)(A.Z,{})})]})})]}),(0,j.jsx)(r.ZP,{item:!0,xs:12,className:"".concat(t.blockCollapsed," ").concat(H?t.filterOpen:""),children:(0,j.jsxs)("div",{className:t.innerContainer,children:[(0,j.jsxs)("div",{className:t.noticeLabel,children:["Enable your preferred options to get filtered records.",(0,j.jsx)("br",{}),"You can use '*' to match any character, '.' to signify a single character or '\\' to scape an special character (E.g. mybucket-*)"]}),(0,j.jsxs)("div",{className:t.filtersContainer,children:[(0,j.jsx)(_,{onChange:J,value:X,label:"Bucket",id:"bucket",name:"bucket"}),(0,j.jsx)(_,{onChange:ne,value:te,label:"API Name",id:"api_name",name:"api_name"}),(0,j.jsx)(_,{onChange:ie,value:oe,label:"Access Key",id:"access_key",name:"access_key"}),(0,j.jsx)(_,{onChange:ue,value:re,label:"User Agent",id:"user_agent",name:"user_agent"})]}),(0,j.jsxs)("div",{className:t.filtersContainer,children:[(0,j.jsx)(_,{onChange:pe,value:he,label:"Object",id:"object",name:"object"}),(0,j.jsx)(_,{onChange:be,value:fe,label:"Request ID",id:"request_id",name:"request_id"}),(0,j.jsx)(_,{onChange:Ze,value:Ce,label:"Response Status",id:"response_status",name:"response_status"})]})]})}),(0,j.jsx)(r.ZP,{item:!0,xs:12,className:t.endLineAction,children:(0,j.jsx)(c.zx,{id:"get-information",type:"button",variant:"callAction",onClick:function(){qe(0),p(!0)},label:"Get Information"})})]}),(0,j.jsx)(r.ZP,{item:!0,xs:12,className:t.tableBlock,children:(0,j.jsx)(E.s,{scopes:[N.Ft.ADMIN_HEALTH_INFO],resource:N.C3,errorProps:{disabled:!0},children:(0,j.jsx)(f.Z,{columns:[{label:Z.time,elementKey:"time",enableSort:!0},{label:Z.api_name,elementKey:"api_name"},{label:Z.access_key,elementKey:"access_key"},{label:Z.bucket,elementKey:"bucket"},{label:Z.object,elementKey:"object"},{label:Z.remote_host,elementKey:"remote_host"},{label:Z.request_id,elementKey:"request_id"},{label:Z.user_agent,elementKey:"user_agent"},{label:Z.response_status,elementKey:"response_status",renderFunction:function(e){return(0,j.jsx)(i.Fragment,{children:(0,j.jsxs)("span",{children:[e.response_status_code," (",e.response_status,")"]})})},renderFullObject:!0},{label:Z.request_content_length,elementKey:"request_content_length",renderFunction:g.ae},{label:Z.response_content_length,elementKey:"response_content_length",renderFunction:g.ae},{label:Z.time_to_response_ns,elementKey:"time_to_response_ns",renderFunction:g.Yj,contentTextAlign:"right"}],isLoading:h,records:U,entityName:"Logs",customEmptyMessage:"There is no information with this criteria",idField:"request_id",columnsSelector:!0,columnsShown:Ee,onColumnChange:function(e,t){var n=(0,s.Z)(Ee);t?n.includes(e)||n.push(e):n=Ee.filter((function(t){return t!==e})),Fe(n)},customPaperHeight:H?t.tableFOpen:t.tableFClosed,sortConfig:{currentSort:"time",currentDirection:ve,triggerSort:function(e){var t=d()(e,"sortDirection","DESC");ke(t),qe(0),p(!0)}},infiniteScrollConfig:{recordsCount:1e6,loadMoreRecords:function(e){return $e(),new Promise((function(e){Ue=e}))}},itemActions:[{type:"view",onClick:function(e){Ge(e),ze(!0)}}],textSelectable:!0})})})]}):(0,j.jsx)(K,{entity:"Audit Logs",iconComponent:(0,j.jsx)(F.W1M,{}),documentationLink:"https://github.com/minio/operator/tree/master/logsearchapi"})})]})}))}}]);
|
|
//# sourceMappingURL=3543.cae2b3f6.chunk.js.map
|