"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[548],{64548:(e,r,n)=>{n.r(r),n.d(r,{default:()=>U});var t=n(65043),s=n(55395),a=n(44093),i=n(67813),l=n(87139),c=n(39081),o=n(96148),d=n(91751),h=n(98662),x=n(96870),j=n(22107),u=n(28846),p=n(34946),g=n(42703),m=n(10202),v=n(61724),y=n(35699),S=n(80511),f=n(3313),z=n(83201),T=n(82595),w=n(76659),C=n(63935),b=n(11054),E=n(19542),k=n(15071),D=n(67516),O=n(72526),W=n(6583),A=n(46291);var P=n(70579);const _=(0,n(14010).w)({displayName:"RepeatIcon",path:(0,P.jsxs)("g",{fill:"currentColor",children:[(0,P.jsx)("path",{d:"M10.319,4.936a7.239,7.239,0,0,1,7.1,2.252,1.25,1.25,0,1,0,1.872-1.657A9.737,9.737,0,0,0,9.743,2.5,10.269,10.269,0,0,0,2.378,9.61a.249.249,0,0,1-.271.178l-1.033-.13A.491.491,0,0,0,.6,9.877a.5.5,0,0,0-.019.526l2.476,4.342a.5.5,0,0,0,.373.248.43.43,0,0,0,.062,0,.5.5,0,0,0,.359-.152l3.477-3.593a.5.5,0,0,0-.3-.844L5.15,10.172a.25.25,0,0,1-.2-.333A7.7,7.7,0,0,1,10.319,4.936Z"}),(0,P.jsx)("path",{d:"M23.406,14.1a.5.5,0,0,0,.015-.526l-2.5-4.329A.5.5,0,0,0,20.546,9a.489.489,0,0,0-.421.151l-3.456,3.614a.5.5,0,0,0,.3.842l1.848.221a.249.249,0,0,1,.183.117.253.253,0,0,1,.023.216,7.688,7.688,0,0,1-5.369,4.9,7.243,7.243,0,0,1-7.1-2.253,1.25,1.25,0,1,0-1.872,1.656,9.74,9.74,0,0,0,9.549,3.03,10.261,10.261,0,0,0,7.369-7.12.251.251,0,0,1,.27-.179l1.058.127a.422.422,0,0,0,.06,0A.5.5,0,0,0,23.406,14.1Z"})]})});var I=n(74770),L=n(72898);const R=e=>{let{ev:r,onOpenDetail:n}=e;const t="fatal"===r.severity?"red":"warn"===r.severity?"yellow":"gray";let x=r.tags;try{"string"===typeof x&&(x=JSON.parse(x))}catch(u){}const j=x&&"support"===x.type;return(0,P.jsxs)(s.Tr,{_hover:{bg:(0,a.dU)("gray.50","gray.700"),cursor:"pointer"},onClick:()=>n(r.id),children:[(0,P.jsx)(i.Td,{whiteSpace:"nowrap",children:new Date(r.occurred_at||r.created_at).toLocaleString()}),(0,P.jsx)(i.Td,{children:(0,P.jsx)(l.E,{colorScheme:t,children:r.severity||"error"})}),(0,P.jsx)(i.Td,{children:r.origin}),(0,P.jsx)(i.Td,{children:(0,P.jsx)(c.E,{noOfLines:1,maxW:"420px",title:r.message,children:r.message})}),(0,P.jsx)(i.Td,{children:r.method}),(0,P.jsx)(i.Td,{children:(0,P.jsx)(c.E,{noOfLines:1,maxW:"260px",title:r.url,children:r.url})}),(0,P.jsx)(i.Td,{children:r.status||""}),(0,P.jsx)(i.Td,{children:(0,P.jsxs)(o.z,{spacing:1,onClick:e=>e.stopPropagation(),children:[(0,P.jsx)(d.C,{fontSize:"xs",children:r.request_id||""}),r.request_id?(0,P.jsx)(h.$,{size:"xs",variant:"ghost",onClick:async()=>{try{await navigator.clipboard.writeText(r.request_id||"")}catch(e){}},children:"Kop\xedrovat"}):null]})}),(0,P.jsx)(i.Td,{children:j?(0,P.jsx)(l.E,{colorScheme:"purple",children:"Podpora"}):null})]})},U=()=>{var e,r,n,U,$,M;const[q,N]=(0,t.useState)(""),[Z,H]=(0,t.useState)(""),[K,F]=(0,t.useState)(""),[J,G]=(0,t.useState)(""),[V,X]=(0,t.useState)(""),[Y,B]=(0,t.useState)(""),[Q,ee]=(0,t.useState)(""),[re,ne]=(0,t.useState)(1),[te,se]=(0,t.useState)(20),[ae,ie]=(0,t.useState)(!0),[le,ce]=(0,t.useState)(null),oe=(0,x.j)(),[de,he]=(0,t.useState)(!1),[xe,je]=(0,t.useState)(""),[ue,pe]=(0,t.useState)(!1),ge=(0,t.useMemo)(()=>ue?V&&V.trim()?"Support: ".concat(V.trim()):"Support:":V,[ue,V]),me=(0,t.useMemo)(()=>ue?Z||"warn":Z,[ue,Z]),ve=(0,t.useMemo)(()=>ue?q||"frontend":q,[ue,q]),ye=(0,t.useMemo)(()=>({origin:ve,severity:me,method:K,status:J||void 0,search:ge,from:Y,to:Q,page:re,limit:te}),[ve,me,K,J,ge,Y,Q,re,te]),Se=(0,O.I)({queryKey:["admin","errors",de?"external":"local",ye],queryFn:()=>de?async function(e){return(await A.Ay.get("/admin/errors/external",{params:e})).data}(ye):async function(e){return(await A.Ay.get("/admin/errors",{params:e})).data}(ye),keepPreviousData:!0,staleTime:1e4});var fe,ze,Te;fe=ae,ze=1e4,Te=()=>Se.refetch(),(0,t.useEffect)(()=>{if(!fe)return;const e=setInterval(Te,ze);return()=>clearInterval(e)},[fe,ze,Te]);const[we,Ce]=(0,t.useState)(null);(0,t.useEffect)(()=>{if(!oe.isOpen||null==le)return;let e=!1;return(async()=>{try{const r=de?await async function(e){return(await A.Ay.get("/admin/errors/external/".concat(e))).data}(le):await async function(e){return(await A.Ay.get("/admin/errors/".concat(e))).data}(le);e||Ce(r)}catch(r){}})(),()=>{e=!0}},[oe.isOpen,le,de]),(0,t.useEffect)(()=>{(async()=>{try{const e=await(0,I.rC)(),r=null===e||void 0===e?void 0:e.error_review_ui_url;r&&je(r)}catch(e){}})()},[]);const be=(0,a.dU)("white","gray.800"),Ee=(0,a.dU)("gray.200","gray.700"),ke=(0,a.dU)("gray.50","gray.700"),De=(0,a.dU)("gray.200","gray.600");return(0,P.jsx)(W.A,{children:(0,P.jsxs)(j.a,{maxW:"1400px",mx:"auto",children:[(0,P.jsxs)(o.z,{justify:"space-between",mb:6,align:"center",children:[(0,P.jsx)(u.D,{size:"lg",children:"Chyby a v\xfdjimky"}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(p.S,{isChecked:ae,onChange:e=>ie(e.target.checked),children:"Auto\u2011refresh"}),(0,P.jsx)(g.K,{"aria-label":"Refresh",icon:(0,P.jsx)(_,{}),size:"sm",onClick:()=>Se.refetch(),isLoading:Se.isRefetching}),(0,P.jsx)(p.S,{isChecked:de,onChange:e=>he(e.target.checked),children:"Extern\xed zdroj"}),xe?(0,P.jsx)(h.$,{as:"a",href:xe,target:"_blank",rel:"noreferrer",size:"sm",variant:"outline",children:"Konzole"}):null]})]}),(0,P.jsxs)(m.T,{align:"stretch",spacing:4,mb:4,children:[(0,P.jsxs)(o.z,{children:[(0,P.jsxs)(v.l,{placeholder:"P\u016fvod (origin)",value:q,onChange:e=>N(e.target.value),maxW:"220px",children:[(0,P.jsx)("option",{value:"frontend",children:"frontend"}),(0,P.jsx)("option",{value:"backend",children:"backend"}),(0,P.jsx)("option",{value:"docker",children:"docker"})]}),(0,P.jsxs)(v.l,{placeholder:"Z\xe1va\u017enost",value:Z,onChange:e=>H(e.target.value),maxW:"200px",children:[(0,P.jsx)("option",{value:"fatal",children:"fatal"}),(0,P.jsx)("option",{value:"error",children:"error"}),(0,P.jsx)("option",{value:"warn",children:"warn"})]}),(0,P.jsxs)(v.l,{placeholder:"Metoda",value:K,onChange:e=>F(e.target.value),maxW:"160px",children:[(0,P.jsx)("option",{value:"GET",children:"GET"}),(0,P.jsx)("option",{value:"POST",children:"POST"}),(0,P.jsx)("option",{value:"PUT",children:"PUT"}),(0,P.jsx)("option",{value:"PATCH",children:"PATCH"}),(0,P.jsx)("option",{value:"DELETE",children:"DELETE"})]}),(0,P.jsx)(y.p,{placeholder:"Status",value:J,onChange:e=>G(e.target.value),maxW:"120px"}),(0,P.jsx)(y.p,{placeholder:"Hledat zpr\xe1va/stack/url",value:V,onChange:e=>X(e.target.value)})]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(L.A,{from:Y?Y.slice(0,10):void 0,to:Q?Q.slice(0,10):void 0,onChange:(e,r)=>{const n=(e||"").trim(),t=(r||"").trim();B(n?"".concat(n,"T00:00"):""),ee(t?"".concat(t,"T23:59"):""),ne(1)},size:"sm"}),(0,P.jsx)(v.l,{value:te,onChange:e=>se(parseInt(e.target.value||"20",10)),maxW:"140px",children:[20,50,100,200].map(e=>(0,P.jsxs)("option",{value:e,children:[e,"/strana"]},e))}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(h.$,{size:"sm",onClick:()=>{ne(1),Se.refetch()},children:"Filtr"}),(0,P.jsx)(h.$,{size:"sm",variant:"outline",onClick:()=>{N(""),H(""),F(""),G(""),X(""),B(""),ee(""),ne(1),pe(!1)},children:"Reset"}),(0,P.jsx)(p.S,{isChecked:ue,onChange:e=>pe(e.target.checked),children:"Pouze podpora"})]})]})]}),(0,P.jsx)(j.a,{bg:be,borderWidth:"1px",borderColor:Ee,borderRadius:"lg",overflow:"hidden",children:(0,P.jsxs)(S.X,{size:"sm",children:[(0,P.jsx)(f.d,{children:(0,P.jsxs)(s.Tr,{children:[(0,P.jsx)(z.Th,{children:"\u010cas"}),(0,P.jsx)(z.Th,{children:"Sev."}),(0,P.jsx)(z.Th,{children:"P\u016fvod"}),(0,P.jsx)(z.Th,{children:"Zpr\xe1va"}),(0,P.jsx)(z.Th,{children:"Metoda"}),(0,P.jsx)(z.Th,{children:"URL"}),(0,P.jsx)(z.Th,{children:"Status"}),(0,P.jsx)(z.Th,{children:"Request ID"}),(0,P.jsx)(z.Th,{children:"Tagy"})]})}),(0,P.jsx)(T.N,{children:Se.isLoading?(0,P.jsx)(s.Tr,{children:(0,P.jsx)(i.Td,{colSpan:9,children:(0,P.jsxs)(o.z,{children:[(0,P.jsx)(w.y,{size:"sm"}),(0,P.jsx)(c.E,{children:"Na\u010d\xedt\xe1m..."})]})})}):null!==(e=Se.data)&&void 0!==e&&null!==(r=e.items)&&void 0!==r&&r.length?Se.data.items.map(e=>(0,P.jsx)(R,{ev:e,onOpenDetail:e=>{ce(e),oe.onOpen()}},e.id)):(0,P.jsx)(s.Tr,{children:(0,P.jsx)(i.Td,{colSpan:9,children:(0,P.jsx)(c.E,{color:"gray.500",children:"\u017d\xe1dn\xe9 chyby"})})})})]})}),(0,P.jsxs)(o.z,{justify:"space-between",mt:4,children:[(0,P.jsxs)(c.E,{color:"gray.500",children:["Celkem: ",null!==(n=null===(U=Se.data)||void 0===U?void 0:U.total)&&void 0!==n?n:0]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(h.$,{size:"sm",onClick:()=>ne(e=>Math.max(1,e-1)),isDisabled:1===re,children:"P\u0159edchoz\xed"}),(0,P.jsxs)(c.E,{children:["Strana ",re]}),(0,P.jsx)(h.$,{size:"sm",onClick:()=>ne(e=>e+1),isDisabled:((null===($=Se.data)||void 0===$||null===(M=$.items)||void 0===M?void 0:M.length)||0){const e=new Date,r=new Date;r.setHours(0,0,0,0),B(r.toISOString().slice(0,16)),ee(e.toISOString().slice(0,16)),ne(1)},children:"Dnes"}),(0,P.jsx)(h.$,{size:"xs",variant:"outline",onClick:()=>{const e=new Date,r=new Date(e.getTime()-864e5);B(r.toISOString().slice(0,16)),ee(e.toISOString().slice(0,16)),ne(1)},children:"24 h"}),(0,P.jsx)(h.$,{size:"xs",variant:"outline",onClick:()=>{const e=new Date,r=new Date(e.getTime()-6048e5);B(r.toISOString().slice(0,16)),ee(e.toISOString().slice(0,16)),ne(1)},children:"7 dn\xed"}),(0,P.jsx)(h.$,{size:"xs",variant:"ghost",onClick:()=>{B(""),ee("")},children:"Vymazat"})]}),(0,P.jsxs)(C._s,{isOpen:oe.isOpen,placement:"right",onClose:oe.onClose,size:"lg",children:[(0,P.jsx)(b.m,{}),(0,P.jsxs)(E.z,{children:[(0,P.jsx)(k.r,{children:"Detail chyby"}),(0,P.jsx)(D.c,{children:null==le?null:we?(0,P.jsxs)(m.T,{align:"stretch",spacing:3,children:[(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"\u010cas:"}),(0,P.jsx)(c.E,{children:new Date(we.occurred_at||we.created_at).toLocaleString()})]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"P\u016fvod:"}),(0,P.jsx)(c.E,{children:we.origin})]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"Z\xe1va\u017enost:"}),(0,P.jsx)(l.E,{children:we.severity||"error"})]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"URL:"}),(0,P.jsxs)(c.E,{children:[we.method," ",we.url]})]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"Status:"}),(0,P.jsx)(c.E,{children:we.status||""})]}),(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"Request ID:"}),(0,P.jsx)(d.C,{children:we.request_id||""})]}),(()=>{let e=we.tags;try{"string"===typeof e&&(e=JSON.parse(e))}catch(r){}return e?(0,P.jsxs)(o.z,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",children:"Tagy:"}),Object.entries(e).map(e=>{let[r,n]=e;return(0,P.jsxs)(l.E,{colorScheme:"type"===r&&"support"===n?"purple":"gray",children:[String(r),"=",String(n)]},r)})]}):null})(),(e=>{let r=we.context;try{"string"===typeof r&&(r=JSON.parse(r))}catch(t){}const n=null===(e=r)||void 0===e?void 0:e.recentActions;return n?(0,P.jsxs)(j.a,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",mb:1,children:"Posledn\xed akce"}),(0,P.jsx)(j.a,{bg:ke,borderWidth:"1px",borderColor:De,borderRadius:"md",p:2,maxH:"220px",overflowY:"auto",children:(Array.isArray(n)?n:[]).map((e,r)=>{var n;return(0,P.jsxs)(c.E,{fontFamily:"mono",fontSize:"xs",children:[new Date(e.at||Date.now()).toLocaleTimeString()," ","nav"===e.type?"NAV ".concat(e.path):"".concat((e.method||"").toUpperCase()," ").concat(e.url," ").concat(null!==(n=e.status)&&void 0!==n?n:""," ").concat(e.ms?e.ms+"ms":"")]},r)})})]}):null})(),(0,P.jsxs)(j.a,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",mb:1,children:"Zpr\xe1va"}),(0,P.jsx)(d.C,{whiteSpace:"pre-wrap",width:"100%",p:2,children:we.message})]}),we.stack?(0,P.jsxs)(j.a,{children:[(0,P.jsx)(c.E,{fontWeight:"bold",mb:1,children:"Stack"}),(0,P.jsx)(d.C,{whiteSpace:"pre",width:"100%",p:2,display:"block",children:we.stack})]}):null]}):(0,P.jsxs)(o.z,{children:[(0,P.jsx)(w.y,{size:"sm"}),(0,P.jsx)(c.E,{children:"Na\u010d\xedt\xe1n\xed\u2026"})]})})]})]})]})})}}}]); //# sourceMappingURL=548.da462cb8.chunk.js.map