nestlens 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/dashboard-server.js +60 -6
- package/dist/dashboard/public/assets/{BatchDetailView-BGIncdDY.js → BatchDetailView-DQf7rhdt.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-ugxH2v0z.js → BatchesPage-W8k8XEu3.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-DszaZXmk.js → CacheDetailView-D1W5C-eK.js} +1 -1
- package/dist/dashboard/public/assets/{CachePage-tk4-Mzj-.js → CachePage-CwEDXyxJ.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-oe6WXq6m.js → CommandDetailView-DKQLM96e.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-BT5pa5B8.js → CommandsPage-B4XMyz_K.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-djrkphpR.js → CopyButton-DfPqcshv.js} +1 -1
- package/dist/dashboard/public/assets/{DashboardPage-D0ukXtDo.js → DashboardPage-Ce497zS8.js} +1 -1
- package/dist/dashboard/public/assets/{DataTable-CDqXyed8.js → DataTable-Cz2phOFe.js} +1 -1
- package/dist/dashboard/public/assets/{DetailRow-CWJp1tTe.js → DetailRow-DKG3Vf9j.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-BMkCXdx-.js → DumpDetailView-BU9RRxWv.js} +1 -1
- package/dist/dashboard/public/assets/{DumpsPage-C0_N90Tx.js → DumpsPage-ldSDznQa.js} +1 -1
- package/dist/dashboard/public/assets/{EntryDetailPage-Dw2pcYO2.js → EntryDetailPage-BdBZLbAf.js} +3 -3
- package/dist/dashboard/public/assets/{EntrySearchInput-BGWM929F.js → EntrySearchInput-BF9N_f7y.js} +1 -1
- package/dist/dashboard/public/assets/{EventDetailView-CqLCbVkJ.js → EventDetailView-CmV2uByp.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage-CRGB2aCi.js → EventsPage-TlQQA-mn.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-Dq8Di5sK.js → ExceptionDetailView-B5aRNZz5.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionsPage-CA8ilfoK.js → ExceptionsPage-DqiQXiJK.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-DYDLxDRn.js → GateDetailView-BPd0sJpT.js} +1 -1
- package/dist/dashboard/public/assets/{GatesPage-Do-qOR5X.js → GatesPage-D4s1Ogo-.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLDetailView-BFwIn1GM.js → GraphQLDetailView-Dd_pgjdZ.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLPage-CNWITXJX.js → GraphQLPage-AOD9WXa5.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientDetailView-BgYy7Ucb.js → HttpClientDetailView-CR7RujPI.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientPage-BJd_ibF6.js → HttpClientPage-CUNDLZdF.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-B3psHOxq.js → JobDetailView-C3U9nJFo.js} +1 -1
- package/dist/dashboard/public/assets/{JobsPage-DAdrYeU-.js → JobsPage-DX0A5Til.js} +1 -1
- package/dist/dashboard/public/assets/{LogDetailView-BealPvcV.js → LogDetailView-V_x94h-I.js} +1 -1
- package/dist/dashboard/public/assets/{LogsPage-CCwjLuWQ.js → LogsPage-Cvrcv7tq.js} +1 -1
- package/dist/dashboard/public/assets/{MailDetailView-CM54VOlh.js → MailDetailView-CYCQI9Z8.js} +1 -1
- package/dist/dashboard/public/assets/{MailPage-CdiZI_hh.js → MailPage-BZbVLHHN.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-B8KVVw2M.js → ModelDetailView-CUEA5nRD.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-0-jYL1-U.js → ModelsPage-CKUeCZLn.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-0VYorYuc.js → NotificationDetailView-CT4EIDa3.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-szMmustZ.js → NotificationsPage-CVnjoHST.js} +1 -1
- package/dist/dashboard/public/assets/{PageHeader-9OQepDeQ.js → PageHeader-DR_M5h7z.js} +1 -1
- package/dist/dashboard/public/assets/{QueriesPage-BJfywln6.js → QueriesPage-DR3EHxfO.js} +1 -1
- package/dist/dashboard/public/assets/{QueryDetailView-BRe55CUs.js → QueryDetailView-dWmmR_nP.js} +1 -1
- package/dist/dashboard/public/assets/{RedisDetailView-BZ8zYVsk.js → RedisDetailView-PALK5x6N.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-CHxk1zKp.js → RedisPage-D-9y0o0o.js} +1 -1
- package/dist/dashboard/public/assets/{RequestDetailView-BT568MaZ.js → RequestDetailView-DiS1WZ4m.js} +1 -1
- package/dist/dashboard/public/assets/{RequestsPage-BPeHtBRn.js → RequestsPage-CCSIr_jW.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-OG--Lyzr.js → ScheduleDetailView-G86hV8Ed.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-uM09HkqS.js → SchedulePage-CQVmVvYe.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-CfcScmF8.js → UserCard-Bp6Bf3OI.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-CcWB9bLw.js → ViewDetailView-D-dBm6G6.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-L56Rz7jz.js → ViewsPage-ErK5Vmy0.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-B4UUBe_A.js → calendar-BfDDUQSW.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-s9ODnOC3.js → circle-alert-DJ_9D_4c.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-C4ws6-wY.js → circle-check-big-CiGeQW9J.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-D14U2UWr.js → circle-x-B-V5s-zK.js} +1 -1
- package/dist/dashboard/public/assets/{eye-CIA_cZlW.js → eye-LljylR_O.js} +1 -1
- package/dist/dashboard/public/assets/{index-dkeMTrq0.js → index-HxcGVcSo.js} +2 -2
- package/dist/dashboard/public/assets/{search-C0XvQMrJ.js → search-VPXcw9Ki.js} +1 -1
- package/dist/dashboard/public/assets/{send-CTeWfM1I.js → send-CdCk9jQ5.js} +1 -1
- package/dist/dashboard/public/assets/{timer-BVP3d7zc.js → timer-I7o5QV6X.js} +1 -1
- package/dist/dashboard/public/assets/{types-CuCQ6L2Z.js → types-BMBEhoQ2.js} +1 -1
- package/dist/dashboard/public/assets/{users-UyMivszP.js → users-CFzKwpf2.js} +1 -1
- package/dist/dashboard/public/assets/{zap-CAbVWiHg.js → zap-DMB3w7zm.js} +1 -1
- package/dist/dashboard/public/index.html +1 -1
- package/dist/watchers/graphql/adapters/apollo.adapter.js +19 -1
- package/dist/watchers/graphql/graphql.watcher.d.ts +7 -0
- package/dist/watchers/graphql/graphql.watcher.js +34 -0
- package/dist/watchers/http-client.watcher.js +14 -1
- package/package.json +7 -1
package/dist/dashboard/public/assets/{RequestDetailView-BT568MaZ.js → RequestDetailView-DiS1WZ4m.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,i as f}from"./index-dkeMTrq0.js";import{b,L as p}from"./vendor-DBTT3jXp.js";import{f as q,p as k}from"./date-Dwgqy666.js";import{D as y,f as R}from"./DetailRow-CWJp1tTe.js";import{b as D,c as L,a as H,d as U,e as V,f as O,g as F,C as x,B as E}from"./types-CuCQ6L2Z.js";import{u as M,T as S,C as v}from"./EntryDetailPage-Dw2pcYO2.js";import{U as I}from"./UserCard-CfcScmF8.js";import"./search-C0XvQMrJ.js";function j(r){return r<1?"<1 ms":r<1e3?`${r.toFixed(2)} ms`:`${(r/1e3).toFixed(2)} s`}function w(r,s){return r.length<=s?r:r.substring(0,s)+"..."}function J({entries:r}){const s=b.useMemo(()=>{const a=r.filter(o=>D(o)),d=r.filter(o=>L(o)),c=r.filter(o=>H(o)),m=r.filter(o=>U(o)),n=r.filter(o=>V(o)),h=r.filter(o=>O(o)),u=r.filter(o=>F(o));return{exceptions:a,logs:d,queries:c,events:m,jobs:n,cache:h,mail:u}},[r]),t=b.useMemo(()=>[{id:"exceptions",label:"Exceptions",entries:s.exceptions,color:"bg-red-500"},{id:"logs",label:"Logs",entries:s.logs,color:"bg-blue-500"},{id:"queries",label:"Queries",entries:s.queries,color:"bg-purple-500"},{id:"events",label:"Events",entries:s.events,color:"bg-green-500"},{id:"jobs",label:"Jobs",entries:s.jobs,color:"bg-yellow-500"},{id:"cache",label:"Cache",entries:s.cache,color:"bg-cyan-500"},{id:"mail",label:"Mail",entries:s.mail,color:"bg-pink-500"}].filter(d=>d.entries.length>0),[s]),[l,i]=b.useState(()=>s.exceptions.length>0?"exceptions":s.logs.length>0?"logs":s.queries.length>0?"queries":s.events.length>0?"events":s.jobs.length>0?"jobs":s.cache.length>0?"cache":s.mail.length>0?"mail":"queries"),g=b.useMemo(()=>{if(s.queries.length===0)return null;const a=s.queries.reduce((m,n)=>m+n.payload.duration,0),d=new Set(s.queries.map(m=>m.payload.query)).size,c=s.queries.length-d;return{total:a,duplicates:c}},[s.queries]);return t.length===0?null:e.jsxs("div",{className:"card overflow-hidden",children:[e.jsx("div",{className:"flex flex-wrap gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.map(a=>e.jsxs("button",{onClick:()=>i(a.id),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${l===a.id?"bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[a.label,e.jsx("span",{className:`inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-medium rounded ${l===a.id?"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300":"bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-400"}`,children:a.entries.length})]},a.id))}),e.jsxs("div",{children:[l==="queries"&&s.queries.length>0&&e.jsxs("div",{children:[g&&e.jsxs("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800/50 text-sm text-gray-600 dark:text-gray-400 flex justify-between",children:[e.jsxs("span",{children:[s.queries.length," queries, ",g.duplicates," of which are duplicated"]}),e.jsxs("span",{children:["Total: ",e.jsx("strong",{children:j(g.total)})]})]}),e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.queries.map(a=>e.jsxs(p,{to:`/queries/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate flex-1 mr-4",children:w(a.payload.query,70)}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.slow&&e.jsx(x,{listType:"queries",children:"SLOW"}),e.jsx("span",{className:`text-sm font-mono ${a.payload.slow?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400"}`,children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]}),l==="exceptions"&&s.exceptions.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.exceptions.map(a=>e.jsx(p,{to:`/exceptions/${a.id}`,className:"block px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{listType:"exceptions",filterType:"names",filterValue:a.payload.name,children:a.payload.name}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:w(a.payload.message,60)})]}),a.payload.context&&e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-500 mt-1",children:["at ",a.payload.context]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]})},a.id))}),l==="logs"&&s.logs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.logs.map(a=>e.jsxs(p,{to:`/logs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"logs",filterType:"levels",filterValue:a.payload.level,children:a.payload.level.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.message,60)}),a.payload.context&&e.jsx(x,{listType:"logs",filterType:"contexts",filterValue:a.payload.context,className:"text-xs",children:a.payload.context})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="events"&&s.events.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.events.map(a=>e.jsxs(p,{to:`/events/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"events",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:[a.payload.listeners.length," listener(s)"]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="jobs"&&s.jobs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.jobs.map(a=>e.jsxs(p,{to:`/jobs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"jobs",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["on ",a.payload.queue]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.duration!==void 0&&e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="cache"&&s.cache.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.cache.map(a=>e.jsxs(p,{to:`/cache/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"cache",filterType:"operations",filterValue:a.payload.operation,children:a.payload.operation.toUpperCase()}),e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.key,50)}),a.payload.hit!==void 0&&e.jsx(x,{listType:"cache",clickable:!1,children:a.payload.hit?"HIT":"MISS"})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="mail"&&s.mail.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.mail.map(a=>e.jsxs(p,{to:`/mail/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"mail",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:a.payload.subject}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["to ",Array.isArray(a.payload.to)?a.payload.to.join(", "):a.payload.to]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]})]})}const K={request:"bg-blue-500",query:"bg-purple-500",graphql:"bg-fuchsia-500",exception:"bg-red-500",log:"bg-green-500",job:"bg-yellow-500",schedule:"bg-gray-500",batch:"bg-lime-500",command:"bg-slate-500",cache:"bg-cyan-500",redis:"bg-rose-500",model:"bg-violet-500","http-client":"bg-indigo-500",mail:"bg-orange-500",notification:"bg-pink-500",view:"bg-teal-500",gate:"bg-amber-500",dump:"bg-emerald-500",event:"bg-sky-500"},$=r=>r<1?"<1ms":r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,P=["query","operationName","key","url","path","name","message","command","operation"],Q=r=>{const s=r.payload,l=(P.map(i=>s[i]).find(i=>typeof i=="string"&&i.trim().length>0)??r.type).replace(/\s+/g," ").trim();return l.length>70?`${l.slice(0,70)}…`:l};function z({request:r,related:s}){const{spans:t,window:l}=b.useMemo(()=>{const g=[r,...s].map(n=>{const h=k(n.createdAt).getTime(),u=Number(n.payload.duration??0),o=Number.isFinite(u)&&u>0?u:0;return{entry:n,offset:h-o,duration:o,label:Q(n)}}),a=g.map(n=>n.offset),d=g.map(n=>n.offset+n.duration),c=Math.min(...a),m=Math.max(...d);return{window:Math.max(1,m-c),spans:g.map(n=>({...n,offset:n.offset-c})).sort((n,h)=>n.offset-h.offset||n.duration-h.duration)}},[r,s]);return t.length<=1?null:e.jsxs("div",{className:"card overflow-hidden","data-testid":"request-timeline",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Timeline"}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.length," entries over ",$(l)]})]}),e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:t.map(i=>{const g=Math.min(Math.max(i.duration/l*100,.75),100),a=Math.min(i.offset/l*100,100-g),d=K[i.entry.type]??"bg-gray-400";return e.jsxs(p,{to:`/entries/${i.entry.id}`,className:"flex items-center gap-3 px-4 py-2 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",children:[e.jsx("span",{className:"w-24 shrink-0 text-xs font-medium text-gray-500 dark:text-gray-400 capitalize",children:i.entry.type}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-mono text-gray-700 dark:text-gray-300 truncate",title:i.label,children:i.label}),e.jsx("span",{className:"relative w-1/2 shrink-0 h-4 rounded bg-gray-100 dark:bg-gray-800",children:e.jsx("span",{className:`absolute top-0 h-full rounded ${d}`,style:{left:`${a}%`,width:`${g}%`},"data-testid":"timeline-bar"})}),e.jsx("span",{className:"w-16 shrink-0 text-right text-xs tabular-nums text-gray-500 dark:text-gray-400",children:i.duration>0?$(i.duration):""})]},`${i.entry.type}-${i.entry.id}`)})})]})}function G(r){if(r===0)return"0 B";const s=1024,t=["B","KB","MB","GB"],l=Math.floor(Math.log(r)/Math.log(s));return`${parseFloat((r/Math.pow(s,l)).toFixed(1))} ${t[l]}`}function _(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}function W(r,s){if(s){const t=Object.keys(s).find(l=>l.toLowerCase()==="host");if(t&&s[t])return s[t]}try{return new URL(r).host}catch{return"-"}}function X(r,s){return r!=null&&r.toLowerCase().includes("/graphql")?"GRAPHQL":s.toUpperCase()}function ie({entry:r,related:s=[]}){const{payload:t,createdAt:l}=r,i=W(t.url,t.headers),g=X(t.path,t.method),a=(r.tags??[]).filter(A=>A.toUpperCase()!==g),d=M(),c=M(),[m,n]=b.useState("payload"),[h,u]=b.useState("response"),o={};t.body&&(o.body=t.body),t.query&&Object.keys(t.query).length>0&&(o.query=t.query),t.params&&Object.keys(t.params).length>0&&(o.params=t.params);const T={payload:Object.keys(o).length>0?o:{},headers:t.headers||{}},N={response:t.responseBody||{},"response-headers":t.responseHeaders??{},session:t.session&&Object.keys(t.session).length>0?t.session:{}},C=[{id:"payload",label:"Payload",content:e.jsx(v,{data:T.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})},{id:"headers",label:"Headers",content:e.jsx(v,{data:T.headers,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}],B=[{id:"response",label:"Response",content:e.jsx(v,{data:N.response,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"response-headers",label:"Headers",content:e.jsx(v,{data:N["response-headers"],toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"session",label:"Session",content:e.jsx(v,{data:N.session,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Request Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(y,{label:"Time",value:e.jsxs("span",{children:[R(k(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",q(k(l),{addSuffix:!0}),")"]})]})}),e.jsx(y,{label:"Hostname",value:i!=="-"?e.jsx(x,{listType:"requests",filterType:"hostnames",filterValue:i,className:"font-mono",children:i}):"-"}),t.controllerAction&&e.jsx(y,{label:"Controller Action",value:e.jsx(x,{listType:"requests",filterType:"controllers",filterValue:t.controllerAction,className:"font-mono",children:t.controllerAction})}),e.jsx(y,{label:"Path",value:e.jsx(x,{listType:"requests",filterType:"paths",filterValue:t.path,className:"font-mono",children:t.path})}),e.jsx(y,{label:"Status",value:t.statusCode?e.jsx(x,{listType:"requests",filterType:"statuses",filterValue:String(t.statusCode),children:String(t.statusCode)}):"-"}),e.jsx(y,{label:"Duration",value:t.duration!==void 0?e.jsx("span",{className:t.duration>1e3?"text-yellow-600 dark:text-yellow-400 font-medium":"",children:_(t.duration)}):"-"}),e.jsx(y,{label:"IP Address",value:t.ip?e.jsx(x,{listType:"requests",filterType:"ips",filterValue:t.ip,className:"font-mono",children:t.ip}):"-"}),t.userAgent&&e.jsx(y,{label:"User Agent",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.userAgent})}),t.handler&&t.handler!==t.controllerAction&&e.jsx(y,{label:"Handler",value:e.jsx("code",{className:"font-mono text-sm",children:t.handler})}),t.memory!==void 0&&e.jsx(y,{label:"Memory Usage",value:G(t.memory)}),a.length>0&&e.jsx(y,{label:"Tags",value:e.jsx(E,{items:a,listType:"requests",maxItems:99})})]})})]}),t.user&&e.jsx(I,{user:t.user}),e.jsx(S,{tabs:C,defaultTab:"payload",hashKey:"req",headerRight:e.jsx(d.Toolbar,{data:T[m]}),onTabChange:n}),e.jsx(S,{tabs:B,defaultTab:"response",hashKey:"res",headerRight:e.jsx(c.Toolbar,{data:N[h]}),onTabChange:u}),e.jsx(z,{request:r,related:s}),e.jsx(J,{entries:s})]})}export{ie as default};
|
|
1
|
+
import{j as e,i as f}from"./index-HxcGVcSo.js";import{b,L as p}from"./vendor-DBTT3jXp.js";import{f as q,p as k}from"./date-Dwgqy666.js";import{D as y,f as R}from"./DetailRow-DKG3Vf9j.js";import{b as D,c as L,a as H,d as U,e as V,f as O,g as F,C as x,B as E}from"./types-BMBEhoQ2.js";import{u as M,T as S,C as v}from"./EntryDetailPage-BdBZLbAf.js";import{U as I}from"./UserCard-Bp6Bf3OI.js";import"./search-VPXcw9Ki.js";function j(r){return r<1?"<1 ms":r<1e3?`${r.toFixed(2)} ms`:`${(r/1e3).toFixed(2)} s`}function w(r,s){return r.length<=s?r:r.substring(0,s)+"..."}function J({entries:r}){const s=b.useMemo(()=>{const a=r.filter(o=>D(o)),d=r.filter(o=>L(o)),c=r.filter(o=>H(o)),m=r.filter(o=>U(o)),n=r.filter(o=>V(o)),h=r.filter(o=>O(o)),u=r.filter(o=>F(o));return{exceptions:a,logs:d,queries:c,events:m,jobs:n,cache:h,mail:u}},[r]),t=b.useMemo(()=>[{id:"exceptions",label:"Exceptions",entries:s.exceptions,color:"bg-red-500"},{id:"logs",label:"Logs",entries:s.logs,color:"bg-blue-500"},{id:"queries",label:"Queries",entries:s.queries,color:"bg-purple-500"},{id:"events",label:"Events",entries:s.events,color:"bg-green-500"},{id:"jobs",label:"Jobs",entries:s.jobs,color:"bg-yellow-500"},{id:"cache",label:"Cache",entries:s.cache,color:"bg-cyan-500"},{id:"mail",label:"Mail",entries:s.mail,color:"bg-pink-500"}].filter(d=>d.entries.length>0),[s]),[l,i]=b.useState(()=>s.exceptions.length>0?"exceptions":s.logs.length>0?"logs":s.queries.length>0?"queries":s.events.length>0?"events":s.jobs.length>0?"jobs":s.cache.length>0?"cache":s.mail.length>0?"mail":"queries"),g=b.useMemo(()=>{if(s.queries.length===0)return null;const a=s.queries.reduce((m,n)=>m+n.payload.duration,0),d=new Set(s.queries.map(m=>m.payload.query)).size,c=s.queries.length-d;return{total:a,duplicates:c}},[s.queries]);return t.length===0?null:e.jsxs("div",{className:"card overflow-hidden",children:[e.jsx("div",{className:"flex flex-wrap gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:t.map(a=>e.jsxs("button",{onClick:()=>i(a.id),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${l===a.id?"bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow-sm":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[a.label,e.jsx("span",{className:`inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-medium rounded ${l===a.id?"bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300":"bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-400"}`,children:a.entries.length})]},a.id))}),e.jsxs("div",{children:[l==="queries"&&s.queries.length>0&&e.jsxs("div",{children:[g&&e.jsxs("div",{className:"px-4 py-2 bg-gray-100 dark:bg-gray-800/50 text-sm text-gray-600 dark:text-gray-400 flex justify-between",children:[e.jsxs("span",{children:[s.queries.length," queries, ",g.duplicates," of which are duplicated"]}),e.jsxs("span",{children:["Total: ",e.jsx("strong",{children:j(g.total)})]})]}),e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.queries.map(a=>e.jsxs(p,{to:`/queries/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate flex-1 mr-4",children:w(a.payload.query,70)}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.slow&&e.jsx(x,{listType:"queries",children:"SLOW"}),e.jsx("span",{className:`text-sm font-mono ${a.payload.slow?"text-yellow-600 dark:text-yellow-400":"text-gray-500 dark:text-gray-400"}`,children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]}),l==="exceptions"&&s.exceptions.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.exceptions.map(a=>e.jsx(p,{to:`/exceptions/${a.id}`,className:"block px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(x,{listType:"exceptions",filterType:"names",filterValue:a.payload.name,children:a.payload.name}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400 truncate",children:w(a.payload.message,60)})]}),a.payload.context&&e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-500 mt-1",children:["at ",a.payload.context]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]})},a.id))}),l==="logs"&&s.logs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.logs.map(a=>e.jsxs(p,{to:`/logs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"logs",filterType:"levels",filterValue:a.payload.level,children:a.payload.level.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.message,60)}),a.payload.context&&e.jsx(x,{listType:"logs",filterType:"contexts",filterValue:a.payload.context,className:"text-xs",children:a.payload.context})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:q(k(a.createdAt),{addSuffix:!0})}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="events"&&s.events.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.events.map(a=>e.jsxs(p,{to:`/events/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"events",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:[a.payload.listeners.length," listener(s)"]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="jobs"&&s.jobs.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.jobs.map(a=>e.jsxs(p,{to:`/jobs/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"jobs",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:a.payload.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["on ",a.payload.queue]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[a.payload.duration!==void 0&&e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="cache"&&s.cache.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.cache.map(a=>e.jsxs(p,{to:`/cache/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"cache",filterType:"operations",filterValue:a.payload.operation,children:a.payload.operation.toUpperCase()}),e.jsx("code",{className:"text-sm font-mono text-gray-700 dark:text-gray-300 truncate",children:w(a.payload.key,50)}),a.payload.hit!==void 0&&e.jsx(x,{listType:"cache",clickable:!1,children:a.payload.hit?"HIT":"MISS"})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))}),l==="mail"&&s.mail.length>0&&e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:s.mail.map(a=>e.jsxs(p,{to:`/mail/${a.id}`,className:"flex items-center justify-between px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors group",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 mr-4",children:[e.jsx(x,{listType:"mail",filterType:"statuses",filterValue:a.payload.status,children:a.payload.status.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:a.payload.subject}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-500",children:["to ",Array.isArray(a.payload.to)?a.payload.to.join(", "):a.payload.to]})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[e.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:j(a.payload.duration)}),e.jsx(f,{className:"h-4 w-4 text-gray-400 group-hover:text-gray-600 dark:group-hover:text-gray-300"})]})]},a.id))})]})]})}const K={request:"bg-blue-500",query:"bg-purple-500",graphql:"bg-fuchsia-500",exception:"bg-red-500",log:"bg-green-500",job:"bg-yellow-500",schedule:"bg-gray-500",batch:"bg-lime-500",command:"bg-slate-500",cache:"bg-cyan-500",redis:"bg-rose-500",model:"bg-violet-500","http-client":"bg-indigo-500",mail:"bg-orange-500",notification:"bg-pink-500",view:"bg-teal-500",gate:"bg-amber-500",dump:"bg-emerald-500",event:"bg-sky-500"},$=r=>r<1?"<1ms":r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,P=["query","operationName","key","url","path","name","message","command","operation"],Q=r=>{const s=r.payload,l=(P.map(i=>s[i]).find(i=>typeof i=="string"&&i.trim().length>0)??r.type).replace(/\s+/g," ").trim();return l.length>70?`${l.slice(0,70)}…`:l};function z({request:r,related:s}){const{spans:t,window:l}=b.useMemo(()=>{const g=[r,...s].map(n=>{const h=k(n.createdAt).getTime(),u=Number(n.payload.duration??0),o=Number.isFinite(u)&&u>0?u:0;return{entry:n,offset:h-o,duration:o,label:Q(n)}}),a=g.map(n=>n.offset),d=g.map(n=>n.offset+n.duration),c=Math.min(...a),m=Math.max(...d);return{window:Math.max(1,m-c),spans:g.map(n=>({...n,offset:n.offset-c})).sort((n,h)=>n.offset-h.offset||n.duration-h.duration)}},[r,s]);return t.length<=1?null:e.jsxs("div",{className:"card overflow-hidden","data-testid":"request-timeline",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Timeline"}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.length," entries over ",$(l)]})]}),e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:t.map(i=>{const g=Math.min(Math.max(i.duration/l*100,.75),100),a=Math.min(i.offset/l*100,100-g),d=K[i.entry.type]??"bg-gray-400";return e.jsxs(p,{to:`/entries/${i.entry.id}`,className:"flex items-center gap-3 px-4 py-2 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",children:[e.jsx("span",{className:"w-24 shrink-0 text-xs font-medium text-gray-500 dark:text-gray-400 capitalize",children:i.entry.type}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-mono text-gray-700 dark:text-gray-300 truncate",title:i.label,children:i.label}),e.jsx("span",{className:"relative w-1/2 shrink-0 h-4 rounded bg-gray-100 dark:bg-gray-800",children:e.jsx("span",{className:`absolute top-0 h-full rounded ${d}`,style:{left:`${a}%`,width:`${g}%`},"data-testid":"timeline-bar"})}),e.jsx("span",{className:"w-16 shrink-0 text-right text-xs tabular-nums text-gray-500 dark:text-gray-400",children:i.duration>0?$(i.duration):""})]},`${i.entry.type}-${i.entry.id}`)})})]})}function G(r){if(r===0)return"0 B";const s=1024,t=["B","KB","MB","GB"],l=Math.floor(Math.log(r)/Math.log(s));return`${parseFloat((r/Math.pow(s,l)).toFixed(1))} ${t[l]}`}function _(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}function W(r,s){if(s){const t=Object.keys(s).find(l=>l.toLowerCase()==="host");if(t&&s[t])return s[t]}try{return new URL(r).host}catch{return"-"}}function X(r,s){return r!=null&&r.toLowerCase().includes("/graphql")?"GRAPHQL":s.toUpperCase()}function ie({entry:r,related:s=[]}){const{payload:t,createdAt:l}=r,i=W(t.url,t.headers),g=X(t.path,t.method),a=(r.tags??[]).filter(A=>A.toUpperCase()!==g),d=M(),c=M(),[m,n]=b.useState("payload"),[h,u]=b.useState("response"),o={};t.body&&(o.body=t.body),t.query&&Object.keys(t.query).length>0&&(o.query=t.query),t.params&&Object.keys(t.params).length>0&&(o.params=t.params);const T={payload:Object.keys(o).length>0?o:{},headers:t.headers||{}},N={response:t.responseBody||{},"response-headers":t.responseHeaders??{},session:t.session&&Object.keys(t.session).length>0?t.session:{}},C=[{id:"payload",label:"Payload",content:e.jsx(v,{data:T.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})},{id:"headers",label:"Headers",content:e.jsx(v,{data:T.headers,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}],B=[{id:"response",label:"Response",content:e.jsx(v,{data:N.response,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"response-headers",label:"Headers",content:e.jsx(v,{data:N["response-headers"],toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})},{id:"session",label:"Session",content:e.jsx(v,{data:N.session,toolbarState:c.state,searchBar:c.SearchBar,maxHeight:400})}];return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Request Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(y,{label:"Time",value:e.jsxs("span",{children:[R(k(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",q(k(l),{addSuffix:!0}),")"]})]})}),e.jsx(y,{label:"Hostname",value:i!=="-"?e.jsx(x,{listType:"requests",filterType:"hostnames",filterValue:i,className:"font-mono",children:i}):"-"}),t.controllerAction&&e.jsx(y,{label:"Controller Action",value:e.jsx(x,{listType:"requests",filterType:"controllers",filterValue:t.controllerAction,className:"font-mono",children:t.controllerAction})}),e.jsx(y,{label:"Path",value:e.jsx(x,{listType:"requests",filterType:"paths",filterValue:t.path,className:"font-mono",children:t.path})}),e.jsx(y,{label:"Status",value:t.statusCode?e.jsx(x,{listType:"requests",filterType:"statuses",filterValue:String(t.statusCode),children:String(t.statusCode)}):"-"}),e.jsx(y,{label:"Duration",value:t.duration!==void 0?e.jsx("span",{className:t.duration>1e3?"text-yellow-600 dark:text-yellow-400 font-medium":"",children:_(t.duration)}):"-"}),e.jsx(y,{label:"IP Address",value:t.ip?e.jsx(x,{listType:"requests",filterType:"ips",filterValue:t.ip,className:"font-mono",children:t.ip}):"-"}),t.userAgent&&e.jsx(y,{label:"User Agent",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.userAgent})}),t.handler&&t.handler!==t.controllerAction&&e.jsx(y,{label:"Handler",value:e.jsx("code",{className:"font-mono text-sm",children:t.handler})}),t.memory!==void 0&&e.jsx(y,{label:"Memory Usage",value:G(t.memory)}),a.length>0&&e.jsx(y,{label:"Tags",value:e.jsx(E,{items:a,listType:"requests",maxItems:99})})]})})]}),t.user&&e.jsx(I,{user:t.user}),e.jsx(S,{tabs:C,defaultTab:"payload",hashKey:"req",headerRight:e.jsx(d.Toolbar,{data:T[m]}),onTabChange:n}),e.jsx(S,{tabs:B,defaultTab:"response",hashKey:"res",headerRight:e.jsx(c.Toolbar,{data:N[h]}),onTabChange:u}),e.jsx(z,{request:r,related:s}),e.jsx(J,{entries:s})]})}export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,A as P,e as A}from"./index-
|
|
1
|
+
import{j as t,A as P,e as A}from"./index-HxcGVcSo.js";import{e as v,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as F}from"./date-Dwgqy666.js";import{u as L,a as H,P as S,R as G,N as B,L as I}from"./PageHeader-DR_M5h7z.js";import{u as O,i as U,C as d}from"./types-BMBEhoQ2.js";import{E as W}from"./EntrySearchInput-BF9N_f7y.js";import{T as u,D as Q,a as $,b as z}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";import"./search-VPXcw9Ki.js";const J=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"],K=r=>{var s;return(s=r.payload.path)!=null&&s.toLowerCase().includes("/graphql")?"GRAPHQL":r.payload.method.toUpperCase()};function ae(){const r=v(),{addFilter:s,clearAll:h,serverFilters:c,headerFilters:p}=O("requests"),{rangeFilters:m,windowMinutes:g}=L(),{entries:x,loading:y,refreshing:a,error:f,refresh:n,newEntriesCount:C,hasMore:j,loadMore:T,loadNew:E,autoRefreshEnabled:b,live:w,setAutoRefresh:k,meta:o,isHighlighted:R}=H({type:"request",limit:50,filters:{...c,...m},windowMinutes:g}),i=x.filter(e=>U(e)),q=D.useMemo(()=>[{key:"method",header:"Method",width:"100px",render:e=>t.jsx(d,{listType:"requests",filterType:"methods",children:K(e)})},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(u,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.path})},{key:"status",header:"Status",width:"80px",align:"center",render:e=>t.jsx(d,{listType:"requests",filterType:"statuses",children:e.payload.statusCode??0})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(Q,{ms:e.payload.duration??0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>t.jsx($,{tags:(e.tags??[]).filter(l=>!J.includes(l.toUpperCase())),max:3,onTagClick:(l,N)=>{N.stopPropagation(),s("tags",l)}})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(u,{secondary:!0,className:"text-xs",children:M(F(e.createdAt),{addSuffix:!0})})}],[s]);return y&&i.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(S,{title:"Requests",icon:P,iconColor:"text-blue-600 dark:text-blue-400",count:i.length,totalCount:o==null?void 0:o.total,clearable:{type:"request",label:"requests",onCleared:n},refreshing:a,autoRefreshEnabled:b,live:w,onAutoRefreshToggle:k,filters:p,filterControls:t.jsx(G,{route:"requests"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{placeholder:"Search by path, method, status, tag, or content..."}),t.jsx(B,{count:C,onClick:E,loading:a}),t.jsx(z,{columns:q,data:i,keyExtractor:e=>e.id,onRowClick:e=>r(`/requests/${e.id}`),emptyMessage:"No requests recorded yet",error:f,onRetry:n,emptyIcon:t.jsx(A,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"}),rowClassName:e=>R(e.id)?"highlight-new":""}),t.jsx(I,{hasMore:j,onClick:T,loading:a})]})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as b,j as e,C as n}from"./index-
|
|
1
|
+
import{O as b,j as e,C as n}from"./index-HxcGVcSo.js";import{f as a,c as N}from"./format-BlNP-apw.js";import{C as o,B as v}from"./types-BMBEhoQ2.js";import{p as l,f as m}from"./date-Dwgqy666.js";import{D as t,f as g}from"./DetailRow-DKG3Vf9j.js";import{C as u}from"./circle-x-B-V5s-zK.js";import{C as k}from"./circle-check-big-CiGeQW9J.js";import{T as w}from"./timer-I7o5QV6X.js";import{C as T}from"./calendar-BfDDUQSW.js";import"./vendor-DBTT3jXp.js";function d(i){try{return N.toString(i)}catch{return null}}const h={started:{icon:b,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30",label:"STARTED"},completed:{icon:k,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30",label:"COMPLETED"},failed:{icon:u,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30",label:"FAILED"}},C=["started","completed","failed"];function I({entry:i}){const{payload:s,createdAt:c,tags:j}=i,x=(j??[]).filter(f=>!C.includes(f.toLowerCase())),r=h[s.status]||h.started,p=r.icon,y=()=>s.cron?s.cron:s.interval?`${s.interval}ms`:"-";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(n,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white truncate font-mono",children:s.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Scheduled Task"})]})]})})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${s.status==="completed"?"text-green-600 dark:text-green-400":s.status==="failed"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"}`,children:r.label})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.duration!==void 0?e.jsxs(e.Fragment,{children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]}):"-"})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(T,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Schedule"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:y()}),s.cron&&d(s.cron)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d(s.cron)}),s.interval&&a(s.interval)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.interval)})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(n,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Timeout"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.timeout!==void 0?e.jsxs(e.Fragment,{children:[s.timeout,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]}):"-"}),s.timeout!==void 0&&a(s.timeout)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.timeout)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[g(l(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",m(l(c),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Task Name",value:e.jsx(o,{listType:"schedule",filterType:"names",filterValue:s.name,className:"font-mono",children:s.name})}),s.cron&&e.jsx(t,{label:"Cron Expression",value:e.jsxs("div",{children:[e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.cron}),d(s.cron)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d(s.cron)})]})}),s.interval&&e.jsx(t,{label:"Interval",value:e.jsxs("div",{children:[e.jsxs("span",{children:[s.interval,"ms"]}),a(s.interval)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.interval)})]})}),e.jsx(t,{label:"Status",value:e.jsx(o,{listType:"schedule",filterType:"statuses",filterValue:s.status,children:s.status})}),s.duration!==void 0&&e.jsx(t,{label:"Duration",value:`${s.duration}ms`}),s.timeout!==void 0&&e.jsx(t,{label:"Timeout",value:e.jsxs("div",{children:[e.jsxs("span",{children:[s.timeout,"ms"]}),a(s.timeout)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.timeout)})]})}),s.nextRun&&e.jsx(t,{label:"Next Run",value:e.jsxs("span",{children:[g(l(s.nextRun),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",m(l(s.nextRun),{addSuffix:!0}),")"]})]})}),x.length>0&&e.jsx(t,{label:"Tags",value:e.jsx(v,{items:x,listType:"schedule"})})]})})]}),s.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(u,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:s.error})})]})]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,C as u}from"./index-
|
|
1
|
+
import{j as a,C as u}from"./index-HxcGVcSo.js";import{e as P,b as h}from"./vendor-DBTT3jXp.js";import{f as m,c as H}from"./format-BlNP-apw.js";import{f as B,p as W}from"./date-Dwgqy666.js";import{u as $,a as I,P as q,R as z,N as G,L as J}from"./PageHeader-DR_M5h7z.js";import{u as K,h as O,C as p}from"./types-BMBEhoQ2.js";import{T as i,D as Q,a as U,b as V}from"./DataTable-Cz2phOFe.js";import"./timer-I7o5QV6X.js";const X=["started","completed","failed"];function x(t){try{return H.toString(t)}catch{return null}}function le(){const t=P(),{addFilter:n,clearAll:g,serverFilters:f,headerFilters:y}=K("schedule"),{rangeFilters:j,windowMinutes:k}=$(),{entries:C,loading:b,refreshing:s,error:w,refresh:d,newEntriesCount:N,hasMore:T,loadMore:v,loadNew:E,autoRefreshEnabled:R,live:S,setAutoRefresh:F,meta:r,isHighlighted:M}=I({type:"schedule",limit:50,filters:{...f,...j},windowMinutes:k}),l=C.filter(e=>O(e)),c=h.useCallback(e=>e.payload.cron?e.payload.cron:e.payload.interval?`${e.payload.interval}ms`:"-",[]),D=h.useMemo(()=>[{key:"task",header:"Task",minWidth:"200px",render:e=>a.jsx(p,{listType:"schedule",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"schedule",header:"Schedule",minWidth:"150px",render:e=>a.jsxs("div",{children:[a.jsx(i,{mono:!0,children:c(e)}),e.payload.cron&&x(e.payload.cron)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:x(e.payload.cron)}),e.payload.interval&&m(e.payload.interval)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:m(e.payload.interval)})]})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(p,{listType:"schedule",filterType:"statuses",children:e.payload.status})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(Q,{ms:e.payload.duration}):a.jsx(i,{secondary:!0,children:"—"})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const A=(e.tags??[]).filter(o=>!X.includes(o.toLowerCase()));return a.jsx(U,{tags:A,max:3,onTagClick:(o,L)=>{L.stopPropagation(),n("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:B(W(e.createdAt),{addSuffix:!0})})}],[n,c]);return b&&l.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(q,{title:"Schedule",icon:u,iconColor:"text-gray-600 dark:text-gray-400",count:l.length,totalCount:r==null?void 0:r.total,clearable:{type:"schedule",label:"schedule",onCleared:d},refreshing:s,autoRefreshEnabled:R,live:S,onAutoRefreshToggle:F,filters:y,filterControls:a.jsx(z,{route:"schedule"}),onClearAllFilters:g}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(G,{count:N,onClick:E,loading:s}),a.jsx(V,{columns:D,data:l,keyExtractor:e=>e.id,onRowClick:e=>t(`/schedule/${e.id}`),rowClassName:e=>M(e.id)?"highlight-new":"",emptyMessage:"No scheduled tasks recorded yet",error:w,onRetry:d,emptyIcon:a.jsx(u,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(J,{hasMore:T,onClick:v,loading:s})]})]})}export{le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-HxcGVcSo.js";import{D as i}from"./DetailRow-DKG3Vf9j.js";const s=["bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300","bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300","bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300","bg-teal-100 text-teal-800 dark:bg-teal-900/40 dark:text-teal-300","bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300","bg-indigo-100 text-indigo-800 dark:bg-indigo-900/40 dark:text-indigo-300","bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300","bg-pink-100 text-pink-800 dark:bg-pink-900/40 dark:text-pink-300"];function x(e){let r=0;for(let a=0;a<e.length;a+=1)r=r*31+e.charCodeAt(a)|0;return s[Math.abs(r)%s.length]}function g(e){var d,l;const r=(d=e.name)==null?void 0:d.trim(),a=(l=e.email)==null?void 0:l.trim().split("@")[0],n=(r||a||String(e.id??"")).split(/[\s._-]+/).filter(o=>o.length>0);return n.length===0?"?":(n.length>1?`${n[0][0]}${n[1][0]}`:n[0].slice(0,2)).toUpperCase()}function c({user:e}){const r=e.email??e.name??String(e.id??"");return t.jsx("span",{"aria-hidden":"true",className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold ${x(r)}`,children:g(e)})}function k({user:e}){return t.jsxs("div",{className:"card",children:[t.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Authenticated User"})}),t.jsx("div",{className:"p-4",children:t.jsxs("dl",{className:"divide-y-0",children:[t.jsx(i,{label:"ID",value:t.jsx("code",{className:"text-sm font-mono bg-gray-100 dark:bg-gray-800 px-2 py-0.5 rounded",children:String(e.id)})}),e.name&&t.jsx(i,{label:"Name",value:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(c,{user:e}),t.jsx("span",{children:e.name})]})}),e.email&&t.jsx(i,{label:"Email Address",value:t.jsx("a",{href:`mailto:${e.email}`,className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:e.email})})]})})]})}export{k as U};
|
package/dist/dashboard/public/assets/{ViewDetailView-CcWB9bLw.js → ViewDetailView-D-dBm6G6.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,F as p,C as h}from"./index-
|
|
1
|
+
import{j as e,F as p,C as h}from"./index-HxcGVcSo.js";import{p as i,f as j}from"./date-Dwgqy666.js";import{D as s,f as g}from"./DetailRow-DKG3Vf9j.js";import{C as c}from"./types-BMBEhoQ2.js";import{u as b,C as f,T as N}from"./EntryDetailPage-BdBZLbAf.js";import{C as u}from"./CopyButton-DfPqcshv.js";import{E as o}from"./eye-LljylR_O.js";import{C as y}from"./circle-check-big-CiGeQW9J.js";import{C as x}from"./circle-x-B-V5s-zK.js";import"./vendor-DBTT3jXp.js";import"./search-VPXcw9Ki.js";function M({entry:n}){const{payload:a,createdAt:d}=n,r=b(),t=a.status==="rendered"?{icon:y,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:x,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},m=t.icon,l=[];return a.locals!==void 0&&l.push({id:"locals",label:"Locals",content:e.jsx(f,{data:a.locals,toolbarState:r.state,searchBar:r.SearchBar,maxHeight:400})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(o,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.template}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"View Render"})]})]}),e.jsx(u,{text:a.template,label:"Copy template"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Format"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:a.format||"HTML"})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(h,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Cache"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a.cacheHit?"Yes":"No"})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[g(i(d),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",j(i(d),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Template",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:a.template})}),a.format&&e.jsx(s,{label:"Format",value:e.jsx(c,{listType:"views",filterType:"formats",filterValue:a.format,children:a.format})}),e.jsx(s,{label:"Status",value:e.jsx(c,{listType:"views",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`}),a.cacheHit!==void 0&&e.jsx(s,{label:"Cached",value:a.cacheHit?"Yes":"No"}),a.dataSize!==void 0&&e.jsx(s,{label:"Data Size",value:`${a.dataSize} bytes`}),a.outputSize!==void 0&&e.jsx(s,{label:"Output Size",value:`${a.outputSize} bytes`})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(x,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),l.length>0&&e.jsx(N,{tabs:l,defaultTab:"locals",hashKey:"view",headerRight:a.locals!==void 0?e.jsx(r.Toolbar,{data:a.locals}):void 0})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-HxcGVcSo.js";import{e as D,b as M}from"./vendor-DBTT3jXp.js";import{f as P,p as A}from"./date-Dwgqy666.js";import{u as H,a as B,P as L,R as V,N as S,L as W}from"./PageHeader-DR_M5h7z.js";import{u as I,n as U,C as d}from"./types-BMBEhoQ2.js";import{T as r,D as Y,b as $}from"./DataTable-Cz2phOFe.js";import{E as c}from"./eye-LljylR_O.js";import"./timer-I7o5QV6X.js";function Z(){const m=D(),{addFilter:s,clearAll:u,serverFilters:h,headerFilters:p}=I("views"),{rangeFilters:x,windowMinutes:g}=H(),{entries:f,loading:y,refreshing:i,error:w,refresh:l,newEntriesCount:j,hasMore:C,loadMore:v,loadNew:k,autoRefreshEnabled:N,live:b,setAutoRefresh:E,meta:o,isHighlighted:F}=B({type:"view",limit:50,filters:{...h,...x},windowMinutes:g}),n=f.filter(e=>U(e)),R=M.useMemo(()=>[{key:"template",header:"Template",minWidth:"250px",render:e=>t.jsx(r,{mono:!0,truncate:!0,maxWidth:"350px",children:e.payload.template})},{key:"format",header:"Format",width:"100px",render:e=>{const a=e.payload.format;return a?t.jsx(d,{onClick:T=>{T.stopPropagation(),s("formats",a)},className:"font-mono",children:a}):t.jsx(r,{secondary:!0,children:"-"})}},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(Y,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(d,{onClick:a=>{a.stopPropagation(),s("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"cache",header:"Cache",width:"80px",align:"center",render:e=>e.payload.cacheHit!==void 0?t.jsx(r,{children:e.payload.cacheHit?"Yes":"No"}):t.jsx(r,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(r,{secondary:!0,className:"text-xs",children:P(A(e.createdAt),{addSuffix:!0})})}],[s]);return y&&n.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(L,{title:"Views",icon:c,iconColor:"text-teal-600 dark:text-teal-400",count:n.length,totalCount:o==null?void 0:o.total,clearable:{type:"view",label:"views",onCleared:l},refreshing:i,autoRefreshEnabled:N,live:b,onAutoRefreshToggle:E,filters:p,filterControls:t.jsx(V,{route:"views"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(S,{count:j,onClick:k,loading:i}),t.jsx($,{columns:R,data:n,keyExtractor:e=>e.id,onRowClick:e=>m(`/views/${e.id}`),rowClassName:e=>F(e.id)?"highlight-new":"",emptyMessage:"No view renders recorded yet",error:w,onRetry:l,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:C,onClick:v,loading:i})]})]})}export{Z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-Ce497zS8.js","./vendor-DBTT3jXp.js","./date-Dwgqy666.js","./eye-LljylR_O.js","./zap-DMB3w7zm.js","./calendar-BfDDUQSW.js","./RequestsPage-CCSIr_jW.js","./PageHeader-DR_M5h7z.js","./types-BMBEhoQ2.js","./timer-I7o5QV6X.js","./EntrySearchInput-BF9N_f7y.js","./search-VPXcw9Ki.js","./DataTable-Cz2phOFe.js","./QueriesPage-DR3EHxfO.js","./ExceptionsPage-DqiQXiJK.js","./circle-check-big-CiGeQW9J.js","./LogsPage-Cvrcv7tq.js","./EventsPage-TlQQA-mn.js","./JobsPage-DX0A5Til.js","./CachePage-CwEDXyxJ.js","./MailPage-BZbVLHHN.js","./SchedulePage-CQVmVvYe.js","./format-BlNP-apw.js","./HttpClientPage-CUNDLZdF.js","./RedisPage-D-9y0o0o.js","./ModelsPage-CKUeCZLn.js","./NotificationsPage-CVnjoHST.js","./ViewsPage-ErK5Vmy0.js","./CommandsPage-B4XMyz_K.js","./GatesPage-D4s1Ogo-.js","./BatchesPage-W8k8XEu3.js","./DumpsPage-ldSDznQa.js","./GraphQLPage-AOD9WXa5.js","./EntryDetailPage-BdBZLbAf.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Ce=Object.defineProperty;var Pe=(s,a,e)=>a in s?Ce(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e;var I=(s,a,e)=>Pe(s,typeof a!="symbol"?a+"":a,e);import{r as Re,a as Le,g as Te,b as r,u as De,L as M,O as Oe,R as Ae,c as p,N as Me,d as qe,B as $e}from"./vendor-DBTT3jXp.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function e(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=e(l);fetch(l.href,i)}})();var G={exports:{}},q={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
@@ -358,4 +358,4 @@ to {
|
|
|
358
358
|
*
|
|
359
359
|
* This source code is licensed under the ISC license.
|
|
360
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const rs=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),we=()=>window.__NESTLENS_BASE__??"",ns=s=>`${window.location.origin}${we()}/__nestlens__${s}`,Se=ns("/api");class os extends Error{constructor(){super("This entry is no longer stored"),this.name="EntryGoneError"}}async function _(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw e.status===404?new os:new Error(`API error: ${e.status}`);return e.json()}async function Is(s){return _(`/entries/${s}`)}async function ce(){return _("/stats")}async function is(s){var i;const a=s?`?type=${encodeURIComponent(s)}`:"",e=await fetch(`${Se}/entries${a}`,{method:"DELETE"});if(!e.ok)throw new Error(`API error: ${e.status}`);const o=await e.json();if(o.success===!1)throw new Error(o.error??"The request was refused");const l=((i=o.data)==null?void 0:i.deleted)??0;return{success:!0,message:o.message??`Cleared ${l} entries`,deleted:l}}async function zs(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search),e.from&&a.set("from",e.from),e.to&&a.set("to",e.to),e.minDuration!==void 0&&a.set("minDuration",e.minDuration.toString()),e.maxDuration!==void 0&&a.set("maxDuration",e.maxDuration.toString())}return _(`/entries/cursor?${a.toString()}`)}async function Ks(s){const a=new URLSearchParams;return s&&a.set("type",s),_(`/entries/latest-sequence?${a.toString()}`)}async function Vs(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),_(`/entries/check-new?${e.toString()}`)}async function Fs(){return _("/storage/stats")}async function Bs(){return _("/pruning/status")}async function Hs(){return _("/pruning/run",{method:"POST"})}async function Gs(){return _("/tags/monitored")}async function Js(s){return _("/tags/monitored",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:s})})}async function Us(s){return _(`/tags/monitored/${encodeURIComponent(s)}`,{method:"DELETE"})}async function Ws(s,a){return _(`/tags/entry/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Qs(s,a){return _(`/tags/entry/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Zs(s){return _(`/entries/${s}/resolve`,{method:"PATCH"})}async function Xs(s){return _(`/entries/${s}/unresolve`,{method:"PATCH"})}async function ls(s){return _("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function cs(){return _("/recording/resume",{method:"POST"})}async function ds(){return _("/recording/status")}function us(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:m,preventDefault:y=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,h=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class Ee extends r.Component{constructor(){super(...arguments);I(this,"state",{hasError:!1});I(this,"handleReload",()=>{window.location.reload()});I(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(ve,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(ts,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}const Ne=r.createContext(void 0);function hs(){const s=r.useContext(Ne);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function de(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await ds();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await cs();a(i.data),A.success("Recording resumed")}else{const i=await ls();a(i.data),A.success("Recording paused")}}catch{A.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Yt,{className:"h-5 w-5"}):t.jsx(Xt,{className:"h-5 w-5"})}):null}const ue={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},he=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Jt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:qt,colorKey:"request"},{name:"Queries",href:"/queries",icon:Vt,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:Bt,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Ft,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:zt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:Kt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Qt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:as,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:It,colorKey:"redis"},{name:"Models",href:"/models",icon:Gt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Ht,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ut,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:$t,colorKey:"notification"},{name:"Events",href:"/events",icon:es,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Zt,colorKey:"view"},{name:"Gates",href:"/gates",icon:ss,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function me(s){return s!=="system"?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches}function ms(){const s=De(),[a,e]=r.useState(!1),{stats:o}=hs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[u,x]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),d=r.useCallback(h=>{i(w=>{const N=new Set(w);return N.has(h)?N.delete(h):N.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...N])),N})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),y=r.useCallback(h=>{const w=me(h);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";x(h),localStorage.setItem("nestlens-theme",h),y(h)},[n,y]),k=r.useCallback(async()=>{if(window.confirm("Are you sure you want to clear all entries?")){try{await is()}catch(h){A.error(`Could not clear entries: ${h instanceof Error?h.message:String(h)}`);return}A.success("All entries cleared"),window.location.reload()}},[]);return r.useEffect(()=>{const h=me(u);if(document.documentElement.classList.toggle("dark",h),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),N=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",N),()=>w.removeEventListener("change",N)}},[u]),us([{key:"k",ctrl:!0,handler:()=>k()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(rs,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(M,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(J,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.14.0"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${C?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Wt,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Ee,{children:t.jsx(Oe,{})},s.pathname)})]})]})}function f(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const ps=r.lazy(()=>v(()=>import("./DashboardPage-D0ukXtDo.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./RequestsPage-BPeHtBRn.js"),__vite__mapDeps([6,1,2,7,8,9,10,11,12]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./QueriesPage-BJfywln6.js"),__vite__mapDeps([13,1,2,7,8,9,10,11,12,4]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./ExceptionsPage-CA8ilfoK.js"),__vite__mapDeps([14,1,2,7,8,9,10,11,12,15]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./LogsPage-CCwjLuWQ.js"),__vite__mapDeps([16,1,2,7,8,9,10,11,12]),import.meta.url)),js=r.lazy(()=>v(()=>import("./EventsPage-CRGB2aCi.js"),__vite__mapDeps([17,1,2,7,8,9,12]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./JobsPage-DAdrYeU-.js"),__vite__mapDeps([18,1,2,7,8,9,12]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./CachePage-tk4-Mzj-.js"),__vite__mapDeps([19,1,2,7,8,9,12]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./MailPage-CdiZI_hh.js"),__vite__mapDeps([20,1,2,7,8,9,12]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./SchedulePage-uM09HkqS.js"),__vite__mapDeps([21,1,22,2,7,8,9,12]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./HttpClientPage-BJd_ibF6.js"),__vite__mapDeps([23,1,2,7,8,9,12]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./RedisPage-CHxk1zKp.js"),__vite__mapDeps([24,1,2,7,8,9,12]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ModelsPage-0-jYL1-U.js"),__vite__mapDeps([25,1,2,7,8,9,12]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./NotificationsPage-szMmustZ.js"),__vite__mapDeps([26,1,2,7,8,9,12]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./ViewsPage-L56Rz7jz.js"),__vite__mapDeps([27,1,2,7,8,9,12,3]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BT5pa5B8.js"),__vite__mapDeps([28,1,2,7,8,9,12]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./GatesPage-Do-qOR5X.js"),__vite__mapDeps([29,1,2,7,8,9,12]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./BatchesPage-ugxH2v0z.js"),__vite__mapDeps([30,1,2,7,8,9,12]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./DumpsPage-C0_N90Tx.js"),__vite__mapDeps([31,1,2,7,8,9,12]),import.meta.url)),Ds=r.lazy(()=>v(()=>import("./GraphQLPage-CNWITXJX.js"),__vite__mapDeps([32,1,2,10,11,7,8,9,12]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-Dw2pcYO2.js").then(s=>s.E),__vite__mapDeps([33,1,2,8,11]),import.meta.url));function Os(){return t.jsx(Ae,{children:t.jsxs(p,{path:"/",element:t.jsx(ms,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ds,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Me,{to:"/",replace:!0})})]})})}const As=1e4;function Ms({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),i.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const m=d instanceof Error?d:new Error("Failed to fetch stats");l(m),console.error("Failed to fetch stats:",d),i.current&&A.error("Failed to load statistics"),i.current=!1},[]),x=r.useCallback(async()=>ce().then(d=>c(d.data),d=>u(d)),[c,u]);return r.useEffect(()=>{n.current=!0;const d=setInterval(()=>void x(),As);return ce().then(m=>c(m.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ne.Provider,{value:{stats:a,error:o,refreshStats:x},children:s})}const _e=document.getElementById("root");if(!_e)throw new Error("NestLens dashboard: no #root element in the served index.html");Fe.createRoot(_e).render(t.jsx(qe.StrictMode,{children:t.jsx(Ee,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ms,{children:[t.jsx(Os,{}),t.jsx(Lt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{qt as A,zt as B,Kt as C,Vt as D,os as E,Ft as F,Bt as G,ne as H,Qs as I,Ws as J,Ee as K,Gt as L,Ut as M,Is as N,Yt as O,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,Js as a,as as b,g as c,It as d,Ht as e,$t as f,Gs as g,Zt as h,ae as i,t as j,le as k,ts as l,Fs as m,Bs as n,Hs as o,zs as p,Xs as q,Us as r,Zs as s,ns as t,hs as u,Vs as v,Ks as w,se as x,is as y,A as z};
|
|
361
|
+
*/const rs=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),we=()=>window.__NESTLENS_BASE__??"",ns=s=>`${window.location.origin}${we()}/__nestlens__${s}`,Se=ns("/api");class os extends Error{constructor(){super("This entry is no longer stored"),this.name="EntryGoneError"}}async function _(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw e.status===404?new os:new Error(`API error: ${e.status}`);return e.json()}async function Is(s){return _(`/entries/${s}`)}async function ce(){return _("/stats")}async function is(s){var i;const a=s?`?type=${encodeURIComponent(s)}`:"",e=await fetch(`${Se}/entries${a}`,{method:"DELETE"});if(!e.ok)throw new Error(`API error: ${e.status}`);const o=await e.json();if(o.success===!1)throw new Error(o.error??"The request was refused");const l=((i=o.data)==null?void 0:i.deleted)??0;return{success:!0,message:o.message??`Cleared ${l} entries`,deleted:l}}async function zs(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search),e.from&&a.set("from",e.from),e.to&&a.set("to",e.to),e.minDuration!==void 0&&a.set("minDuration",e.minDuration.toString()),e.maxDuration!==void 0&&a.set("maxDuration",e.maxDuration.toString())}return _(`/entries/cursor?${a.toString()}`)}async function Ks(s){const a=new URLSearchParams;return s&&a.set("type",s),_(`/entries/latest-sequence?${a.toString()}`)}async function Vs(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),_(`/entries/check-new?${e.toString()}`)}async function Fs(){return _("/storage/stats")}async function Bs(){return _("/pruning/status")}async function Hs(){return _("/pruning/run",{method:"POST"})}async function Gs(){return _("/tags/monitored")}async function Js(s){return _("/tags/monitored",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:s})})}async function Us(s){return _(`/tags/monitored/${encodeURIComponent(s)}`,{method:"DELETE"})}async function Ws(s,a){return _(`/tags/entry/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Qs(s,a){return _(`/tags/entry/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Zs(s){return _(`/entries/${s}/resolve`,{method:"PATCH"})}async function Xs(s){return _(`/entries/${s}/unresolve`,{method:"PATCH"})}async function ls(s){return _("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function cs(){return _("/recording/resume",{method:"POST"})}async function ds(){return _("/recording/status")}function us(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:m,preventDefault:y=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,h=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class Ee extends r.Component{constructor(){super(...arguments);I(this,"state",{hasError:!1});I(this,"handleReload",()=>{window.location.reload()});I(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(ve,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(ts,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}const Ne=r.createContext(void 0);function hs(){const s=r.useContext(Ne);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function de(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await ds();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await cs();a(i.data),A.success("Recording resumed")}else{const i=await ls();a(i.data),A.success("Recording paused")}}catch{A.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Yt,{className:"h-5 w-5"}):t.jsx(Xt,{className:"h-5 w-5"})}):null}const ue={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},he=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Jt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:qt,colorKey:"request"},{name:"Queries",href:"/queries",icon:Vt,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:Bt,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Ft,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:zt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:Kt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Qt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:as,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:It,colorKey:"redis"},{name:"Models",href:"/models",icon:Gt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Ht,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ut,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:$t,colorKey:"notification"},{name:"Events",href:"/events",icon:es,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Zt,colorKey:"view"},{name:"Gates",href:"/gates",icon:ss,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function me(s){return s!=="system"?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches}function ms(){const s=De(),[a,e]=r.useState(!1),{stats:o}=hs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[u,x]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),d=r.useCallback(h=>{i(w=>{const N=new Set(w);return N.has(h)?N.delete(h):N.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...N])),N})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),y=r.useCallback(h=>{const w=me(h);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";x(h),localStorage.setItem("nestlens-theme",h),y(h)},[n,y]),k=r.useCallback(async()=>{if(window.confirm("Are you sure you want to clear all entries?")){try{await is()}catch(h){A.error(`Could not clear entries: ${h instanceof Error?h.message:String(h)}`);return}A.success("All entries cleared"),window.location.reload()}},[]);return r.useEffect(()=>{const h=me(u);if(document.documentElement.classList.toggle("dark",h),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),N=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",N),()=>w.removeEventListener("change",N)}},[u]),us([{key:"k",ctrl:!0,handler:()=>k()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(rs,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(M,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(J,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.14.2"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${C?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Wt,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Ee,{children:t.jsx(Oe,{})},s.pathname)})]})]})}function f(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const ps=r.lazy(()=>v(()=>import("./DashboardPage-Ce497zS8.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./RequestsPage-CCSIr_jW.js"),__vite__mapDeps([6,1,2,7,8,9,10,11,12]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./QueriesPage-DR3EHxfO.js"),__vite__mapDeps([13,1,2,7,8,9,10,11,12,4]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./ExceptionsPage-DqiQXiJK.js"),__vite__mapDeps([14,1,2,7,8,9,10,11,12,15]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./LogsPage-Cvrcv7tq.js"),__vite__mapDeps([16,1,2,7,8,9,10,11,12]),import.meta.url)),js=r.lazy(()=>v(()=>import("./EventsPage-TlQQA-mn.js"),__vite__mapDeps([17,1,2,7,8,9,12]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./JobsPage-DX0A5Til.js"),__vite__mapDeps([18,1,2,7,8,9,12]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./CachePage-CwEDXyxJ.js"),__vite__mapDeps([19,1,2,7,8,9,12]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./MailPage-BZbVLHHN.js"),__vite__mapDeps([20,1,2,7,8,9,12]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./SchedulePage-CQVmVvYe.js"),__vite__mapDeps([21,1,22,2,7,8,9,12]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./HttpClientPage-CUNDLZdF.js"),__vite__mapDeps([23,1,2,7,8,9,12]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./RedisPage-D-9y0o0o.js"),__vite__mapDeps([24,1,2,7,8,9,12]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ModelsPage-CKUeCZLn.js"),__vite__mapDeps([25,1,2,7,8,9,12]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./NotificationsPage-CVnjoHST.js"),__vite__mapDeps([26,1,2,7,8,9,12]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./ViewsPage-ErK5Vmy0.js"),__vite__mapDeps([27,1,2,7,8,9,12,3]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-B4XMyz_K.js"),__vite__mapDeps([28,1,2,7,8,9,12]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./GatesPage-D4s1Ogo-.js"),__vite__mapDeps([29,1,2,7,8,9,12]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./BatchesPage-W8k8XEu3.js"),__vite__mapDeps([30,1,2,7,8,9,12]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./DumpsPage-ldSDznQa.js"),__vite__mapDeps([31,1,2,7,8,9,12]),import.meta.url)),Ds=r.lazy(()=>v(()=>import("./GraphQLPage-AOD9WXa5.js"),__vite__mapDeps([32,1,2,10,11,7,8,9,12]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-BdBZLbAf.js").then(s=>s.E),__vite__mapDeps([33,1,2,8,11]),import.meta.url));function Os(){return t.jsx(Ae,{children:t.jsxs(p,{path:"/",element:t.jsx(ms,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ds,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Me,{to:"/",replace:!0})})]})})}const As=1e4;function Ms({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),i.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const m=d instanceof Error?d:new Error("Failed to fetch stats");l(m),console.error("Failed to fetch stats:",d),i.current&&A.error("Failed to load statistics"),i.current=!1},[]),x=r.useCallback(async()=>ce().then(d=>c(d.data),d=>u(d)),[c,u]);return r.useEffect(()=>{n.current=!0;const d=setInterval(()=>void x(),As);return ce().then(m=>c(m.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ne.Provider,{value:{stats:a,error:o,refreshStats:x},children:s})}const _e=document.getElementById("root");if(!_e)throw new Error("NestLens dashboard: no #root element in the served index.html");Fe.createRoot(_e).render(t.jsx(qe.StrictMode,{children:t.jsx(Ee,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ms,{children:[t.jsx(Os,{}),t.jsx(Lt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{qt as A,zt as B,Kt as C,Vt as D,os as E,Ft as F,Bt as G,ne as H,Qs as I,Ws as J,Ee as K,Gt as L,Ut as M,Is as N,Yt as O,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,Js as a,as as b,g as c,It as d,Ht as e,$t as f,Gs as g,Zt as h,ae as i,t as j,le as k,ts as l,Fs as m,Bs as n,Hs as o,zs as p,Xs as q,Us as r,Zs as s,ns as t,hs as u,Vs as v,Ks as w,se as x,is as y,A as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E}from"./index-dkeMTrq0.js";import{f as D,b as d,e as C,u as L}from"./vendor-DBTT3jXp.js";import{g as R,h as w}from"./date-Dwgqy666.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",measuresDuration:!0,filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",measuresDuration:!1,filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",measuresDuration:!1,filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",measuresDuration:!0,filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",measuresDuration:!0,filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",measuresDuration:!0,filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",measuresDuration:!0,filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",measuresDuration:!0,filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",measuresDuration:!0,filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",measuresDuration:!0,filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",measuresDuration:!0,filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",measuresDuration:!0,filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",measuresDuration:!0,filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",measuresDuration:!0,filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",measuresDuration:!0,filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},q={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function k(e){if(e in T)return T[e];const s=q[e];if(s)return T[s]}const x=k;function B(e){const[s,i]=D(),a=x(e),c=d.useCallback(r=>{if(r==="tags")return"tags";if(!a)return r;const t=a.filters[r];return(t==null?void 0:t.urlKey)||r},[a]),o=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(u=>u.urlKey);t.push("tags","search");for(const u of t){const n=s.get(u);n&&(r[u]=n.split(",").filter(Boolean))}return r},[s,a]),N=d.useCallback((r,t)=>{!a&&r!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const u=c(r),n=o[u]||[];if(!n.includes(t)){const l=new URLSearchParams(s);l.set(u,[...n,t].join(",")),i(l,{replace:!0})}},[a,c,o,s,i]),p=d.useCallback((r,t)=>{const n=(o[r]||[]).filter(f=>f!==t),l=new URLSearchParams(s);n.length>0?l.set(r,n.join(",")):l.delete(r),i(l,{replace:!0})},[o,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>o,[o]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,u]of Object.entries(o)){if(u.length===0)continue;let n=t,l=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,l=h.displayName;break}r.push({category:n,urlKey:t,displayName:l,values:u})}return r},[o,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const u of t.values)r.push({category:t.displayName,value:u.toUpperCase(),onRemove:()=>p(t.urlKey,u)});return r},[y,p]),K=y.length>0;return{addFilter:N,removeFilter:p,clearAll:S,serverFilters:g,activeFilters:y,headerFilters:m,hasFilters:K,getUrlKey:c}}function O(e,s){if(s==="tags")return"tags";const i=x(e);if(!i)return s;const a=i.filters[s];return(a==null?void 0:a.urlKey)||s}const M=["localhost"],A=(e,s)=>{if(s&&s!=="tag")return s;if(/^user:/i.test(e))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return"ips";const i=e.toUpperCase();if(w.includes(i))return"methods";const a=parseInt(e,10);return!isNaN(a)&&a>=100&&a<600?"statuses":/^[a-fA-F0-9:]+$/.test(e)&&e.includes(":")&&!e.includes(".")?"ips":e.includes("#")||e.includes("::")||/Controller\./i.test(e)?"controllers":M.includes(e.toLowerCase())||(e.includes(".")||e.includes(":"))&&!e.startsWith("/")&&!/^\d+$/.test(e)?"hostnames":"tags"};function H({children:e,listType:s,filterType:i="tag",filterValue:a,onClick:c,clickable:o=!0,className:N="",ariaLabel:p}){const S=C(),g=L(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&o){const l=a||String(e),f=i&&i!=="tag"?O(s,i):A(l,i),h=g.pathname,v=h===`/${s}`||h.startsWith(`/${s}/`)?new URLSearchParams(g.search):new URLSearchParams,b=v.get(f);if(b){const P=b.split(",");P.includes(l)||v.set(f,[...P,l].join(","))}else v.set(f,l);S(`/${s}?${v.toString()}`)}},m=o&&(!!c||!!s),K=R(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),u=p||(m?`Click to filter by ${t}`:void 0);return E.jsx("span",{onClick:m?y:void 0,role:m?"button":void 0,"aria-label":u,tabIndex:m?0:void 0,onKeyDown:m?n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),y(n))}:void 0,title:t,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${K} ${r} ${m?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${N}`,children:t})}function I({items:e,listType:s,filterType:i="tag",maxItems:a=99,clickable:c=!0}){if(!e||e.length===0)return null;const o=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(p=>E.jsx(H,{listType:s,filterType:i,clickable:c,children:p},p)),N>0&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",N]})]})}function $(e){return e.type==="request"}function Q(e){return e.type==="query"}function V(e){return e.type==="exception"}function z(e){return e.type==="log"}function J(e){return e.type==="cache"}function Y(e){return e.type==="event"}function Z(e){return e.type==="job"}function _(e){return e.type==="schedule"}function W(e){return e.type==="mail"}function X(e){return e.type==="http-client"}function ee(e){return e.type==="redis"}function se(e){return e.type==="model"}function te(e){return e.type==="notification"}function ae(e){return e.type==="view"}function re(e){return e.type==="command"}function ne(e){return e.type==="gate"}function ie(e){return e.type==="batch"}function ue(e){return e.type==="dump"}function le(e){return e.type==="graphql"}export{I as B,H as C,Q as a,V as b,z as c,Y as d,Z as e,J as f,W as g,_ as h,$ as i,X as j,ee as k,se as l,te as m,ae as n,re as o,ne as p,ie as q,ue as r,le as s,x as t,B as u};
|
|
1
|
+
import{j as E}from"./index-HxcGVcSo.js";import{f as D,b as d,e as C,u as L}from"./vendor-DBTT3jXp.js";import{g as R,h as w}from"./date-Dwgqy666.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",measuresDuration:!0,filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",measuresDuration:!1,filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",measuresDuration:!1,filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",measuresDuration:!0,filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",measuresDuration:!0,filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",measuresDuration:!0,filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",measuresDuration:!0,filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",measuresDuration:!0,filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",measuresDuration:!0,filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",measuresDuration:!0,filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",measuresDuration:!0,filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",measuresDuration:!0,filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",measuresDuration:!0,filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",measuresDuration:!0,filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",measuresDuration:!0,filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},q={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function k(e){if(e in T)return T[e];const s=q[e];if(s)return T[s]}const x=k;function B(e){const[s,i]=D(),a=x(e),c=d.useCallback(r=>{if(r==="tags")return"tags";if(!a)return r;const t=a.filters[r];return(t==null?void 0:t.urlKey)||r},[a]),o=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(u=>u.urlKey);t.push("tags","search");for(const u of t){const n=s.get(u);n&&(r[u]=n.split(",").filter(Boolean))}return r},[s,a]),N=d.useCallback((r,t)=>{!a&&r!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const u=c(r),n=o[u]||[];if(!n.includes(t)){const l=new URLSearchParams(s);l.set(u,[...n,t].join(",")),i(l,{replace:!0})}},[a,c,o,s,i]),p=d.useCallback((r,t)=>{const n=(o[r]||[]).filter(f=>f!==t),l=new URLSearchParams(s);n.length>0?l.set(r,n.join(",")):l.delete(r),i(l,{replace:!0})},[o,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>o,[o]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,u]of Object.entries(o)){if(u.length===0)continue;let n=t,l=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,l=h.displayName;break}r.push({category:n,urlKey:t,displayName:l,values:u})}return r},[o,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const u of t.values)r.push({category:t.displayName,value:u.toUpperCase(),onRemove:()=>p(t.urlKey,u)});return r},[y,p]),K=y.length>0;return{addFilter:N,removeFilter:p,clearAll:S,serverFilters:g,activeFilters:y,headerFilters:m,hasFilters:K,getUrlKey:c}}function O(e,s){if(s==="tags")return"tags";const i=x(e);if(!i)return s;const a=i.filters[s];return(a==null?void 0:a.urlKey)||s}const M=["localhost"],A=(e,s)=>{if(s&&s!=="tag")return s;if(/^user:/i.test(e))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return"ips";const i=e.toUpperCase();if(w.includes(i))return"methods";const a=parseInt(e,10);return!isNaN(a)&&a>=100&&a<600?"statuses":/^[a-fA-F0-9:]+$/.test(e)&&e.includes(":")&&!e.includes(".")?"ips":e.includes("#")||e.includes("::")||/Controller\./i.test(e)?"controllers":M.includes(e.toLowerCase())||(e.includes(".")||e.includes(":"))&&!e.startsWith("/")&&!/^\d+$/.test(e)?"hostnames":"tags"};function H({children:e,listType:s,filterType:i="tag",filterValue:a,onClick:c,clickable:o=!0,className:N="",ariaLabel:p}){const S=C(),g=L(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&o){const l=a||String(e),f=i&&i!=="tag"?O(s,i):A(l,i),h=g.pathname,v=h===`/${s}`||h.startsWith(`/${s}/`)?new URLSearchParams(g.search):new URLSearchParams,b=v.get(f);if(b){const P=b.split(",");P.includes(l)||v.set(f,[...P,l].join(","))}else v.set(f,l);S(`/${s}?${v.toString()}`)}},m=o&&(!!c||!!s),K=R(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),u=p||(m?`Click to filter by ${t}`:void 0);return E.jsx("span",{onClick:m?y:void 0,role:m?"button":void 0,"aria-label":u,tabIndex:m?0:void 0,onKeyDown:m?n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),y(n))}:void 0,title:t,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${K} ${r} ${m?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${N}`,children:t})}function I({items:e,listType:s,filterType:i="tag",maxItems:a=99,clickable:c=!0}){if(!e||e.length===0)return null;const o=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(p=>E.jsx(H,{listType:s,filterType:i,clickable:c,children:p},p)),N>0&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",N]})]})}function $(e){return e.type==="request"}function Q(e){return e.type==="query"}function V(e){return e.type==="exception"}function z(e){return e.type==="log"}function J(e){return e.type==="cache"}function Y(e){return e.type==="event"}function Z(e){return e.type==="job"}function _(e){return e.type==="schedule"}function W(e){return e.type==="mail"}function X(e){return e.type==="http-client"}function ee(e){return e.type==="redis"}function se(e){return e.type==="model"}function te(e){return e.type==="notification"}function ae(e){return e.type==="view"}function re(e){return e.type==="command"}function ne(e){return e.type==="gate"}function ie(e){return e.type==="batch"}function ue(e){return e.type==="dump"}function le(e){return e.type==="graphql"}export{I as B,H as C,Q as a,V as b,z as c,Y as d,Z as e,J as f,W as g,_ as h,$ as i,X as j,ee as k,se as l,te as m,ae as n,re as o,ne as p,ie as q,ue as r,le as s,x as t,B as u};
|