nestlens 0.17.3 → 0.18.1

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.
Files changed (62) hide show
  1. package/dist/core/storage/storage.factory.js +17 -0
  2. package/dist/dashboard/public/assets/{BatchDetailView-DAtR5FPg.js → BatchDetailView-D4FdYWSo.js} +1 -1
  3. package/dist/dashboard/public/assets/{BatchesPage-BPA6JhXD.js → BatchesPage-chSp-Uu5.js} +1 -1
  4. package/dist/dashboard/public/assets/{CacheDetailView-DlShiGIf.js → CacheDetailView-CjKGfmfs.js} +1 -1
  5. package/dist/dashboard/public/assets/{CachePage-4gqe08jc.js → CachePage-BmEfeuaq.js} +1 -1
  6. package/dist/dashboard/public/assets/{CommandDetailView-D90ipdrR.js → CommandDetailView-BsDoA5yr.js} +1 -1
  7. package/dist/dashboard/public/assets/{CommandsPage-bO8ow8DA.js → CommandsPage-CikfkNLs.js} +1 -1
  8. package/dist/dashboard/public/assets/{CopyButton-DaF0vYeo.js → CopyButton-DZpH1CB7.js} +1 -1
  9. package/dist/dashboard/public/assets/{DashboardPage-DeKPc8p-.js → DashboardPage-IxOmghkd.js} +1 -1
  10. package/dist/dashboard/public/assets/{DataTable-CIlMLJo4.js → DataTable-CdvrtwLu.js} +1 -1
  11. package/dist/dashboard/public/assets/{DetailRow-BC_kcJT3.js → DetailRow-CxyUq52b.js} +1 -1
  12. package/dist/dashboard/public/assets/{DumpDetailView-CejsvpwV.js → DumpDetailView-qFABgJ4e.js} +1 -1
  13. package/dist/dashboard/public/assets/{DumpsPage-BtDTjZ7O.js → DumpsPage-gxo0OIWc.js} +1 -1
  14. package/dist/dashboard/public/assets/{EntryDetailPage-DUWwJ_hP.js → EntryDetailPage-D0maRTjK.js} +3 -3
  15. package/dist/dashboard/public/assets/{EntrySearchInput-Iv-9Wirn.js → EntrySearchInput-DsNY9wzV.js} +1 -1
  16. package/dist/dashboard/public/assets/{EventDetailView-gBzHbxMY.js → EventDetailView-PyJIMTSO.js} +1 -1
  17. package/dist/dashboard/public/assets/{EventsPage-B8t1V0Vx.js → EventsPage-BV317lVl.js} +1 -1
  18. package/dist/dashboard/public/assets/{ExceptionDetailView-CAJwXNN0.js → ExceptionDetailView-BVZ1yZWA.js} +1 -1
  19. package/dist/dashboard/public/assets/{ExceptionsPage-BnoHLwKA.js → ExceptionsPage-BEJiy2g-.js} +1 -1
  20. package/dist/dashboard/public/assets/{GateDetailView-CmKN_iLu.js → GateDetailView-DkGJUAWF.js} +1 -1
  21. package/dist/dashboard/public/assets/{GatesPage-Bgt4HOfH.js → GatesPage-BjWpb5vT.js} +1 -1
  22. package/dist/dashboard/public/assets/{GraphQLDetailView-CCMHYaLc.js → GraphQLDetailView-BZZZdasG.js} +1 -1
  23. package/dist/dashboard/public/assets/{GraphQLPage-C-lDawkW.js → GraphQLPage-CmsGURLz.js} +1 -1
  24. package/dist/dashboard/public/assets/{HttpClientDetailView-tCQJY3WT.js → HttpClientDetailView-SpEv9F_Z.js} +1 -1
  25. package/dist/dashboard/public/assets/{HttpClientPage-B0-n_3yk.js → HttpClientPage-D_6y73nd.js} +1 -1
  26. package/dist/dashboard/public/assets/{JobDetailView-COX5nxJL.js → JobDetailView-Dhwy2rKH.js} +1 -1
  27. package/dist/dashboard/public/assets/{JobsPage-BKGnM4ne.js → JobsPage-CKbWGxsi.js} +1 -1
  28. package/dist/dashboard/public/assets/{LogDetailView-CiFkQjNz.js → LogDetailView-iH1jA_iO.js} +1 -1
  29. package/dist/dashboard/public/assets/{LogsPage-NIDMxNxD.js → LogsPage-DcwyKIWA.js} +1 -1
  30. package/dist/dashboard/public/assets/{MailDetailView-B4hhGA3f.js → MailDetailView-DH43i-Nw.js} +1 -1
  31. package/dist/dashboard/public/assets/{MailPage-CYEkpVKG.js → MailPage-DMAHoGBl.js} +1 -1
  32. package/dist/dashboard/public/assets/{ModelDetailView-DiI8V80r.js → ModelDetailView-Gn802gbC.js} +1 -1
  33. package/dist/dashboard/public/assets/{ModelsPage-B9sb5wNN.js → ModelsPage-C03uhV9x.js} +1 -1
  34. package/dist/dashboard/public/assets/{NotificationDetailView-jBvJjcrv.js → NotificationDetailView-B5OruDzL.js} +1 -1
  35. package/dist/dashboard/public/assets/{NotificationsPage-CQmtJ4Uw.js → NotificationsPage-B_ePYx5d.js} +1 -1
  36. package/dist/dashboard/public/assets/{PageHeader-Tnp0JBDF.js → PageHeader-D3jf36Yh.js} +1 -1
  37. package/dist/dashboard/public/assets/{QueriesPage-92MXcQ8v.js → QueriesPage-CB8Q38iA.js} +1 -1
  38. package/dist/dashboard/public/assets/{QueryDetailView-0RW6Mgfq.js → QueryDetailView-Csy2f4eP.js} +1 -1
  39. package/dist/dashboard/public/assets/{RedisDetailView-B2ckYL3H.js → RedisDetailView-Cytw1isG.js} +1 -1
  40. package/dist/dashboard/public/assets/{RedisPage-CZU4kHNw.js → RedisPage-fK3qlc8U.js} +1 -1
  41. package/dist/dashboard/public/assets/{RequestDetailView-Cm-OEVhR.js → RequestDetailView-Rbq0nojh.js} +1 -1
  42. package/dist/dashboard/public/assets/{RequestsPage-CNVJHWoJ.js → RequestsPage-BbOUyQeE.js} +1 -1
  43. package/dist/dashboard/public/assets/{ScheduleDetailView-CrBW0QSz.js → ScheduleDetailView-BrxUJ2Rq.js} +1 -1
  44. package/dist/dashboard/public/assets/{SchedulePage-wVYGrpuQ.js → SchedulePage-BgoUA0NP.js} +1 -1
  45. package/dist/dashboard/public/assets/{UserCard-B4mNJVOd.js → UserCard-8jIvwXOn.js} +1 -1
  46. package/dist/dashboard/public/assets/{ViewDetailView-CMAf9inJ.js → ViewDetailView-BX1Tg3sc.js} +1 -1
  47. package/dist/dashboard/public/assets/{ViewsPage-76yfd6hO.js → ViewsPage-dRtZl5O8.js} +1 -1
  48. package/dist/dashboard/public/assets/{calendar-DCypCI0I.js → calendar-CBepXFtC.js} +1 -1
  49. package/dist/dashboard/public/assets/{circle-alert-BEvvepIR.js → circle-alert-B3cgcIeS.js} +1 -1
  50. package/dist/dashboard/public/assets/{circle-check-big-DZttXeD-.js → circle-check-big-BJmx6lMP.js} +1 -1
  51. package/dist/dashboard/public/assets/{circle-x-CioeSSBA.js → circle-x-BgJQ7XT5.js} +1 -1
  52. package/dist/dashboard/public/assets/{eye-CwQoBjXn.js → eye-ClWpkeSg.js} +1 -1
  53. package/dist/dashboard/public/assets/{index-BaD1MX7a.js → index-DPytPgll.js} +2 -2
  54. package/dist/dashboard/public/assets/{search-BtkJjUPF.js → search-DAygxhiQ.js} +1 -1
  55. package/dist/dashboard/public/assets/{send-CvZt49HP.js → send-BiSM0J_o.js} +1 -1
  56. package/dist/dashboard/public/assets/{timer-D72f3hG4.js → timer-CdczUN4V.js} +1 -1
  57. package/dist/dashboard/public/assets/{types-BHYinjn2.js → types-ClDKWGzY.js} +1 -1
  58. package/dist/dashboard/public/assets/{users-BHTpEUZQ.js → users-BP0wthJA.js} +1 -1
  59. package/dist/dashboard/public/assets/{zap-Cx84VGgd.js → zap-r_dKURpN.js} +1 -1
  60. package/dist/dashboard/public/index.html +1 -1
  61. package/dist/watchers/host-token.js +1 -1
  62. package/package.json +23 -12
@@ -1,4 +1,4 @@
1
- import{c as z,u as H,q as G,s as U,E as J,z as f,j as t,l as K,T as y}from"./index-BaD1MX7a.js";import{e as O,b as o}from"./vendor-DBTT3jXp.js";import{f as Q,p as V}from"./date-Dwgqy666.js";import{u as X,a as Y,P as Z,F as _,R as ee,N as te,L as se}from"./PageHeader-Tnp0JBDF.js";import{u as ae,b as re,C as h}from"./types-BHYinjn2.js";import{E as oe}from"./EntrySearchInput-Iv-9Wirn.js";import{T as l,b as le}from"./DataTable-CIlMLJo4.js";import{C as ie}from"./circle-check-big-DZttXeD-.js";import"./timer-D72f3hG4.js";import"./search-BtkJjUPF.js";/**
1
+ import{c as z,u as H,q as G,s as U,E as J,z as f,j as t,l as K,T as y}from"./index-DPytPgll.js";import{e as O,b as o}from"./vendor-DBTT3jXp.js";import{f as Q,p as V}from"./date-Dwgqy666.js";import{u as X,a as Y,P as Z,F as _,R as ee,N as te,L as se}from"./PageHeader-D3jf36Yh.js";import{u as ae,b as re,C as h}from"./types-ClDKWGzY.js";import{E as oe}from"./EntrySearchInput-DsNY9wzV.js";import{T as l,b as le}from"./DataTable-CdvrtwLu.js";import{C as ie}from"./circle-check-big-BJmx6lMP.js";import"./timer-CdczUN4V.js";import"./search-DAygxhiQ.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as m,j as e,S as i,C as g}from"./index-BaD1MX7a.js";import{p as d,f as h}from"./date-Dwgqy666.js";import{D as s,f as j}from"./DetailRow-BC_kcJT3.js";import{C as x}from"./types-BHYinjn2.js";import{u as p,C as b,T as u}from"./EntryDetailPage-DUWwJ_hP.js";import{C as y}from"./CopyButton-DaF0vYeo.js";import{C as N}from"./circle-check-big-DZttXeD-.js";import{C as f}from"./circle-x-CioeSSBA.js";import"./vendor-DBTT3jXp.js";import"./search-BtkJjUPF.js";/**
1
+ import{c as m,j as e,S as i,C as g}from"./index-DPytPgll.js";import{p as d,f as h}from"./date-Dwgqy666.js";import{D as s,f as j}from"./DetailRow-CxyUq52b.js";import{C as x}from"./types-ClDKWGzY.js";import{u as p,C as b,T as u}from"./EntryDetailPage-D0maRTjK.js";import{C as y}from"./CopyButton-DZpH1CB7.js";import{C as N}from"./circle-check-big-BJmx6lMP.js";import{C as f}from"./circle-x-BgJQ7XT5.js";import"./vendor-DBTT3jXp.js";import"./search-DAygxhiQ.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as t,S as d}from"./index-BaD1MX7a.js";import{e as M,b as P}from"./vendor-DBTT3jXp.js";import{f as T,p as S}from"./date-Dwgqy666.js";import{u as W,a as G,P as B,R as D,N as I,L}from"./PageHeader-Tnp0JBDF.js";import{u as H,p as U,C as c}from"./types-BHYinjn2.js";import{T as a,b as J}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";function X(){const u=M(),{addFilter:s,clearAll:h,serverFilters:p,headerFilters:x}=H("gates"),{rangeFilters:g,windowMinutes:m}=W(),{entries:y,loading:f,refreshing:o,error:j,refresh:n,newEntriesCount:b,hasMore:w,loadMore:C,loadNew:k,autoRefreshEnabled:N,live:E,setAutoRefresh:R,meta:i,isHighlighted:v}=G({type:"gate",limit:50,filters:{...p,...g},windowMinutes:m}),l=y.filter(e=>U(e)),F=P.useMemo(()=>[{key:"gate",header:"Gate",minWidth:"200px",render:e=>t.jsx(c,{onClick:r=>{r.stopPropagation(),s("names",e.payload.gate)},children:e.payload.gate})},{key:"action",header:"Action",width:"150px",render:e=>e.payload.action?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.action}):t.jsx(a,{secondary:!0,children:"-"})},{key:"subject",header:"Subject",minWidth:"150px",render:e=>e.payload.subject?t.jsx(a,{mono:!0,truncate:!0,maxWidth:"200px",children:typeof e.payload.subject=="string"?e.payload.subject:JSON.stringify(e.payload.subject)}):t.jsx(a,{secondary:!0,children:"-"})},{key:"result",header:"Result",width:"100px",render:e=>{const r=e.payload.allowed?"allowed":"denied";return t.jsx(c,{onClick:A=>{A.stopPropagation(),s("results",r)},children:r.toUpperCase()})}},{key:"user",header:"User",width:"150px",render:e=>e.payload.userId?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.userId}):t.jsx(a,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:T(S(e.createdAt),{addSuffix:!0})})}],[s]);return f&&l.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(B,{title:"Gates",icon:d,iconColor:"text-amber-600 dark:text-amber-400",count:l.length,totalCount:i==null?void 0:i.total,clearable:{type:"gate",label:"gates",onCleared:n},refreshing:o,autoRefreshEnabled:N,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx(D,{route:"gates"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(I,{count:b,onClick:k,loading:o}),t.jsx(J,{columns:F,data:l,keyExtractor:e=>e.id,onRowClick:e=>u(`/gates/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No gate checks recorded yet",error:j,onRetry:n,emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(L,{hasMore:w,onClick:C,loading:o})]})]})}export{X as default};
1
+ import{j as t,S as d}from"./index-DPytPgll.js";import{e as M,b as P}from"./vendor-DBTT3jXp.js";import{f as T,p as S}from"./date-Dwgqy666.js";import{u as W,a as G,P as B,R as D,N as I,L}from"./PageHeader-D3jf36Yh.js";import{u as H,p as U,C as c}from"./types-ClDKWGzY.js";import{T as a,b as J}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";function X(){const u=M(),{addFilter:s,clearAll:h,serverFilters:p,headerFilters:x}=H("gates"),{rangeFilters:g,windowMinutes:m}=W(),{entries:y,loading:f,refreshing:o,error:j,refresh:n,newEntriesCount:b,hasMore:w,loadMore:C,loadNew:k,autoRefreshEnabled:N,live:E,setAutoRefresh:R,meta:i,isHighlighted:v}=G({type:"gate",limit:50,filters:{...p,...g},windowMinutes:m}),l=y.filter(e=>U(e)),F=P.useMemo(()=>[{key:"gate",header:"Gate",minWidth:"200px",render:e=>t.jsx(c,{onClick:r=>{r.stopPropagation(),s("names",e.payload.gate)},children:e.payload.gate})},{key:"action",header:"Action",width:"150px",render:e=>e.payload.action?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.action}):t.jsx(a,{secondary:!0,children:"-"})},{key:"subject",header:"Subject",minWidth:"150px",render:e=>e.payload.subject?t.jsx(a,{mono:!0,truncate:!0,maxWidth:"200px",children:typeof e.payload.subject=="string"?e.payload.subject:JSON.stringify(e.payload.subject)}):t.jsx(a,{secondary:!0,children:"-"})},{key:"result",header:"Result",width:"100px",render:e=>{const r=e.payload.allowed?"allowed":"denied";return t.jsx(c,{onClick:A=>{A.stopPropagation(),s("results",r)},children:r.toUpperCase()})}},{key:"user",header:"User",width:"150px",render:e=>e.payload.userId?t.jsx(a,{truncate:!0,maxWidth:"150px",children:e.payload.userId}):t.jsx(a,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:T(S(e.createdAt),{addSuffix:!0})})}],[s]);return f&&l.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(B,{title:"Gates",icon:d,iconColor:"text-amber-600 dark:text-amber-400",count:l.length,totalCount:i==null?void 0:i.total,clearable:{type:"gate",label:"gates",onCleared:n},refreshing:o,autoRefreshEnabled:N,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx(D,{route:"gates"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(I,{count:b,onClick:k,loading:o}),t.jsx(J,{columns:F,data:l,keyExtractor:e=>e.id,onRowClick:e=>u(`/gates/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No gate checks recorded yet",error:j,onRetry:n,emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(L,{hasMore:w,onClick:C,loading:o})]})]})}export{X as default};
@@ -1,4 +1,4 @@
1
- import{c as z,z as q,j as e,X as H,x as P,i as U,L as B,C as _,T as W}from"./index-BaD1MX7a.js";import{b as j,e as J}from"./vendor-DBTT3jXp.js";import{p as R,f as X}from"./date-Dwgqy666.js";import{D as g,f as Z}from"./DetailRow-BC_kcJT3.js";import{C as $,B as K}from"./types-BHYinjn2.js";import{G as Y,N as ee}from"./DataTable-CIlMLJo4.js";import{M as ae,c as se,a as te,b as re,u as D,C as L,T as M}from"./EntryDetailPage-DUWwJ_hP.js";import{U as le}from"./UserCard-B4mNJVOd.js";import{S as Q}from"./search-BtkJjUPF.js";import{Z as ne}from"./zap-Cx84VGgd.js";import{S as ie}from"./send-CvZt49HP.js";/**
1
+ import{c as z,z as q,j as e,X as H,x as P,i as U,L as B,C as _,T as W}from"./index-DPytPgll.js";import{b as j,e as J}from"./vendor-DBTT3jXp.js";import{p as R,f as X}from"./date-Dwgqy666.js";import{D as g,f as Z}from"./DetailRow-CxyUq52b.js";import{C as $,B as K}from"./types-ClDKWGzY.js";import{G as Y,N as ee}from"./DataTable-CdvrtwLu.js";import{M as ae,c as se,a as te,b as re,u as D,C as L,T as M}from"./EntryDetailPage-D0maRTjK.js";import{U as le}from"./UserCard-8jIvwXOn.js";import{S as Q}from"./search-DAygxhiQ.js";import{Z as ne}from"./zap-r_dKURpN.js";import{S as ie}from"./send-BiSM0J_o.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as Q,j as a}from"./index-BaD1MX7a.js";import{e as U,f as W,b as d}from"./vendor-DBTT3jXp.js";import{f as I,p as O}from"./date-Dwgqy666.js";import{E as z}from"./EntrySearchInput-Iv-9Wirn.js";import{u as V,a as $,P as J,R as K,N as X,L as Y}from"./PageHeader-Tnp0JBDF.js";import{u as Z,s as _,C as y}from"./types-BHYinjn2.js";import{T as c,G as ee,N as ae,D as re,a as te,b as se}from"./DataTable-CIlMLJo4.js";import"./search-BtkJjUPF.js";import"./timer-D72f3hG4.js";/**
1
+ import{c as Q,j as a}from"./index-DPytPgll.js";import{e as U,f as W,b as d}from"./vendor-DBTT3jXp.js";import{f as I,p as O}from"./date-Dwgqy666.js";import{E as z}from"./EntrySearchInput-DsNY9wzV.js";import{u as V,a as $,P as J,R as K,N as X,L as Y}from"./PageHeader-D3jf36Yh.js";import{u as Z,s as _,C as y}from"./types-ClDKWGzY.js";import{T as c,G as ee,N as ae,D as re,a as te,b as se}from"./DataTable-CdvrtwLu.js";import"./search-DAygxhiQ.js";import"./timer-CdczUN4V.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e}from"./index-BaD1MX7a.js";import{b}from"./vendor-DBTT3jXp.js";import{p as T,f as v}from"./date-Dwgqy666.js";import{D as s,f as N}from"./DetailRow-BC_kcJT3.js";import{C as i,B}from"./types-BHYinjn2.js";import{u as f,T as j,C as l}from"./EntryDetailPage-DUWwJ_hP.js";import"./search-BtkJjUPF.js";const H=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],D=["2XX","3XX","4XX","5XX","SUCCESS","ERROR","CLIENT-ERROR","REDIRECT"];function q(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}function O({entry:t}){const{payload:a,createdAt:c}=t,h=a.statusCode??0,m=(t.tags??[]).filter(p=>{var u;const x=p.toUpperCase();return!H.includes(x)&&!D.includes(x)&&p.toLowerCase()!==((u=a.hostname)==null?void 0:u.toLowerCase())}),r=f(),o=f(),[y,R]=b.useState("payload"),[S,C]=b.useState("response"),n={payload:a.requestBody||{},headers:a.requestHeaders??{}},d={response:a.responseBody||{},headers:a.responseHeaders??{}},g=[{id:"payload",label:"Request Body",content:e.jsx(l,{data:n.payload,toolbarState:r.state,searchBar:r.SearchBar,maxHeight:400})},{id:"headers",label:"Request Headers",content:e.jsx(l,{data:n.headers,toolbarState:r.state,searchBar:r.SearchBar,maxHeight:400})}],E=[{id:"response",label:"Response Body",content:e.jsx(l,{data:d.response,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})},{id:"headers",label:"Response Headers",content:e.jsx(l,{data:d.headers,toolbarState:o.state,searchBar:o.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:"HTTP Client Request Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[N(T(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(T(c),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Method",value:e.jsx(i,{listType:"http-client",filterType:"methods",filterValue:a.method,className:"font-mono font-medium",children:a.method})}),e.jsx(s,{label:"URL",value:e.jsx("span",{className:"font-mono text-sm break-all",children:a.url})}),a.hostname&&e.jsx(s,{label:"Hostname",value:e.jsx(i,{listType:"http-client",filterType:"hostnames",filterValue:a.hostname,className:"font-mono",children:a.hostname})}),a.path&&e.jsx(s,{label:"Path",value:e.jsx("span",{className:"font-mono text-sm",children:a.path})}),e.jsx(s,{label:"Status Code",value:e.jsx(i,{listType:"http-client",filterType:"statuses",filterValue:a.statusCode?String(a.statusCode):"ERR",children:h>0?h:"ERR"})}),e.jsx(s,{label:"Duration",value:e.jsx("span",{className:a.duration>1e3?"text-yellow-600 dark:text-yellow-400 font-medium":"",children:q(a.duration)})}),a.error&&e.jsx(s,{label:"Error",value:e.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:a.error})}),m.length>0&&e.jsx(s,{label:"Tags",value:e.jsx(B,{items:m,listType:"http-client",maxItems:99})})]})})]}),e.jsx(j,{tabs:g,defaultTab:"payload",hashKey:"req",headerRight:e.jsx(r.Toolbar,{data:n[y]}),onTabChange:R}),e.jsx(j,{tabs:E,defaultTab:"response",hashKey:"res",headerRight:e.jsx(o.Toolbar,{data:d[S]}),onTabChange:C})]})}export{O as default};
1
+ import{j as e}from"./index-DPytPgll.js";import{b}from"./vendor-DBTT3jXp.js";import{p as T,f as v}from"./date-Dwgqy666.js";import{D as s,f as N}from"./DetailRow-CxyUq52b.js";import{C as i,B}from"./types-ClDKWGzY.js";import{u as f,T as j,C as l}from"./EntryDetailPage-D0maRTjK.js";import"./search-DAygxhiQ.js";const H=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],D=["2XX","3XX","4XX","5XX","SUCCESS","ERROR","CLIENT-ERROR","REDIRECT"];function q(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}function O({entry:t}){const{payload:a,createdAt:c}=t,h=a.statusCode??0,m=(t.tags??[]).filter(p=>{var u;const x=p.toUpperCase();return!H.includes(x)&&!D.includes(x)&&p.toLowerCase()!==((u=a.hostname)==null?void 0:u.toLowerCase())}),r=f(),o=f(),[y,R]=b.useState("payload"),[S,C]=b.useState("response"),n={payload:a.requestBody||{},headers:a.requestHeaders??{}},d={response:a.responseBody||{},headers:a.responseHeaders??{}},g=[{id:"payload",label:"Request Body",content:e.jsx(l,{data:n.payload,toolbarState:r.state,searchBar:r.SearchBar,maxHeight:400})},{id:"headers",label:"Request Headers",content:e.jsx(l,{data:n.headers,toolbarState:r.state,searchBar:r.SearchBar,maxHeight:400})}],E=[{id:"response",label:"Response Body",content:e.jsx(l,{data:d.response,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})},{id:"headers",label:"Response Headers",content:e.jsx(l,{data:d.headers,toolbarState:o.state,searchBar:o.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:"HTTP Client Request Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[N(T(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(T(c),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Method",value:e.jsx(i,{listType:"http-client",filterType:"methods",filterValue:a.method,className:"font-mono font-medium",children:a.method})}),e.jsx(s,{label:"URL",value:e.jsx("span",{className:"font-mono text-sm break-all",children:a.url})}),a.hostname&&e.jsx(s,{label:"Hostname",value:e.jsx(i,{listType:"http-client",filterType:"hostnames",filterValue:a.hostname,className:"font-mono",children:a.hostname})}),a.path&&e.jsx(s,{label:"Path",value:e.jsx("span",{className:"font-mono text-sm",children:a.path})}),e.jsx(s,{label:"Status Code",value:e.jsx(i,{listType:"http-client",filterType:"statuses",filterValue:a.statusCode?String(a.statusCode):"ERR",children:h>0?h:"ERR"})}),e.jsx(s,{label:"Duration",value:e.jsx("span",{className:a.duration>1e3?"text-yellow-600 dark:text-yellow-400 font-medium":"",children:q(a.duration)})}),a.error&&e.jsx(s,{label:"Error",value:e.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:a.error})}),m.length>0&&e.jsx(s,{label:"Tags",value:e.jsx(B,{items:m,listType:"http-client",maxItems:99})})]})})]}),e.jsx(j,{tabs:g,defaultTab:"payload",hashKey:"req",headerRight:e.jsx(r.Toolbar,{data:n[y]}),onTabChange:R}),e.jsx(j,{tabs:E,defaultTab:"response",hashKey:"res",headerRight:e.jsx(o.Toolbar,{data:d[S]}),onTabChange:C})]})}export{O as default};
@@ -1 +1 @@
1
- import{j as t,e as h}from"./index-BaD1MX7a.js";import{e as F,b as H}from"./vendor-DBTT3jXp.js";import{f as M,p as D}from"./date-Dwgqy666.js";import{u as A,a as B,P as L,R as S,N as W,L as q}from"./PageHeader-Tnp0JBDF.js";import{u as G,j as I,C as l}from"./types-BHYinjn2.js";import{T as d,D as $,b as z}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";function Y(){const u=F(),{addFilter:r,clearAll:p,serverFilters:m,headerFilters:x}=G("http-client"),{rangeFilters:g,windowMinutes:y}=A(),{entries:f,loading:C,refreshing:s,error:j,refresh:c,newEntriesCount:k,hasMore:w,loadMore:N,loadNew:b,autoRefreshEnabled:R,live:E,setAutoRefresh:P,meta:o,isHighlighted:T}=B({type:"http-client",limit:50,filters:{...m,...g},windowMinutes:y}),n=f.filter(e=>I(e)),v=H.useMemo(()=>[{key:"method",header:"Method",width:"90px",render:e=>t.jsx(l,{onClick:a=>{a.stopPropagation(),r("methods",e.payload.method)},className:"font-mono",children:e.payload.method})},{key:"status",header:"Status",width:"80px",render:e=>{const a=e.payload.statusCode??0;return t.jsx(l,{onClick:i=>{i.stopPropagation(),r("statuses",a>0?String(a):"ERR")},children:a>0?a:"ERR"})}},{key:"hostname",header:"Host",width:"180px",render:e=>{const a=e.payload.hostname;return a?t.jsx(l,{onClick:i=>{i.stopPropagation(),r("hostnames",a)},className:"font-mono",children:a}):t.jsx(d,{secondary:!0,children:"-"})}},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(d,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.path||e.payload.url})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(d,{secondary:!0,className:"text-xs",children:M(D(e.createdAt),{addSuffix:!0})})}],[r]);return C&&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:"HTTP Client",icon:h,iconColor:"text-cyan-600 dark:text-cyan-400",count:n.length,totalCount:o==null?void 0:o.total,clearable:{type:"http-client",label:"http client",onCleared:c},refreshing:s,autoRefreshEnabled:R,live:E,onAutoRefreshToggle:P,filters:x,filterControls:t.jsx(S,{route:"http-client"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{count:k,onClick:b,loading:s}),t.jsx(z,{columns:v,data:n,keyExtractor:e=>e.id,onRowClick:e=>u(`/http-client/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No outgoing HTTP requests recorded yet",error:j,onRetry:c,emptyIcon:t.jsx(h,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:w,onClick:N,loading:s})]})]})}export{Y as default};
1
+ import{j as t,e as h}from"./index-DPytPgll.js";import{e as F,b as H}from"./vendor-DBTT3jXp.js";import{f as M,p as D}from"./date-Dwgqy666.js";import{u as A,a as B,P as L,R as S,N as W,L as q}from"./PageHeader-D3jf36Yh.js";import{u as G,j as I,C as l}from"./types-ClDKWGzY.js";import{T as d,D as $,b as z}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";function Y(){const u=F(),{addFilter:r,clearAll:p,serverFilters:m,headerFilters:x}=G("http-client"),{rangeFilters:g,windowMinutes:y}=A(),{entries:f,loading:C,refreshing:s,error:j,refresh:c,newEntriesCount:k,hasMore:w,loadMore:N,loadNew:b,autoRefreshEnabled:R,live:E,setAutoRefresh:P,meta:o,isHighlighted:T}=B({type:"http-client",limit:50,filters:{...m,...g},windowMinutes:y}),n=f.filter(e=>I(e)),v=H.useMemo(()=>[{key:"method",header:"Method",width:"90px",render:e=>t.jsx(l,{onClick:a=>{a.stopPropagation(),r("methods",e.payload.method)},className:"font-mono",children:e.payload.method})},{key:"status",header:"Status",width:"80px",render:e=>{const a=e.payload.statusCode??0;return t.jsx(l,{onClick:i=>{i.stopPropagation(),r("statuses",a>0?String(a):"ERR")},children:a>0?a:"ERR"})}},{key:"hostname",header:"Host",width:"180px",render:e=>{const a=e.payload.hostname;return a?t.jsx(l,{onClick:i=>{i.stopPropagation(),r("hostnames",a)},className:"font-mono",children:a}):t.jsx(d,{secondary:!0,children:"-"})}},{key:"path",header:"Path",minWidth:"200px",render:e=>t.jsx(d,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.path||e.payload.url})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(d,{secondary:!0,className:"text-xs",children:M(D(e.createdAt),{addSuffix:!0})})}],[r]);return C&&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:"HTTP Client",icon:h,iconColor:"text-cyan-600 dark:text-cyan-400",count:n.length,totalCount:o==null?void 0:o.total,clearable:{type:"http-client",label:"http client",onCleared:c},refreshing:s,autoRefreshEnabled:R,live:E,onAutoRefreshToggle:P,filters:x,filterControls:t.jsx(S,{route:"http-client"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{count:k,onClick:b,loading:s}),t.jsx(z,{columns:v,data:n,keyExtractor:e=>e.id,onRowClick:e=>u(`/http-client/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No outgoing HTTP requests recorded yet",error:j,onRetry:c,emptyIcon:t.jsx(h,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:w,onClick:N,loading:s})]})]})}export{Y as default};
@@ -1,4 +1,4 @@
1
- import{c as k,C as h,l as j,j as e,B as n}from"./index-BaD1MX7a.js";import{b as w}from"./vendor-DBTT3jXp.js";import{p as m,f as C}from"./date-Dwgqy666.js";import{D as s,f as T}from"./DetailRow-BC_kcJT3.js";import{C as i}from"./types-BHYinjn2.js";import{u as b,C as p,T as D}from"./EntryDetailPage-DUWwJ_hP.js";import{C as S}from"./CopyButton-DaF0vYeo.js";import{C as f}from"./circle-alert-BEvvepIR.js";import{C as B}from"./circle-check-big-DZttXeD-.js";import"./search-BtkJjUPF.js";/**
1
+ import{c as k,C as h,l as j,j as e,B as n}from"./index-DPytPgll.js";import{b as w}from"./vendor-DBTT3jXp.js";import{p as m,f as C}from"./date-Dwgqy666.js";import{D as s,f as T}from"./DetailRow-CxyUq52b.js";import{C as i}from"./types-ClDKWGzY.js";import{u as b,C as p,T as D}from"./EntryDetailPage-D0maRTjK.js";import{C as S}from"./CopyButton-DZpH1CB7.js";import{C as f}from"./circle-alert-B3cgcIeS.js";import{C as B}from"./circle-check-big-BJmx6lMP.js";import"./search-DAygxhiQ.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as t,B as n}from"./index-BaD1MX7a.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{f as F,p as A}from"./date-Dwgqy666.js";import{u as D,a as M,P as B,R as J,N as P,L as q}from"./PageHeader-Tnp0JBDF.js";import{u as L,e as H,C as o}from"./types-BHYinjn2.js";import{T as i,D as S,b as I}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";function U(){const d=R(),{clearAll:u,serverFilters:c,headerFilters:h}=L("jobs"),{rangeFilters:m,windowMinutes:p}=D(),{entries:x,loading:y,refreshing:s,error:j,refresh:l,newEntriesCount:f,hasMore:g,loadMore:b,loadNew:w,autoRefreshEnabled:C,live:k,setAutoRefresh:N,meta:r,isHighlighted:T}=M({type:"job",limit:50,filters:{...c,...m},windowMinutes:p}),a=x.filter(e=>H(e)),E=v.useMemo(()=>[{key:"job",header:"Job",minWidth:"200px",render:e=>t.jsx(o,{listType:"jobs",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"queue",header:"Queue",width:"120px",render:e=>t.jsx(o,{listType:"jobs",filterType:"queues",children:e.payload.queue})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(o,{listType:"jobs",filterType:"statuses",children:e.payload.status})},{key:"attempts",header:"Attempts",width:"80px",align:"center",render:e=>t.jsx(i,{secondary:!0,children:e.payload.attempts})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(S,{ms:e.payload.duration}):t.jsx(i,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(i,{secondary:!0,className:"text-xs",children:F(A(e.createdAt),{addSuffix:!0})})}],[]);return y&&a.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(B,{title:"Jobs",icon:n,iconColor:"text-yellow-600 dark:text-yellow-400",count:a.length,totalCount:r==null?void 0:r.total,clearable:{type:"job",label:"jobs",onCleared:l},refreshing:s,autoRefreshEnabled:C,live:k,onAutoRefreshToggle:N,filters:h,filterControls:t.jsx(J,{route:"jobs"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(P,{count:f,onClick:w,loading:s}),t.jsx(I,{columns:E,data:a,keyExtractor:e=>e.id,onRowClick:e=>d(`/jobs/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No jobs recorded yet",error:j,onRetry:l,emptyIcon:t.jsx(n,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:g,onClick:b,loading:s})]})]})}export{U as default};
1
+ import{j as t,B as n}from"./index-DPytPgll.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{f as F,p as A}from"./date-Dwgqy666.js";import{u as D,a as M,P as B,R as J,N as P,L as q}from"./PageHeader-D3jf36Yh.js";import{u as L,e as H,C as o}from"./types-ClDKWGzY.js";import{T as i,D as S,b as I}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";function U(){const d=R(),{clearAll:u,serverFilters:c,headerFilters:h}=L("jobs"),{rangeFilters:m,windowMinutes:p}=D(),{entries:x,loading:y,refreshing:s,error:j,refresh:l,newEntriesCount:f,hasMore:g,loadMore:b,loadNew:w,autoRefreshEnabled:C,live:k,setAutoRefresh:N,meta:r,isHighlighted:T}=M({type:"job",limit:50,filters:{...c,...m},windowMinutes:p}),a=x.filter(e=>H(e)),E=v.useMemo(()=>[{key:"job",header:"Job",minWidth:"200px",render:e=>t.jsx(o,{listType:"jobs",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"queue",header:"Queue",width:"120px",render:e=>t.jsx(o,{listType:"jobs",filterType:"queues",children:e.payload.queue})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(o,{listType:"jobs",filterType:"statuses",children:e.payload.status})},{key:"attempts",header:"Attempts",width:"80px",align:"center",render:e=>t.jsx(i,{secondary:!0,children:e.payload.attempts})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(S,{ms:e.payload.duration}):t.jsx(i,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(i,{secondary:!0,className:"text-xs",children:F(A(e.createdAt),{addSuffix:!0})})}],[]);return y&&a.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(B,{title:"Jobs",icon:n,iconColor:"text-yellow-600 dark:text-yellow-400",count:a.length,totalCount:r==null?void 0:r.total,clearable:{type:"job",label:"jobs",onCleared:l},refreshing:s,autoRefreshEnabled:C,live:k,onAutoRefreshToggle:N,filters:h,filterControls:t.jsx(J,{route:"jobs"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(P,{count:f,onClick:w,loading:s}),t.jsx(I,{columns:E,data:a,keyExtractor:e=>e.id,onRowClick:e=>d(`/jobs/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No jobs recorded yet",error:j,onRetry:l,emptyIcon:t.jsx(n,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:g,onClick:b,loading:s})]})]})}export{U as default};
@@ -1 +1 @@
1
- import{j as a}from"./index-BaD1MX7a.js";import{p as d,f as x}from"./date-Dwgqy666.js";import{D as r,f as m}from"./DetailRow-BC_kcJT3.js";import{C as o}from"./types-BHYinjn2.js";import{u as b,C as h,T as g}from"./EntryDetailPage-DUWwJ_hP.js";import"./vendor-DBTT3jXp.js";import"./search-BtkJjUPF.js";const i={verbose:{variant:"default",label:"VERBOSE"},debug:{variant:"info",label:"DEBUG"},log:{variant:"success",label:"LOG"},warn:{variant:"warning",label:"WARNING"},error:{variant:"error",label:"ERROR"}};function w({entry:c}){const{payload:e,createdAt:s}=c,n=i[e.level]||i.log,t=b(),l=e.metadata&&Object.keys(e.metadata).length>0?[{id:"metadata",label:"Metadata",content:a.jsx(h,{data:e.metadata,toolbarState:t.state,searchBar:t.SearchBar,maxHeight:400})}]:[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Log Details"})}),a.jsx("div",{className:"p-4",children:a.jsxs("dl",{className:"*:not-first:border-y-0",children:[a.jsx(r,{label:"Time",value:a.jsxs("span",{children:[m(d(s),"MMMM do yyyy, h:mm:ss a")," ",a.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",x(d(s),{addSuffix:!0}),")"]})]})}),a.jsx(r,{label:"Level",value:a.jsx(o,{listType:"logs",filterType:"levels",filterValue:e.level,children:n.label})}),e.context&&a.jsx(r,{label:"Context",value:a.jsx(o,{listType:"logs",filterType:"contexts",filterValue:e.context,className:"font-mono",children:e.context})})]})})]}),a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Message"})}),a.jsx("div",{className:"p-4",children:a.jsx("p",{className:`text-sm ${e.level==="error"?"text-red-600 dark:text-red-400":e.level==="warn"?"text-yellow-600 dark:text-yellow-400":"text-gray-900 dark:text-white"}`,children:e.message})})]}),l.length>0&&a.jsx(g,{tabs:l,defaultTab:"metadata",headerRight:a.jsx(t.Toolbar,{data:e.metadata})}),e.stack&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Stack Trace"})}),a.jsx("div",{className:"p-4 bg-gray-900 dark:bg-gray-950 overflow-x-auto",children:a.jsx("pre",{className:"text-sm text-red-400 font-mono whitespace-pre-wrap",children:e.stack})})]})]})}export{w as default};
1
+ import{j as a}from"./index-DPytPgll.js";import{p as d,f as x}from"./date-Dwgqy666.js";import{D as r,f as m}from"./DetailRow-CxyUq52b.js";import{C as o}from"./types-ClDKWGzY.js";import{u as b,C as h,T as g}from"./EntryDetailPage-D0maRTjK.js";import"./vendor-DBTT3jXp.js";import"./search-DAygxhiQ.js";const i={verbose:{variant:"default",label:"VERBOSE"},debug:{variant:"info",label:"DEBUG"},log:{variant:"success",label:"LOG"},warn:{variant:"warning",label:"WARNING"},error:{variant:"error",label:"ERROR"}};function w({entry:c}){const{payload:e,createdAt:s}=c,n=i[e.level]||i.log,t=b(),l=e.metadata&&Object.keys(e.metadata).length>0?[{id:"metadata",label:"Metadata",content:a.jsx(h,{data:e.metadata,toolbarState:t.state,searchBar:t.SearchBar,maxHeight:400})}]:[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Log Details"})}),a.jsx("div",{className:"p-4",children:a.jsxs("dl",{className:"*:not-first:border-y-0",children:[a.jsx(r,{label:"Time",value:a.jsxs("span",{children:[m(d(s),"MMMM do yyyy, h:mm:ss a")," ",a.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",x(d(s),{addSuffix:!0}),")"]})]})}),a.jsx(r,{label:"Level",value:a.jsx(o,{listType:"logs",filterType:"levels",filterValue:e.level,children:n.label})}),e.context&&a.jsx(r,{label:"Context",value:a.jsx(o,{listType:"logs",filterType:"contexts",filterValue:e.context,className:"font-mono",children:e.context})})]})})]}),a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Message"})}),a.jsx("div",{className:"p-4",children:a.jsx("p",{className:`text-sm ${e.level==="error"?"text-red-600 dark:text-red-400":e.level==="warn"?"text-yellow-600 dark:text-yellow-400":"text-gray-900 dark:text-white"}`,children:e.message})})]}),l.length>0&&a.jsx(g,{tabs:l,defaultTab:"metadata",headerRight:a.jsx(t.Toolbar,{data:e.metadata})}),e.stack&&a.jsxs("div",{className:"card",children:[a.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Stack Trace"})}),a.jsx("div",{className:"p-4 bg-gray-900 dark:bg-gray-950 overflow-x-auto",children:a.jsx("pre",{className:"text-sm text-red-400 font-mono whitespace-pre-wrap",children:e.stack})})]})]})}export{w as default};
@@ -1 +1 @@
1
- import{j as t,F as i}from"./index-BaD1MX7a.js";import{e as T,b as F}from"./vendor-DBTT3jXp.js";import{f as R,p as L}from"./date-Dwgqy666.js";import{u as M,a as A,P,R as B,N as D,L as S}from"./PageHeader-Tnp0JBDF.js";import{u as H,c as I,C as n}from"./types-BHYinjn2.js";import{E as W}from"./EntrySearchInput-Iv-9Wirn.js";import{T as o,b as $}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";import"./search-BtkJjUPF.js";function X(){const d=T(),{clearAll:c,serverFilters:g,headerFilters:m}=H("logs"),{rangeFilters:x,windowMinutes:h}=M(),{entries:p,loading:u,refreshing:s,error:f,refresh:l,newEntriesCount:y,hasMore:j,loadMore:C,loadNew:b,autoRefreshEnabled:w,live:v,setAutoRefresh:N,meta:r,isHighlighted:E}=A({type:"log",limit:50,filters:{...g,...x},windowMinutes:h}),a=p.filter(e=>I(e)),k=F.useMemo(()=>[{key:"level",header:"Level",width:"100px",render:e=>t.jsx(n,{listType:"logs",filterType:"levels",children:e.payload.level})},{key:"message",header:"Message",minWidth:"300px",render:e=>t.jsx(o,{truncate:!0,maxWidth:"500px",children:e.payload.message.length>100?e.payload.message.substring(0,100)+"...":e.payload.message})},{key:"context",header:"Context",width:"150px",render:e=>e.payload.context?t.jsx(n,{listType:"logs",filterType:"contexts",className:"font-mono",children:e.payload.context}):t.jsx(o,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:R(L(e.createdAt),{addSuffix:!0})})}],[]);return u&&a.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(P,{title:"Logs",icon:i,iconColor:"text-green-600 dark:text-green-400",count:a.length,totalCount:r==null?void 0:r.total,clearable:{type:"log",label:"logs",onCleared:l},refreshing:s,autoRefreshEnabled:w,live:v,onAutoRefreshToggle:N,filters:m,filterControls:t.jsx(B,{route:"logs"}),onClearAllFilters:c}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{placeholder:"Search by message, level, context, tag, or content..."}),t.jsx(D,{count:y,onClick:b,loading:s}),t.jsx($,{columns:k,data:a,keyExtractor:e=>e.id,onRowClick:e=>d(`/logs/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No logs recorded yet",error:f,onRetry:l,emptyIcon:t.jsx(i,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(S,{hasMore:j,onClick:C,loading:s})]})]})}export{X as default};
1
+ import{j as t,F as i}from"./index-DPytPgll.js";import{e as T,b as F}from"./vendor-DBTT3jXp.js";import{f as R,p as L}from"./date-Dwgqy666.js";import{u as M,a as A,P,R as B,N as D,L as S}from"./PageHeader-D3jf36Yh.js";import{u as H,c as I,C as n}from"./types-ClDKWGzY.js";import{E as W}from"./EntrySearchInput-DsNY9wzV.js";import{T as o,b as $}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";import"./search-DAygxhiQ.js";function X(){const d=T(),{clearAll:c,serverFilters:g,headerFilters:m}=H("logs"),{rangeFilters:x,windowMinutes:h}=M(),{entries:p,loading:u,refreshing:s,error:f,refresh:l,newEntriesCount:y,hasMore:j,loadMore:C,loadNew:b,autoRefreshEnabled:w,live:v,setAutoRefresh:N,meta:r,isHighlighted:E}=A({type:"log",limit:50,filters:{...g,...x},windowMinutes:h}),a=p.filter(e=>I(e)),k=F.useMemo(()=>[{key:"level",header:"Level",width:"100px",render:e=>t.jsx(n,{listType:"logs",filterType:"levels",children:e.payload.level})},{key:"message",header:"Message",minWidth:"300px",render:e=>t.jsx(o,{truncate:!0,maxWidth:"500px",children:e.payload.message.length>100?e.payload.message.substring(0,100)+"...":e.payload.message})},{key:"context",header:"Context",width:"150px",render:e=>e.payload.context?t.jsx(n,{listType:"logs",filterType:"contexts",className:"font-mono",children:e.payload.context}):t.jsx(o,{secondary:!0,children:"—"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:R(L(e.createdAt),{addSuffix:!0})})}],[]);return u&&a.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(P,{title:"Logs",icon:i,iconColor:"text-green-600 dark:text-green-400",count:a.length,totalCount:r==null?void 0:r.total,clearable:{type:"log",label:"logs",onCleared:l},refreshing:s,autoRefreshEnabled:w,live:v,onAutoRefreshToggle:N,filters:m,filterControls:t.jsx(B,{route:"logs"}),onClearAllFilters:c}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(W,{placeholder:"Search by message, level, context, tag, or content..."}),t.jsx(D,{count:y,onClick:b,loading:s}),t.jsx($,{columns:k,data:a,keyExtractor:e=>e.id,onRowClick:e=>d(`/logs/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No logs recorded yet",error:f,onRetry:l,emptyIcon:t.jsx(i,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(S,{hasMore:j,onClick:C,loading:s})]})]})}export{X as default};
@@ -1,4 +1,4 @@
1
- import{c as pr,j as l,M as fn,C as dr}from"./index-BaD1MX7a.js";import{C as hr,B as gr}from"./types-BHYinjn2.js";import{p as Rt,f as Tr}from"./date-Dwgqy666.js";import{D as $,f as _r}from"./DetailRow-BC_kcJT3.js";import{T as xr}from"./EntryDetailPage-DUWwJ_hP.js";import{C as we}from"./CopyButton-DaF0vYeo.js";import{C as br}from"./circle-x-CioeSSBA.js";import{C as yr}from"./circle-check-big-DZttXeD-.js";import{U as Ar}from"./users-BHTpEUZQ.js";import{C as Er}from"./circle-alert-BEvvepIR.js";import"./vendor-DBTT3jXp.js";import"./search-BtkJjUPF.js";/**
1
+ import{c as pr,j as l,M as fn,C as dr}from"./index-DPytPgll.js";import{C as hr,B as gr}from"./types-ClDKWGzY.js";import{p as Rt,f as Tr}from"./date-Dwgqy666.js";import{D as $,f as _r}from"./DetailRow-CxyUq52b.js";import{T as xr}from"./EntryDetailPage-D0maRTjK.js";import{C as we}from"./CopyButton-DZpH1CB7.js";import{C as br}from"./circle-x-BgJQ7XT5.js";import{C as yr}from"./circle-check-big-BJmx6lMP.js";import{U as Ar}from"./users-BP0wthJA.js";import{C as Er}from"./circle-alert-B3cgcIeS.js";import"./vendor-DBTT3jXp.js";import"./search-DAygxhiQ.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as t,M as c}from"./index-BaD1MX7a.js";import{e as D,b as m}from"./vendor-DBTT3jXp.js";import{f as L,p as P}from"./date-Dwgqy666.js";import{u as S,a as W,P as B,R as $,N as H,L as q}from"./PageHeader-Tnp0JBDF.js";import{u as I,g as z,C as G}from"./types-BHYinjn2.js";import{T as n,D as J,a as K,b as O}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";const Q=["sent","failed","pending","queued","error"];function te(){const g=D(),{addFilter:o,clearAll:h,serverFilters:p,headerFilters:x}=I("mail"),{rangeFilters:f,windowMinutes:y}=S(),{entries:j,loading:b,refreshing:r,error:C,refresh:d,newEntriesCount:k,hasMore:w,loadMore:T,loadNew:N,autoRefreshEnabled:M,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=W({type:"mail",limit:50,filters:{...p,...f},windowMinutes:y}),i=j.filter(e=>z(e)),u=m.useCallback(e=>{const a=Array.isArray(e)?e:[e];return a.length===1?a[0]:`${a[0]} +${a.length-1}`},[]),F=m.useMemo(()=>[{key:"status",header:"Status",width:"80px",render:e=>t.jsx(G,{listType:"mail",filterType:"statuses",children:e.payload.status})},{key:"subject",header:"Subject",minWidth:"250px",render:e=>t.jsx(n,{truncate:!0,maxWidth:"350px",children:e.payload.subject.length>60?e.payload.subject.substring(0,60)+"...":e.payload.subject})},{key:"to",header:"To",width:"200px",render:e=>t.jsx(n,{mono:!0,secondary:!0,truncate:!0,maxWidth:"180px",children:u(e.payload.to)})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(J,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const a=(e.tags??[]).filter(l=>!Q.includes(l.toLowerCase()));return t.jsx(K,{tags:a,max:3,onTagClick:(l,A)=>{A.stopPropagation(),o("tags",l)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(n,{secondary:!0,className:"text-xs",children:L(P(e.createdAt),{addSuffix:!0})})}],[o,u]);return b&&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(B,{title:"Mail",icon:c,iconColor:"text-pink-600 dark:text-pink-400",count:i.length,totalCount:s==null?void 0:s.total,clearable:{type:"mail",label:"mail",onCleared:d},refreshing:r,autoRefreshEnabled:M,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx($,{route:"mail"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:k,onClick:N,loading:r}),t.jsx(O,{columns:F,data:i,keyExtractor:e=>e.id,onRowClick:e=>g(`/mail/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No emails recorded yet",error:C,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:w,onClick:T,loading:r})]})]})}export{te as default};
1
+ import{j as t,M as c}from"./index-DPytPgll.js";import{e as D,b as m}from"./vendor-DBTT3jXp.js";import{f as L,p as P}from"./date-Dwgqy666.js";import{u as S,a as W,P as B,R as $,N as H,L as q}from"./PageHeader-D3jf36Yh.js";import{u as I,g as z,C as G}from"./types-ClDKWGzY.js";import{T as n,D as J,a as K,b as O}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";const Q=["sent","failed","pending","queued","error"];function te(){const g=D(),{addFilter:o,clearAll:h,serverFilters:p,headerFilters:x}=I("mail"),{rangeFilters:f,windowMinutes:y}=S(),{entries:j,loading:b,refreshing:r,error:C,refresh:d,newEntriesCount:k,hasMore:w,loadMore:T,loadNew:N,autoRefreshEnabled:M,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=W({type:"mail",limit:50,filters:{...p,...f},windowMinutes:y}),i=j.filter(e=>z(e)),u=m.useCallback(e=>{const a=Array.isArray(e)?e:[e];return a.length===1?a[0]:`${a[0]} +${a.length-1}`},[]),F=m.useMemo(()=>[{key:"status",header:"Status",width:"80px",render:e=>t.jsx(G,{listType:"mail",filterType:"statuses",children:e.payload.status})},{key:"subject",header:"Subject",minWidth:"250px",render:e=>t.jsx(n,{truncate:!0,maxWidth:"350px",children:e.payload.subject.length>60?e.payload.subject.substring(0,60)+"...":e.payload.subject})},{key:"to",header:"To",width:"200px",render:e=>t.jsx(n,{mono:!0,secondary:!0,truncate:!0,maxWidth:"180px",children:u(e.payload.to)})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(J,{ms:e.payload.duration||0})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const a=(e.tags??[]).filter(l=>!Q.includes(l.toLowerCase()));return t.jsx(K,{tags:a,max:3,onTagClick:(l,A)=>{A.stopPropagation(),o("tags",l)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(n,{secondary:!0,className:"text-xs",children:L(P(e.createdAt),{addSuffix:!0})})}],[o,u]);return b&&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(B,{title:"Mail",icon:c,iconColor:"text-pink-600 dark:text-pink-400",count:i.length,totalCount:s==null?void 0:s.total,clearable:{type:"mail",label:"mail",onCleared:d},refreshing:r,autoRefreshEnabled:M,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx($,{route:"mail"}),onClearAllFilters:h}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:k,onClick:N,loading:r}),t.jsx(O,{columns:F,data:i,keyExtractor:e=>e.id,onRowClick:e=>g(`/mail/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No emails recorded yet",error:C,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(q,{hasMore:w,onClick:T,loading:r})]})]})}export{te as default};
@@ -1 +1 @@
1
- import{j as e,d as o,F as b,C as g,D as u}from"./index-BaD1MX7a.js";import{b as y}from"./vendor-DBTT3jXp.js";import{p as x,f}from"./date-Dwgqy666.js";import{D as s,f as N}from"./DetailRow-BC_kcJT3.js";import{C as l}from"./types-BHYinjn2.js";import{u as n,C as m,T as v}from"./EntryDetailPage-DUWwJ_hP.js";import{C as k}from"./CopyButton-DaF0vYeo.js";import{C as w}from"./circle-x-CioeSSBA.js";import"./search-BtkJjUPF.js";function V({entry:p}){const{payload:a,createdAt:i}=p,t=n(),d=n(),[c,h]=y.useState("data"),r=[];a.data!==void 0&&r.push({id:"data",label:"Data",content:e.jsx(m,{data:a.data,toolbarState:t.state,searchBar:t.SearchBar,maxHeight:400})}),a.where!==void 0&&r.push({id:"where",label:"Where",content:e.jsx(m,{data:a.where,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})});const j=()=>{if(c==="data"&&a.data!==void 0)return e.jsx(t.Toolbar,{data:a.data});if(c==="where"&&a.where!==void 0)return e.jsx(d.Toolbar,{data:a.where})};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.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 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(o,{className:"h-5 w-5 text-purple-600 dark:text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.entity}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Model Event"})]})]}),e.jsx(k,{text:a.entity,label:"Copy entity name"})]})}),e.jsxs("div",{className:`grid ${a.recordCount!==void 0?"grid-cols-2 md:grid-cols-4":"grid-cols-2 md:grid-cols-3"} 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(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Action"})]}),e.jsx("p",{className:"text-lg font-bold text-purple-600 dark:text-purple-400",children:a.action.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(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Entity"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.entity,children:a.entity})]}),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(g,{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"})]})]}),a.recordCount!==void 0&&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(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Records"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a.recordCount})]})]})]}),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:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[N(x(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",f(x(i),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Action",value:e.jsx(l,{listType:"models",filterType:"actions",filterValue:a.action,children:a.action.toUpperCase()})}),e.jsx(s,{label:"Entity",value:e.jsx(l,{listType:"models",filterType:"entities",filterValue:a.entity,children:a.entity})}),a.source&&e.jsx(s,{label:"Source",value:e.jsx(l,{listType:"models",filterType:"sources",filterValue:a.source,children:a.source})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`}),a.recordCount!==void 0&&e.jsx(s,{label:"Records",value:String(a.recordCount)})]})})]}),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(w,{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})})]}),r.length>0&&e.jsx(v,{tabs:r,defaultTab:"data",hashKey:"model",headerRight:j(),onTabChange:h})]})}export{V as default};
1
+ import{j as e,d as o,F as b,C as g,D as u}from"./index-DPytPgll.js";import{b as y}from"./vendor-DBTT3jXp.js";import{p as x,f}from"./date-Dwgqy666.js";import{D as s,f as N}from"./DetailRow-CxyUq52b.js";import{C as l}from"./types-ClDKWGzY.js";import{u as n,C as m,T as v}from"./EntryDetailPage-D0maRTjK.js";import{C as k}from"./CopyButton-DZpH1CB7.js";import{C as w}from"./circle-x-BgJQ7XT5.js";import"./search-DAygxhiQ.js";function V({entry:p}){const{payload:a,createdAt:i}=p,t=n(),d=n(),[c,h]=y.useState("data"),r=[];a.data!==void 0&&r.push({id:"data",label:"Data",content:e.jsx(m,{data:a.data,toolbarState:t.state,searchBar:t.SearchBar,maxHeight:400})}),a.where!==void 0&&r.push({id:"where",label:"Where",content:e.jsx(m,{data:a.where,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})});const j=()=>{if(c==="data"&&a.data!==void 0)return e.jsx(t.Toolbar,{data:a.data});if(c==="where"&&a.where!==void 0)return e.jsx(d.Toolbar,{data:a.where})};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.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 bg-purple-100 dark:bg-purple-900/30 rounded-lg",children:e.jsx(o,{className:"h-5 w-5 text-purple-600 dark:text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.entity}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Model Event"})]})]}),e.jsx(k,{text:a.entity,label:"Copy entity name"})]})}),e.jsxs("div",{className:`grid ${a.recordCount!==void 0?"grid-cols-2 md:grid-cols-4":"grid-cols-2 md:grid-cols-3"} 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(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Action"})]}),e.jsx("p",{className:"text-lg font-bold text-purple-600 dark:text-purple-400",children:a.action.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(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Entity"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.entity,children:a.entity})]}),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(g,{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"})]})]}),a.recordCount!==void 0&&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(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Records"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a.recordCount})]})]})]}),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:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[N(x(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",f(x(i),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Action",value:e.jsx(l,{listType:"models",filterType:"actions",filterValue:a.action,children:a.action.toUpperCase()})}),e.jsx(s,{label:"Entity",value:e.jsx(l,{listType:"models",filterType:"entities",filterValue:a.entity,children:a.entity})}),a.source&&e.jsx(s,{label:"Source",value:e.jsx(l,{listType:"models",filterType:"sources",filterValue:a.source,children:a.source})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`}),a.recordCount!==void 0&&e.jsx(s,{label:"Records",value:String(a.recordCount)})]})})]}),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(w,{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})})]}),r.length>0&&e.jsx(v,{tabs:r,defaultTab:"data",hashKey:"model",headerRight:j(),onTabChange:h})]})}export{V as default};
@@ -1 +1 @@
1
- import{j as t,d as c}from"./index-BaD1MX7a.js";import{e as P,b as A}from"./vendor-DBTT3jXp.js";import{f as D,p as T}from"./date-Dwgqy666.js";import{u as B,a as L,P as H,R as S,N as I,L as U}from"./PageHeader-Tnp0JBDF.js";import{u as $,l as q,C as l}from"./types-BHYinjn2.js";import{T as o,D as z,b as G}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";function Y(){const u=P(),{addFilter:a,clearAll:p,serverFilters:m,headerFilters:h}=$("models"),{rangeFilters:x,windowMinutes:g}=B(),{entries:y,loading:f,refreshing:s,error:j,refresh:d,newEntriesCount:C,hasMore:w,loadMore:k,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:v,meta:i,isHighlighted:R}=L({type:"model",limit:50,filters:{...m,...x},windowMinutes:g}),n=y.filter(e=>q(e)),M=A.useMemo(()=>[{key:"action",header:"Action",width:"120px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("actions",e.payload.action)},children:e.payload.action.toUpperCase()})},{key:"entity",header:"Entity",width:"150px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("entities",e.payload.entity)},className:"font-mono",children:e.payload.entity})},{key:"source",header:"Source",width:"150px",render:e=>{const r=e.payload.source;return r?t.jsx(l,{onClick:F=>{F.stopPropagation(),a("sources",r)},className:"font-mono text-xs",children:r}):t.jsx(o,{secondary:!0,children:"-"})}},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(z,{ms:e.payload.duration||0})},{key:"records",header:"Records",width:"80px",align:"center",render:e=>e.payload.recordCount!==void 0?t.jsx(o,{children:e.payload.recordCount}):t.jsx(o,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:D(T(e.createdAt),{addSuffix:!0})})}],[a]);return f&&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(H,{title:"Models",icon:c,iconColor:"text-purple-600 dark:text-purple-400",count:n.length,totalCount:i==null?void 0:i.total,clearable:{type:"model",label:"models",onCleared:d},refreshing:s,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:v,filters:h,filterControls:t.jsx(S,{route:"models"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(I,{count:C,onClick:N,loading:s}),t.jsx(G,{columns:M,data:n,keyExtractor:e=>e.id,onRowClick:e=>u(`/models/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No model events recorded yet",error:j,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(U,{hasMore:w,onClick:k,loading:s})]})]})}export{Y as default};
1
+ import{j as t,d as c}from"./index-DPytPgll.js";import{e as P,b as A}from"./vendor-DBTT3jXp.js";import{f as D,p as T}from"./date-Dwgqy666.js";import{u as B,a as L,P as H,R as S,N as I,L as U}from"./PageHeader-D3jf36Yh.js";import{u as $,l as q,C as l}from"./types-ClDKWGzY.js";import{T as o,D as z,b as G}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";function Y(){const u=P(),{addFilter:a,clearAll:p,serverFilters:m,headerFilters:h}=$("models"),{rangeFilters:x,windowMinutes:g}=B(),{entries:y,loading:f,refreshing:s,error:j,refresh:d,newEntriesCount:C,hasMore:w,loadMore:k,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:v,meta:i,isHighlighted:R}=L({type:"model",limit:50,filters:{...m,...x},windowMinutes:g}),n=y.filter(e=>q(e)),M=A.useMemo(()=>[{key:"action",header:"Action",width:"120px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("actions",e.payload.action)},children:e.payload.action.toUpperCase()})},{key:"entity",header:"Entity",width:"150px",render:e=>t.jsx(l,{onClick:r=>{r.stopPropagation(),a("entities",e.payload.entity)},className:"font-mono",children:e.payload.entity})},{key:"source",header:"Source",width:"150px",render:e=>{const r=e.payload.source;return r?t.jsx(l,{onClick:F=>{F.stopPropagation(),a("sources",r)},className:"font-mono text-xs",children:r}):t.jsx(o,{secondary:!0,children:"-"})}},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(z,{ms:e.payload.duration||0})},{key:"records",header:"Records",width:"80px",align:"center",render:e=>e.payload.recordCount!==void 0?t.jsx(o,{children:e.payload.recordCount}):t.jsx(o,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(o,{secondary:!0,className:"text-xs",children:D(T(e.createdAt),{addSuffix:!0})})}],[a]);return f&&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(H,{title:"Models",icon:c,iconColor:"text-purple-600 dark:text-purple-400",count:n.length,totalCount:i==null?void 0:i.total,clearable:{type:"model",label:"models",onCleared:d},refreshing:s,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:v,filters:h,filterControls:t.jsx(S,{route:"models"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(I,{count:C,onClick:N,loading:s}),t.jsx(G,{columns:M,data:n,keyExtractor:e=>e.id,onRowClick:e=>u(`/models/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No model events recorded yet",error:j,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(U,{hasMore:w,onClick:k,loading:s})]})]})}export{Y as default};
@@ -1 +1 @@
1
- import{j as e,f as c,C as j}from"./index-BaD1MX7a.js";import{p as x,f as b}from"./date-Dwgqy666.js";import{D as s,f as y}from"./DetailRow-BC_kcJT3.js";import{C as n}from"./types-BHYinjn2.js";import{u as f,C as N,T as u}from"./EntryDetailPage-DUWwJ_hP.js";import{C as v}from"./CopyButton-DaF0vYeo.js";import{C as k}from"./circle-check-big-DZttXeD-.js";import{C as o}from"./circle-x-CioeSSBA.js";import{S as w}from"./send-CvZt49HP.js";import"./vendor-DBTT3jXp.js";import"./search-BtkJjUPF.js";function I({entry:m}){const{payload:a,createdAt:l}=m,i=f(),t=a.status==="sent"?{icon:k,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:o,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},p=t.icon,d=a.metadata!==void 0?[{id:"metadata",label:"Metadata",content:e.jsx(N,{data:a.metadata,toolbarState:i.state,searchBar:i.SearchBar,maxHeight:400})}]:[],r=Array.isArray(a.recipient)?a.recipient:[a.recipient];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.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(c,{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",children:a.title||a.type}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Notification"})]})]}),e.jsx(v,{text:r.join(", "),label:"Copy recipient"})]})}),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(c,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Type"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white truncate",title:a.type,children:a.type})]}),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 ${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(j,{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(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Recipients"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:r.length})]})]})]}),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:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[y(x(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",b(x(l),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Type",value:e.jsx(n,{listType:"notifications",filterType:"types",filterValue:a.type,children:a.type})}),e.jsx(s,{label:r.length>1?"Recipients":"Recipient",value:e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((h,g)=>e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:h},g))})}),a.title&&e.jsx(s,{label:"Title",value:a.title}),a.message&&e.jsx(s,{label:"Message",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:a.message})}),e.jsx(s,{label:"Status",value:e.jsx(n,{listType:"notifications",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`})]})})]}),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(o,{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})})]}),d.length>0&&e.jsx(u,{tabs:d,defaultTab:"metadata",hashKey:"notification",headerRight:e.jsx(i.Toolbar,{data:a.metadata})})]})}export{I as default};
1
+ import{j as e,f as c,C as j}from"./index-DPytPgll.js";import{p as x,f as b}from"./date-Dwgqy666.js";import{D as s,f as y}from"./DetailRow-CxyUq52b.js";import{C as n}from"./types-ClDKWGzY.js";import{u as f,C as N,T as u}from"./EntryDetailPage-D0maRTjK.js";import{C as v}from"./CopyButton-DZpH1CB7.js";import{C as k}from"./circle-check-big-BJmx6lMP.js";import{C as o}from"./circle-x-BgJQ7XT5.js";import{S as w}from"./send-BiSM0J_o.js";import"./vendor-DBTT3jXp.js";import"./search-DAygxhiQ.js";function I({entry:m}){const{payload:a,createdAt:l}=m,i=f(),t=a.status==="sent"?{icon:k,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:o,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},p=t.icon,d=a.metadata!==void 0?[{id:"metadata",label:"Metadata",content:e.jsx(N,{data:a.metadata,toolbarState:i.state,searchBar:i.SearchBar,maxHeight:400})}]:[],r=Array.isArray(a.recipient)?a.recipient:[a.recipient];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.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(c,{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",children:a.title||a.type}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Notification"})]})]}),e.jsx(v,{text:r.join(", "),label:"Copy recipient"})]})}),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(c,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Type"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white truncate",title:a.type,children:a.type})]}),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 ${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(j,{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(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Recipients"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:r.length})]})]})]}),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:"*:not-first:border-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[y(x(l),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",b(x(l),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Type",value:e.jsx(n,{listType:"notifications",filterType:"types",filterValue:a.type,children:a.type})}),e.jsx(s,{label:r.length>1?"Recipients":"Recipient",value:e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((h,g)=>e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:h},g))})}),a.title&&e.jsx(s,{label:"Title",value:a.title}),a.message&&e.jsx(s,{label:"Message",value:e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:a.message})}),e.jsx(s,{label:"Status",value:e.jsx(n,{listType:"notifications",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`})]})})]}),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(o,{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})})]}),d.length>0&&e.jsx(u,{tabs:d,defaultTab:"metadata",hashKey:"notification",headerRight:e.jsx(i.Toolbar,{data:a.metadata})})]})}export{I as default};
@@ -1 +1 @@
1
- import{j as t,f as d}from"./index-BaD1MX7a.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as W,R as L,N as H,L as S}from"./PageHeader-Tnp0JBDF.js";import{u as I,m as U,C as c}from"./types-BHYinjn2.js";import{T as a,D as $,b as q}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";function X(){const p=T(),{addFilter:i,clearAll:u,serverFilters:h,headerFilters:x}=I("notifications"),{rangeFilters:m,windowMinutes:f}=A(),{entries:g,loading:y,refreshing:r,error:j,refresh:l,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"notification",limit:50,filters:{...h,...m},windowMinutes:f}),o=g.filter(e=>U(e)),F=D.useMemo(()=>[{key:"type",header:"Type",width:"150px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("types",e.payload.type)},children:e.payload.type})},{key:"recipient",header:"Recipient",minWidth:"200px",render:e=>t.jsx(a,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.recipient})},{key:"title",header:"Title",minWidth:"200px",render:e=>e.payload.title?t.jsx(a,{truncate:!0,maxWidth:"300px",children:e.payload.title}):t.jsx(a,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[i]);return y&&o.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(W,{title:"Notifications",icon:d,iconColor:"text-indigo-600 dark:text-indigo-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"notification",label:"notifications",onCleared:l},refreshing:r,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx(L,{route:"notifications"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:C,onClick:N,loading:r}),t.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>p(`/notifications/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No notifications recorded yet",error:j,onRetry:l,emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
1
+ import{j as t,f as d}from"./index-DPytPgll.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as W,R as L,N as H,L as S}from"./PageHeader-D3jf36Yh.js";import{u as I,m as U,C as c}from"./types-ClDKWGzY.js";import{T as a,D as $,b as q}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";function X(){const p=T(),{addFilter:i,clearAll:u,serverFilters:h,headerFilters:x}=I("notifications"),{rangeFilters:m,windowMinutes:f}=A(),{entries:g,loading:y,refreshing:r,error:j,refresh:l,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:b,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"notification",limit:50,filters:{...h,...m},windowMinutes:f}),o=g.filter(e=>U(e)),F=D.useMemo(()=>[{key:"type",header:"Type",width:"150px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("types",e.payload.type)},children:e.payload.type})},{key:"recipient",header:"Recipient",minWidth:"200px",render:e=>t.jsx(a,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.recipient})},{key:"title",header:"Title",minWidth:"200px",render:e=>e.payload.title?t.jsx(a,{truncate:!0,maxWidth:"300px",children:e.payload.title}):t.jsx(a,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(c,{onClick:n=>{n.stopPropagation(),i("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx($,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(a,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[i]);return y&&o.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(W,{title:"Notifications",icon:d,iconColor:"text-indigo-600 dark:text-indigo-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"notification",label:"notifications",onCleared:l},refreshing:r,autoRefreshEnabled:b,live:E,onAutoRefreshToggle:R,filters:x,filterControls:t.jsx(L,{route:"notifications"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(H,{count:C,onClick:N,loading:r}),t.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>p(`/notifications/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No notifications recorded yet",error:j,onRetry:l,emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
@@ -1 +1 @@
1
- import{b as a,f as je}from"./vendor-DBTT3jXp.js";import{t as Se,z as q,p as I,v as Ne,w as Re,j as e,C as Ce,x as G,l as X,f as Ee,y as Le,k as $e,X as Fe}from"./index-BaD1MX7a.js";import{t as Ae}from"./types-BHYinjn2.js";import{T as De}from"./timer-D72f3hG4.js";function Oe(){return Se("/stream")}function Ie(s,r=!0){const n=a.useRef(s),[i,o]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!r||typeof EventSource>"u")return;const d=new EventSource(Oe(),{withCredentials:!0}),u=l=>{try{n.current(JSON.parse(l.data))}catch{}};return d.addEventListener("entry",u),d.onopen=()=>o(!0),d.onerror=()=>o(!1),()=>{d.removeEventListener("entry",u),d.close(),o(!1)}},[r]),{connected:i}}function Y(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(Y).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${Y(s[n])}`).join(",")+"}"}const se=500;function ne(s,r){if(r.length===0)return s;const n=new Set(s.map(d=>d.id)),i=r.filter(d=>!n.has(d.id));if(i.length===0)return s;const o=[...i,...s];return o.length>se?o.slice(0,se):o}const ce="nestlens-auto-refresh";function qe(){try{const s=localStorage.getItem(ce);return s===null?!0:s==="true"}catch{return!0}}function Te(s){try{localStorage.setItem(ce,String(s))}catch{}}function ze(s={}){const{type:r,limit:n=50,autoRefresh:i,autoRefreshInterval:o=5e3,filters:d,windowMinutes:u}=s,l=Y(d),x=`${r}|${n}|${l}|${u??0}`,[j,N]=a.useState({key:l,value:d});j.key!==l&&N({key:l,value:d});const R=j.value,h=a.useCallback(()=>!u||u<=0?R:{...R,from:new Date(Date.now()-u*6e4).toISOString()},[R,u]),[m,g]=a.useState([]),[S,$]=a.useState(null),[C,E]=a.useState(!1),[M,F]=a.useState(null),[k,A]=a.useState(null),[y,p]=a.useState(0),[b,H]=a.useState(i??qe()),v=a.useRef(null),T=a.useRef(null),D=a.useRef(!1),W=a.useRef(null),oe=a.useRef(!0),de=S===null&&M===null,ue=C||S!==null&&S!==x,me=a.useRef(l),P=a.useRef(new Map),[,ge]=a.useState(0),Q=1e4,Z=a.useCallback(t=>{g(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0),F(null),oe.current=!1,me.current=l,$(x)},[l,x]),ee=a.useCallback(t=>{const c=t instanceof Error?t:new Error("Failed to fetch entries");F(c),console.error("Failed to fetch entries:",t),q.error("Failed to load entries"),$(x)},[x]),fe=a.useCallback(async()=>{if(!(!(k!=null&&k.oldestSequence)||!k.hasMore)){E(!0);try{const t=await I({type:r,limit:n,beforeSequence:k.oldestSequence,filters:h()});g(c=>{const f=new Set(c.map(w=>w.id));return[...c,...t.data.filter(w=>!f.has(w.id))]}),A(t.meta)}catch(t){console.error("Failed to load more entries:",t),q.error("Failed to load more entries")}finally{E(!1)}}},[r,n,k,h]),he=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0,E(!0);try{const t=await I({type:r,limit:y||n,afterSequence:v.current,filters:h()});if(t.data.length>0){const c=Date.now();t.data.forEach(f=>{P.current.set(f.id,c)}),g(f=>ne(f,t.data)),v.current=t.meta.newestSequence,p(0)}}catch(t){console.error("Failed to load new entries:",t),q.error("Failed to load new entries")}finally{D.current=!1,E(!1)}}},[r,n,y,h]),U=a.useCallback(async()=>{E(!0);try{F(null);const t=await I({type:r,limit:n,filters:h()});g(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0)}catch(t){const c=t instanceof Error?t:new Error("Failed to refresh entries");F(c),console.error("Failed to refresh entries:",t),q.error("Failed to refresh entries")}finally{E(!1)}},[r,n,h]),xe=t=>!!(t&&Object.values(t).some(c=>Array.isArray(c)?c.length>0:c!==void 0&&c!=="")),_=a.useCallback(async()=>{if(!v.current){await U();return}const t=h();try{if(!xe(t)){const f=await Ne(v.current,r);p(f.data.count);return}const c=await I({type:r,limit:n,afterSequence:v.current,filters:t});p(c.data.length)}catch{}},[r,n,h,U]),ye=a.useCallback(t=>{H(t),Te(t)},[]),pe=a.useCallback(t=>{g(c=>c.map(f=>f.id===t.id?t:f))},[]);a.useEffect(()=>{let t=!0;return I({type:r,limit:n,filters:h()}).then(c=>{t&&Z(c)},c=>{t&&ee(c)}),()=>{t=!1}},[r,n,h,Z,ee]);const be=a.useCallback(t=>{const c=P.current.get(t);return c?Date.now()-c<Q:!1},[]),te=a.useCallback(()=>{const t=Date.now();let c=!1;P.current.forEach((f,w)=>{t-f>=Q&&(P.current.delete(w),c=!0)}),c&&ge(f=>f+1)},[]),B=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0;try{const t=W.current??v.current,f=(await Re(r)).data;if(typeof f=="number"&&f>t){const w=await I({type:r,limit:n,afterSequence:t,filters:h()});if(W.current=w.meta.hasMore?w.meta.newestSequence??t:f,w.data.length>0){const ve=Date.now();w.data.forEach(L=>{P.current.set(L.id,ve)});let re=0;g(L=>{const ae=ne(L,w.data);return re=ae.length-L.length,ae}),v.current=w.meta.newestSequence,A(L=>L?{...L,total:L.total+re,newestSequence:w.meta.newestSequence}:w.meta)}}}catch{}finally{D.current=!1}}},[r,n,h]);a.useEffect(()=>(b?T.current=setInterval(B,o):T.current=setInterval(_,o),()=>{T.current&&(clearInterval(T.current),T.current=null)}),[b,o,B,_]),a.useEffect(()=>{const t=setInterval(te,1e3);return()=>clearInterval(t)},[te]);const O=a.useRef(null),we=a.useCallback(t=>{r&&t.type!==r||O.current||(O.current=setTimeout(()=>{O.current=null,b?B():_()},200))},[r,b,B,_]),{connected:ke}=Ie(we);return a.useEffect(()=>()=>{O.current&&(clearTimeout(O.current),O.current=null)},[]),{entries:m,loading:de,refreshing:ue,error:M,meta:k,newEntriesCount:y,hasMore:(k==null?void 0:k.hasMore)??!1,loadMore:fe,loadNew:he,refresh:U,setAutoRefresh:ye,autoRefreshEnabled:b,updateEntry:pe,isHighlighted:be,live:ke}}const J=[{id:"all",label:"Any time",minutes:0},{id:"5m",label:"Last 5 minutes",minutes:5},{id:"15m",label:"Last 15 minutes",minutes:15},{id:"1h",label:"Last hour",minutes:60},{id:"24h",label:"Last 24 hours",minutes:1440}],V=[{id:"any",label:"Any duration",ms:0},{id:"100",label:"Over 100ms",ms:100},{id:"500",label:"Over 500ms",ms:500},{id:"1000",label:"Over 1s",ms:1e3},{id:"5000",label:"Over 5s",ms:5e3}],K="window",z="slower",Pe=s=>J.some(r=>r.id===s),Me=s=>V.some(r=>r.id===s);function We(){var h;const[s,r]=je(),n=s.get(K),i=s.get(z),o=Pe(n)?n:"all",d=Me(i)?i:"any",u=a.useCallback((m,g,S)=>{r($=>{const C=new URLSearchParams($);return S?C.delete(m):C.set(m,g),C},{replace:!0})},[r]),l=a.useCallback(m=>u(K,m,m==="all"),[u]),x=a.useCallback(m=>u(z,m,m==="any"),[u]),j=a.useCallback(()=>{r(m=>{const g=new URLSearchParams(m);return g.delete(K),g.delete(z),g},{replace:!0})},[r]),N=((h=J.find(m=>m.id===o))==null?void 0:h.minutes)??0,R=a.useMemo(()=>{var g;const m=((g=V.find(S=>S.id===d))==null?void 0:g.ms)??0;return m>0?{minDuration:m}:{}},[d]);return{window:o,duration:d,setWindow:l,setDuration:x,windowMinutes:N,rangeFilters:R,hasRange:o!=="all"||d!=="any",clearRanges:j}}const ie="flex items-center gap-1.5 rounded-md px-2 py-1 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer focus-within:ring-2 focus-within:ring-primary-500",le="appearance-none bg-transparent text-xs font-medium text-gray-700 dark:text-gray-200 border-0 p-0 pr-1 rounded-sm focus:outline-hidden focus:ring-2 focus:ring-primary-500 cursor-pointer";function Ge({route:s}){var u;const{window:r,duration:n,setWindow:i,setDuration:o}=We(),d=((u=Ae(s))==null?void 0:u.measuresDuration)??!1;return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:ie,children:[e.jsx(Ce,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Time window"}),e.jsx("select",{"aria-label":"Time window","data-testid":"window-filter",value:r,onChange:l=>i(l.target.value),className:le,children:J.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 shrink-0 opacity-60","aria-hidden":"true"})]}),d&&e.jsxs("label",{className:ie,children:[e.jsx(De,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Minimum duration"}),e.jsx("select",{"aria-label":"Minimum duration","data-testid":"duration-filter",value:n,onChange:l=>o(l.target.value),className:le,children:V.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 shrink-0 opacity-60","aria-hidden":"true"})]})]})}function Ye({count:s,onClick:r,loading:n}){return s===0?null:e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(Ee,{className:"h-4 w-4"}),e.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function Xe({hasMore:s,onClick:r,loading:n}){return s?e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"}),e.jsx("span",{children:"Load older entries"})]}):null}function _e({type:s,label:r,onCleared:n}){const[i,o]=a.useState(!1),[d,u]=a.useState(!1),l=a.useCallback(async()=>{if(!i){o(!0),setTimeout(()=>o(!1),5e3);return}o(!1),u(!0);try{const{message:x}=await Le(s);q.success(x),n()}catch(x){q.error(`Could not clear ${r}: ${x instanceof Error?x.message:String(x)}`)}finally{u(!1)}},[i,s,r,n]);return e.jsxs("button",{onClick:l,disabled:d,"aria-label":i?`Confirm deleting all ${r}`:`Delete all ${r}`,title:i?`Press again to delete all ${r}`:`Delete all ${r}`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${i?"bg-red-600 text-white hover:bg-red-700":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-red-600 dark:hover:text-red-400"}`,children:[e.jsx($e,{className:"h-4 w-4"}),e.jsx("span",{children:i?`Delete all ${r}?`:"Clear"})]})}function Je({title:s,icon:r,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:o,subtitle:d,loading:u,refreshing:l,onRefresh:x,clearable:j,autoRefreshEnabled:N,onAutoRefreshToggle:R,live:h,filters:m=[],onClearAllFilters:g,actions:S,filterControls:$}){const C=a.useRef(null),[E,M]=a.useState(0);a.useLayoutEffect(()=>{const y=C.current;if(!y)return;const p=()=>M(y.getBoundingClientRect().height);if(p(),typeof ResizeObserver>"u")return;const b=new ResizeObserver(p);return b.observe(y),()=>b.disconnect()},[]);const F=m.length>0,k=i??o,A=m.reduce((y,p)=>(y[p.category]||(y[p.category]=[]),y[p.category].push(p),y),{});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:C,className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:e.jsx(r,{className:`h-5 w-5 ${n}`})}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),k!==void 0&&e.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[k.toLocaleString(),o!==void 0&&i!==void 0&&i!==o&&e.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",o.toLocaleString()]})]}),d&&e.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:d})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[S,h&&e.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),e.jsx("span",{children:"Live"})]}),R&&e.jsxs("button",{onClick:()=>R(!N),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${N?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:N?"Auto-refresh enabled":"Auto-refresh disabled",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${N?"bg-green-500 animate-pulse":"bg-gray-400"}`}),e.jsx("span",{children:"Auto Refresh"})]}),j&&e.jsx(_e,{type:j.type,label:j.label,onCleared:j.onCleared}),x&&e.jsx("button",{onClick:x,disabled:!!u||!!l,"aria-busy":l,"aria-label":l?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:e.jsx(X,{className:`h-4 w-4 ${l?"animate-spin":""}`})})]})]}),$&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:$}),F&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:e.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(A).map(([y,p])=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[y,":"]}),p.map((b,H)=>e.jsxs("button",{onClick:b.onRemove,"aria-label":`Remove ${y} filter: ${b.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[e.jsx("span",{children:b.value}),e.jsx(Fe,{className:"h-3 w-3 opacity-60 group-hover:opacity-100 group-focus-visible:opacity-100"})]},`${b.category}-${b.value}-${H}`))]},y)),g&&m.length>1&&e.jsx("button",{onClick:g,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]}),e.jsx("div",{"aria-hidden":"true","data-testid":"page-header-spacer",style:{height:E}})]})}function Ve({tabs:s,activeTab:r,onChange:n}){return e.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>e.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&e.jsx("span",{className:`ml-1.5 text-xs ${r===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function Qe({label:s,enabled:r,onChange:n,icon:i}){return e.jsxs("button",{onClick:()=>n(!r),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&e.jsx(i,{className:"h-4 w-4"}),e.jsx("span",{children:s})]})}export{Ve as F,Xe as L,Ye as N,Je as P,Ge as R,Qe as T,ze as a,We as u};
1
+ import{b as a,f as je}from"./vendor-DBTT3jXp.js";import{t as Se,z as q,p as I,v as Ne,w as Re,j as e,C as Ce,x as G,l as X,f as Ee,y as Le,k as $e,X as Fe}from"./index-DPytPgll.js";import{t as Ae}from"./types-ClDKWGzY.js";import{T as De}from"./timer-CdczUN4V.js";function Oe(){return Se("/stream")}function Ie(s,r=!0){const n=a.useRef(s),[i,o]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!r||typeof EventSource>"u")return;const d=new EventSource(Oe(),{withCredentials:!0}),u=l=>{try{n.current(JSON.parse(l.data))}catch{}};return d.addEventListener("entry",u),d.onopen=()=>o(!0),d.onerror=()=>o(!1),()=>{d.removeEventListener("entry",u),d.close(),o(!1)}},[r]),{connected:i}}function Y(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(Y).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${Y(s[n])}`).join(",")+"}"}const se=500;function ne(s,r){if(r.length===0)return s;const n=new Set(s.map(d=>d.id)),i=r.filter(d=>!n.has(d.id));if(i.length===0)return s;const o=[...i,...s];return o.length>se?o.slice(0,se):o}const ce="nestlens-auto-refresh";function qe(){try{const s=localStorage.getItem(ce);return s===null?!0:s==="true"}catch{return!0}}function Te(s){try{localStorage.setItem(ce,String(s))}catch{}}function ze(s={}){const{type:r,limit:n=50,autoRefresh:i,autoRefreshInterval:o=5e3,filters:d,windowMinutes:u}=s,l=Y(d),x=`${r}|${n}|${l}|${u??0}`,[j,N]=a.useState({key:l,value:d});j.key!==l&&N({key:l,value:d});const R=j.value,h=a.useCallback(()=>!u||u<=0?R:{...R,from:new Date(Date.now()-u*6e4).toISOString()},[R,u]),[m,g]=a.useState([]),[S,$]=a.useState(null),[C,E]=a.useState(!1),[M,F]=a.useState(null),[k,A]=a.useState(null),[y,p]=a.useState(0),[b,H]=a.useState(i??qe()),v=a.useRef(null),T=a.useRef(null),D=a.useRef(!1),W=a.useRef(null),oe=a.useRef(!0),de=S===null&&M===null,ue=C||S!==null&&S!==x,me=a.useRef(l),P=a.useRef(new Map),[,ge]=a.useState(0),Q=1e4,Z=a.useCallback(t=>{g(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0),F(null),oe.current=!1,me.current=l,$(x)},[l,x]),ee=a.useCallback(t=>{const c=t instanceof Error?t:new Error("Failed to fetch entries");F(c),console.error("Failed to fetch entries:",t),q.error("Failed to load entries"),$(x)},[x]),fe=a.useCallback(async()=>{if(!(!(k!=null&&k.oldestSequence)||!k.hasMore)){E(!0);try{const t=await I({type:r,limit:n,beforeSequence:k.oldestSequence,filters:h()});g(c=>{const f=new Set(c.map(w=>w.id));return[...c,...t.data.filter(w=>!f.has(w.id))]}),A(t.meta)}catch(t){console.error("Failed to load more entries:",t),q.error("Failed to load more entries")}finally{E(!1)}}},[r,n,k,h]),he=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0,E(!0);try{const t=await I({type:r,limit:y||n,afterSequence:v.current,filters:h()});if(t.data.length>0){const c=Date.now();t.data.forEach(f=>{P.current.set(f.id,c)}),g(f=>ne(f,t.data)),v.current=t.meta.newestSequence,p(0)}}catch(t){console.error("Failed to load new entries:",t),q.error("Failed to load new entries")}finally{D.current=!1,E(!1)}}},[r,n,y,h]),U=a.useCallback(async()=>{E(!0);try{F(null);const t=await I({type:r,limit:n,filters:h()});g(t.data),A(t.meta),v.current=t.meta.newestSequence,W.current=t.meta.newestSequence,p(0)}catch(t){const c=t instanceof Error?t:new Error("Failed to refresh entries");F(c),console.error("Failed to refresh entries:",t),q.error("Failed to refresh entries")}finally{E(!1)}},[r,n,h]),xe=t=>!!(t&&Object.values(t).some(c=>Array.isArray(c)?c.length>0:c!==void 0&&c!=="")),_=a.useCallback(async()=>{if(!v.current){await U();return}const t=h();try{if(!xe(t)){const f=await Ne(v.current,r);p(f.data.count);return}const c=await I({type:r,limit:n,afterSequence:v.current,filters:t});p(c.data.length)}catch{}},[r,n,h,U]),ye=a.useCallback(t=>{H(t),Te(t)},[]),pe=a.useCallback(t=>{g(c=>c.map(f=>f.id===t.id?t:f))},[]);a.useEffect(()=>{let t=!0;return I({type:r,limit:n,filters:h()}).then(c=>{t&&Z(c)},c=>{t&&ee(c)}),()=>{t=!1}},[r,n,h,Z,ee]);const be=a.useCallback(t=>{const c=P.current.get(t);return c?Date.now()-c<Q:!1},[]),te=a.useCallback(()=>{const t=Date.now();let c=!1;P.current.forEach((f,w)=>{t-f>=Q&&(P.current.delete(w),c=!0)}),c&&ge(f=>f+1)},[]),B=a.useCallback(async()=>{if(v.current&&!D.current){D.current=!0;try{const t=W.current??v.current,f=(await Re(r)).data;if(typeof f=="number"&&f>t){const w=await I({type:r,limit:n,afterSequence:t,filters:h()});if(W.current=w.meta.hasMore?w.meta.newestSequence??t:f,w.data.length>0){const ve=Date.now();w.data.forEach(L=>{P.current.set(L.id,ve)});let re=0;g(L=>{const ae=ne(L,w.data);return re=ae.length-L.length,ae}),v.current=w.meta.newestSequence,A(L=>L?{...L,total:L.total+re,newestSequence:w.meta.newestSequence}:w.meta)}}}catch{}finally{D.current=!1}}},[r,n,h]);a.useEffect(()=>(b?T.current=setInterval(B,o):T.current=setInterval(_,o),()=>{T.current&&(clearInterval(T.current),T.current=null)}),[b,o,B,_]),a.useEffect(()=>{const t=setInterval(te,1e3);return()=>clearInterval(t)},[te]);const O=a.useRef(null),we=a.useCallback(t=>{r&&t.type!==r||O.current||(O.current=setTimeout(()=>{O.current=null,b?B():_()},200))},[r,b,B,_]),{connected:ke}=Ie(we);return a.useEffect(()=>()=>{O.current&&(clearTimeout(O.current),O.current=null)},[]),{entries:m,loading:de,refreshing:ue,error:M,meta:k,newEntriesCount:y,hasMore:(k==null?void 0:k.hasMore)??!1,loadMore:fe,loadNew:he,refresh:U,setAutoRefresh:ye,autoRefreshEnabled:b,updateEntry:pe,isHighlighted:be,live:ke}}const J=[{id:"all",label:"Any time",minutes:0},{id:"5m",label:"Last 5 minutes",minutes:5},{id:"15m",label:"Last 15 minutes",minutes:15},{id:"1h",label:"Last hour",minutes:60},{id:"24h",label:"Last 24 hours",minutes:1440}],V=[{id:"any",label:"Any duration",ms:0},{id:"100",label:"Over 100ms",ms:100},{id:"500",label:"Over 500ms",ms:500},{id:"1000",label:"Over 1s",ms:1e3},{id:"5000",label:"Over 5s",ms:5e3}],K="window",z="slower",Pe=s=>J.some(r=>r.id===s),Me=s=>V.some(r=>r.id===s);function We(){var h;const[s,r]=je(),n=s.get(K),i=s.get(z),o=Pe(n)?n:"all",d=Me(i)?i:"any",u=a.useCallback((m,g,S)=>{r($=>{const C=new URLSearchParams($);return S?C.delete(m):C.set(m,g),C},{replace:!0})},[r]),l=a.useCallback(m=>u(K,m,m==="all"),[u]),x=a.useCallback(m=>u(z,m,m==="any"),[u]),j=a.useCallback(()=>{r(m=>{const g=new URLSearchParams(m);return g.delete(K),g.delete(z),g},{replace:!0})},[r]),N=((h=J.find(m=>m.id===o))==null?void 0:h.minutes)??0,R=a.useMemo(()=>{var g;const m=((g=V.find(S=>S.id===d))==null?void 0:g.ms)??0;return m>0?{minDuration:m}:{}},[d]);return{window:o,duration:d,setWindow:l,setDuration:x,windowMinutes:N,rangeFilters:R,hasRange:o!=="all"||d!=="any",clearRanges:j}}const ie="flex items-center gap-1.5 rounded-md px-2 py-1 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer focus-within:ring-2 focus-within:ring-primary-500",le="appearance-none bg-transparent text-xs font-medium text-gray-700 dark:text-gray-200 border-0 p-0 pr-1 rounded-sm focus:outline-hidden focus:ring-2 focus:ring-primary-500 cursor-pointer";function Ge({route:s}){var u;const{window:r,duration:n,setWindow:i,setDuration:o}=We(),d=((u=Ae(s))==null?void 0:u.measuresDuration)??!1;return e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:ie,children:[e.jsx(Ce,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Time window"}),e.jsx("select",{"aria-label":"Time window","data-testid":"window-filter",value:r,onChange:l=>i(l.target.value),className:le,children:J.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 shrink-0 opacity-60","aria-hidden":"true"})]}),d&&e.jsxs("label",{className:ie,children:[e.jsx(De,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Minimum duration"}),e.jsx("select",{"aria-label":"Minimum duration","data-testid":"duration-filter",value:n,onChange:l=>o(l.target.value),className:le,children:V.map(l=>e.jsx("option",{value:l.id,children:l.label},l.id))}),e.jsx(G,{className:"h-3 w-3 shrink-0 opacity-60","aria-hidden":"true"})]})]})}function Ye({count:s,onClick:r,loading:n}){return s===0?null:e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(Ee,{className:"h-4 w-4"}),e.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function Xe({hasMore:s,onClick:r,loading:n}){return s?e.jsxs("button",{onClick:r,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?e.jsx(X,{className:"h-4 w-4 animate-spin"}):e.jsx(G,{className:"h-4 w-4"}),e.jsx("span",{children:"Load older entries"})]}):null}function _e({type:s,label:r,onCleared:n}){const[i,o]=a.useState(!1),[d,u]=a.useState(!1),l=a.useCallback(async()=>{if(!i){o(!0),setTimeout(()=>o(!1),5e3);return}o(!1),u(!0);try{const{message:x}=await Le(s);q.success(x),n()}catch(x){q.error(`Could not clear ${r}: ${x instanceof Error?x.message:String(x)}`)}finally{u(!1)}},[i,s,r,n]);return e.jsxs("button",{onClick:l,disabled:d,"aria-label":i?`Confirm deleting all ${r}`:`Delete all ${r}`,title:i?`Press again to delete all ${r}`:`Delete all ${r}`,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed ${i?"bg-red-600 text-white hover:bg-red-700":"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-red-600 dark:hover:text-red-400"}`,children:[e.jsx($e,{className:"h-4 w-4"}),e.jsx("span",{children:i?`Delete all ${r}?`:"Clear"})]})}function Je({title:s,icon:r,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:o,subtitle:d,loading:u,refreshing:l,onRefresh:x,clearable:j,autoRefreshEnabled:N,onAutoRefreshToggle:R,live:h,filters:m=[],onClearAllFilters:g,actions:S,filterControls:$}){const C=a.useRef(null),[E,M]=a.useState(0);a.useLayoutEffect(()=>{const y=C.current;if(!y)return;const p=()=>M(y.getBoundingClientRect().height);if(p(),typeof ResizeObserver>"u")return;const b=new ResizeObserver(p);return b.observe(y),()=>b.disconnect()},[]);const F=m.length>0,k=i??o,A=m.reduce((y,p)=>(y[p.category]||(y[p.category]=[]),y[p.category].push(p),y),{});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:C,className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:e.jsx(r,{className:`h-5 w-5 ${n}`})}),e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),k!==void 0&&e.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[k.toLocaleString(),o!==void 0&&i!==void 0&&i!==o&&e.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",o.toLocaleString()]})]}),d&&e.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:d})]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[S,h&&e.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),e.jsx("span",{children:"Live"})]}),R&&e.jsxs("button",{onClick:()=>R(!N),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${N?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:N?"Auto-refresh enabled":"Auto-refresh disabled",children:[e.jsx("span",{className:`w-2 h-2 rounded-full shrink-0 ${N?"bg-green-500 animate-pulse":"bg-gray-400"}`}),e.jsx("span",{children:"Auto Refresh"})]}),j&&e.jsx(_e,{type:j.type,label:j.label,onCleared:j.onCleared}),x&&e.jsx("button",{onClick:x,disabled:!!u||!!l,"aria-busy":l,"aria-label":l?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:e.jsx(X,{className:`h-4 w-4 ${l?"animate-spin":""}`})})]})]}),$&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:$}),F&&e.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:e.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(A).map(([y,p])=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[y,":"]}),p.map((b,H)=>e.jsxs("button",{onClick:b.onRemove,"aria-label":`Remove ${y} filter: ${b.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[e.jsx("span",{children:b.value}),e.jsx(Fe,{className:"h-3 w-3 opacity-60 group-hover:opacity-100 group-focus-visible:opacity-100"})]},`${b.category}-${b.value}-${H}`))]},y)),g&&m.length>1&&e.jsx("button",{onClick:g,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]}),e.jsx("div",{"aria-hidden":"true","data-testid":"page-header-spacer",style:{height:E}})]})}function Ve({tabs:s,activeTab:r,onChange:n}){return e.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>e.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&e.jsx("span",{className:`ml-1.5 text-xs ${r===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function Qe({label:s,enabled:r,onChange:n,icon:i}){return e.jsxs("button",{onClick:()=>n(!r),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${r?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&e.jsx(i,{className:"h-4 w-4"}),e.jsx("span",{children:s})]})}export{Ve as F,Xe as L,Ye as N,Je as P,Ge as R,Qe as T,ze as a,We as u};
@@ -1 +1 @@
1
- import{j as r,D as d}from"./index-BaD1MX7a.js";import{e as P,b as u}from"./vendor-DBTT3jXp.js";import{f as Q,p as B}from"./date-Dwgqy666.js";import{u as O,a as W,P as H,T as I,R as Z,N as $,L as z}from"./PageHeader-Tnp0JBDF.js";import{u as G,a as J,C as K}from"./types-BHYinjn2.js";import{E as U}from"./EntrySearchInput-Iv-9Wirn.js";import{T as c,D as V,a as X,b as Y}from"./DataTable-CIlMLJo4.js";import{Z as h}from"./zap-Cx84VGgd.js";import"./timer-D72f3hG4.js";import"./search-BtkJjUPF.js";function de(){const p=P(),[i,m]=u.useState(!1),{addFilter:l,clearAll:g,serverFilters:x,headerFilters:y}=G("queries"),{rangeFilters:f,windowMinutes:w}=O(),j={...x,slow:i?!0:void 0},{entries:b,loading:C,refreshing:s,error:k,refresh:n,newEntriesCount:T,hasMore:N,loadMore:q,loadNew:v,autoRefreshEnabled:E,live:S,setAutoRefresh:F,meta:a,isHighlighted:R}=W({type:"query",limit:50,filters:{...j,...f},windowMinutes:w}),t=b.filter(e=>J(e)),D=u.useMemo(()=>[{key:"source",header:"Source",width:"120px",render:e=>r.jsx(K,{listType:"queries",filterType:"sources",children:e.payload.source||"unknown"})},{key:"query",header:"Query",minWidth:"300px",render:e=>r.jsxs("div",{className:"flex items-start space-x-2",children:[e.payload.slow&&r.jsx(h,{className:"h-4 w-4 text-yellow-500 shrink-0 mt-0.5"}),r.jsx(c,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.query.length>100?e.payload.query.substring(0,100)+"...":e.payload.query})]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>r.jsx(V,{ms:e.payload.duration||0,slowThreshold:e.payload.slow?0:1e3})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const L=(e.payload.source||"unknown").toLowerCase(),M=(e.tags??[]).filter(o=>o.toLowerCase()!==L);return r.jsx(X,{tags:M,max:3,onTagClick:(o,A)=>{A.stopPropagation(),l("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>r.jsx(c,{secondary:!0,className:"text-xs",children:Q(B(e.createdAt),{addSuffix:!0})})}],[l]);return C&&t.length===0?r.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):r.jsxs("div",{children:[r.jsx(H,{title:"Queries",icon:d,iconColor:"text-purple-600 dark:text-purple-400",count:t.length,totalCount:a==null?void 0:a.total,clearable:{type:"query",label:"queries",onCleared:n},refreshing:s,autoRefreshEnabled:E,live:S,onAutoRefreshToggle:F,filters:y,filterControls:r.jsx(Z,{route:"queries"}),onClearAllFilters:g,actions:r.jsx(I,{label:"Slow Only",enabled:i,onChange:m,icon:h})}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(U,{placeholder:"Search by SQL, table, source, tag, or content..."}),r.jsx($,{count:T,onClick:v,loading:s}),r.jsx(Y,{columns:D,data:t,keyExtractor:e=>e.id,onRowClick:e=>p(`/queries/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No queries recorded yet",error:k,onRetry:n,emptyIcon:r.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),r.jsx(z,{hasMore:N,onClick:q,loading:s})]})]})}export{de as default};
1
+ import{j as r,D as d}from"./index-DPytPgll.js";import{e as P,b as u}from"./vendor-DBTT3jXp.js";import{f as Q,p as B}from"./date-Dwgqy666.js";import{u as O,a as W,P as H,T as I,R as Z,N as $,L as z}from"./PageHeader-D3jf36Yh.js";import{u as G,a as J,C as K}from"./types-ClDKWGzY.js";import{E as U}from"./EntrySearchInput-DsNY9wzV.js";import{T as c,D as V,a as X,b as Y}from"./DataTable-CdvrtwLu.js";import{Z as h}from"./zap-r_dKURpN.js";import"./timer-CdczUN4V.js";import"./search-DAygxhiQ.js";function de(){const p=P(),[i,m]=u.useState(!1),{addFilter:l,clearAll:g,serverFilters:x,headerFilters:y}=G("queries"),{rangeFilters:f,windowMinutes:w}=O(),j={...x,slow:i?!0:void 0},{entries:b,loading:C,refreshing:s,error:k,refresh:n,newEntriesCount:T,hasMore:N,loadMore:q,loadNew:v,autoRefreshEnabled:E,live:S,setAutoRefresh:F,meta:a,isHighlighted:R}=W({type:"query",limit:50,filters:{...j,...f},windowMinutes:w}),t=b.filter(e=>J(e)),D=u.useMemo(()=>[{key:"source",header:"Source",width:"120px",render:e=>r.jsx(K,{listType:"queries",filterType:"sources",children:e.payload.source||"unknown"})},{key:"query",header:"Query",minWidth:"300px",render:e=>r.jsxs("div",{className:"flex items-start space-x-2",children:[e.payload.slow&&r.jsx(h,{className:"h-4 w-4 text-yellow-500 shrink-0 mt-0.5"}),r.jsx(c,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.query.length>100?e.payload.query.substring(0,100)+"...":e.payload.query})]})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>r.jsx(V,{ms:e.payload.duration||0,slowThreshold:e.payload.slow?0:1e3})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const L=(e.payload.source||"unknown").toLowerCase(),M=(e.tags??[]).filter(o=>o.toLowerCase()!==L);return r.jsx(X,{tags:M,max:3,onTagClick:(o,A)=>{A.stopPropagation(),l("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>r.jsx(c,{secondary:!0,className:"text-xs",children:Q(B(e.createdAt),{addSuffix:!0})})}],[l]);return C&&t.length===0?r.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):r.jsxs("div",{children:[r.jsx(H,{title:"Queries",icon:d,iconColor:"text-purple-600 dark:text-purple-400",count:t.length,totalCount:a==null?void 0:a.total,clearable:{type:"query",label:"queries",onCleared:n},refreshing:s,autoRefreshEnabled:E,live:S,onAutoRefreshToggle:F,filters:y,filterControls:r.jsx(Z,{route:"queries"}),onClearAllFilters:g,actions:r.jsx(I,{label:"Slow Only",enabled:i,onChange:m,icon:h})}),r.jsxs("div",{className:"space-y-4",children:[r.jsx(U,{placeholder:"Search by SQL, table, source, tag, or content..."}),r.jsx($,{count:T,onClick:v,loading:s}),r.jsx(Y,{columns:D,data:t,keyExtractor:e=>e.id,onRowClick:e=>p(`/queries/${e.id}`),rowClassName:e=>R(e.id)?"highlight-new":"",emptyMessage:"No queries recorded yet",error:k,onRetry:n,emptyIcon:r.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),r.jsx(z,{hasMore:N,onClick:q,loading:s})]})]})}export{de as default};
@@ -1,4 +1,4 @@
1
- import{c as RT,j as r,z as UE}from"./index-BaD1MX7a.js";import{p as oE,f as PT}from"./date-Dwgqy666.js";import{D as K,f as nT}from"./DetailRow-BC_kcJT3.js";import{C as GE}from"./types-BHYinjn2.js";import{g as iT,b as g}from"./vendor-DBTT3jXp.js";import{a as MT,b as UT}from"./EntryDetailPage-DUWwJ_hP.js";import"./search-BtkJjUPF.js";/**
1
+ import{c as RT,j as r,z as UE}from"./index-DPytPgll.js";import{p as oE,f as PT}from"./date-Dwgqy666.js";import{D as K,f as nT}from"./DetailRow-CxyUq52b.js";import{C as GE}from"./types-ClDKWGzY.js";import{g as iT,b as g}from"./vendor-DBTT3jXp.js";import{a as MT,b as UT}from"./EntryDetailPage-D0maRTjK.js";import"./search-DAygxhiQ.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e,D as u,b as f,C as y}from"./index-BaD1MX7a.js";import{b as N}from"./vendor-DBTT3jXp.js";import{p as o,f as v}from"./date-Dwgqy666.js";import{D as a,f as k}from"./DetailRow-BC_kcJT3.js";import{C as n}from"./types-BHYinjn2.js";import{u as x,C as m,T as C}from"./EntryDetailPage-DUWwJ_hP.js";import{C as w}from"./CopyButton-DaF0vYeo.js";import{C as T}from"./circle-check-big-DZttXeD-.js";import{C as g}from"./circle-x-CioeSSBA.js";import"./search-BtkJjUPF.js";function H({entry:h}){const{payload:s,createdAt:i}=h,d=x(),l=x(),[c,p]=N.useState("args"),r=s.status==="success"?{icon:T,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},b=r.icon,t=[];s.args&&s.args.length>0&&t.push({id:"args",label:"Arguments",content:e.jsx(m,{data:s.args,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),s.result!==void 0&&t.push({id:"result",label:"Result",content:e.jsx(m,{data:s.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})});const j=()=>{if(c==="args"&&s.args&&s.args.length>0)return e.jsx(d.Toolbar,{data:s.args});if(c==="result"&&s.result!==void 0)return e.jsx(l.Toolbar,{data:s.result})};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.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 ${r.bg} rounded-lg`,children:e.jsx(u,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.command}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Redis Command"})]})]}),e.jsx(w,{text:s.command,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 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(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:s.command})]}),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(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:s.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(y,{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:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),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:"*:not-first:border-y-0",children:[e.jsx(a,{label:"Time",value:e.jsxs("span",{children:[k(o(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(o(i),{addSuffix:!0}),")"]})]})}),e.jsx(a,{label:"Command",value:e.jsx(n,{listType:"redis",filterType:"commands",filterValue:s.command,children:s.command})}),s.keyPattern&&e.jsx(a,{label:"Key Pattern",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.keyPattern})}),e.jsx(a,{label:"Status",value:e.jsx(n,{listType:"redis",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(a,{label:"Duration",value:`${s.duration}ms`})]})})]}),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(g,{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})})]}),t.length>0&&e.jsx(C,{tabs:t,defaultTab:"args",hashKey:"redis",headerRight:j(),onTabChange:p})]})}export{H as default};
1
+ import{j as e,D as u,b as f,C as y}from"./index-DPytPgll.js";import{b as N}from"./vendor-DBTT3jXp.js";import{p as o,f as v}from"./date-Dwgqy666.js";import{D as a,f as k}from"./DetailRow-CxyUq52b.js";import{C as n}from"./types-ClDKWGzY.js";import{u as x,C as m,T as C}from"./EntryDetailPage-D0maRTjK.js";import{C as w}from"./CopyButton-DZpH1CB7.js";import{C as T}from"./circle-check-big-BJmx6lMP.js";import{C as g}from"./circle-x-BgJQ7XT5.js";import"./search-DAygxhiQ.js";function H({entry:h}){const{payload:s,createdAt:i}=h,d=x(),l=x(),[c,p]=N.useState("args"),r=s.status==="success"?{icon:T,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},b=r.icon,t=[];s.args&&s.args.length>0&&t.push({id:"args",label:"Arguments",content:e.jsx(m,{data:s.args,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),s.result!==void 0&&t.push({id:"result",label:"Result",content:e.jsx(m,{data:s.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})});const j=()=>{if(c==="args"&&s.args&&s.args.length>0)return e.jsx(d.Toolbar,{data:s.args});if(c==="result"&&s.result!==void 0)return e.jsx(l.Toolbar,{data:s.result})};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.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 ${r.bg} rounded-lg`,children:e.jsx(u,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.command}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Redis Command"})]})]}),e.jsx(w,{text:s.command,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 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(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:s.command})]}),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(b,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:s.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(y,{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:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),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:"*:not-first:border-y-0",children:[e.jsx(a,{label:"Time",value:e.jsxs("span",{children:[k(o(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(o(i),{addSuffix:!0}),")"]})]})}),e.jsx(a,{label:"Command",value:e.jsx(n,{listType:"redis",filterType:"commands",filterValue:s.command,children:s.command})}),s.keyPattern&&e.jsx(a,{label:"Key Pattern",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.keyPattern})}),e.jsx(a,{label:"Status",value:e.jsx(n,{listType:"redis",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(a,{label:"Duration",value:`${s.duration}ms`})]})})]}),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(g,{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})})]}),t.length>0&&e.jsx(C,{tabs:t,defaultTab:"args",hashKey:"redis",headerRight:j(),onTabChange:p})]})}export{H as default};
@@ -1 +1 @@
1
- import{j as a,D as l}from"./index-BaD1MX7a.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{f as M,p as T}from"./date-Dwgqy666.js";import{u as A,a as B,P as L,R as H,N as S,L as W}from"./PageHeader-Tnp0JBDF.js";import{u as I,k as K,C as c}from"./types-BHYinjn2.js";import{T as n,D as U,b as $}from"./DataTable-CIlMLJo4.js";import"./timer-D72f3hG4.js";function X(){const m=D(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("redis"),{rangeFilters:x,windowMinutes:g}=A(),{entries:y,loading:f,refreshing:r,error:j,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:R,setAutoRefresh:E,meta:s,isHighlighted:P}=B({type:"redis",limit:50,filters:{...h,...x},windowMinutes:g}),o=y.filter(e=>K(e)),v=F.useMemo(()=>[{key:"command",header:"Command",width:"120px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("commands",e.payload.command)},className:"font-mono",children:e.payload.command})},{key:"keyPattern",header:"Key Pattern",minWidth:"200px",render:e=>e.payload.keyPattern?a.jsx(n,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.keyPattern}):a.jsx(n,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(U,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(n,{secondary:!0,className:"text-xs",children:M(T(e.createdAt),{addSuffix:!0})})}],[t]);return f&&o.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(L,{title:"Redis",icon:l,iconColor:"text-red-600 dark:text-red-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"redis",label:"redis",onCleared:d},refreshing:r,autoRefreshEnabled:N,live:R,onAutoRefreshToggle:E,filters:p,filterControls:a.jsx(H,{route:"redis"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(S,{count:C,onClick:b,loading:r}),a.jsx($,{columns:v,data:o,keyExtractor:e=>e.id,onRowClick:e=>m(`/redis/${e.id}`),rowClassName:e=>P(e.id)?"highlight-new":"",emptyMessage:"No Redis commands recorded yet",error:j,onRetry:d,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(W,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
1
+ import{j as a,D as l}from"./index-DPytPgll.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{f as M,p as T}from"./date-Dwgqy666.js";import{u as A,a as B,P as L,R as H,N as S,L as W}from"./PageHeader-D3jf36Yh.js";import{u as I,k as K,C as c}from"./types-ClDKWGzY.js";import{T as n,D as U,b as $}from"./DataTable-CdvrtwLu.js";import"./timer-CdczUN4V.js";function X(){const m=D(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("redis"),{rangeFilters:x,windowMinutes:g}=A(),{entries:y,loading:f,refreshing:r,error:j,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:R,setAutoRefresh:E,meta:s,isHighlighted:P}=B({type:"redis",limit:50,filters:{...h,...x},windowMinutes:g}),o=y.filter(e=>K(e)),v=F.useMemo(()=>[{key:"command",header:"Command",width:"120px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("commands",e.payload.command)},className:"font-mono",children:e.payload.command})},{key:"keyPattern",header:"Key Pattern",minWidth:"200px",render:e=>e.payload.keyPattern?a.jsx(n,{mono:!0,truncate:!0,maxWidth:"300px",children:e.payload.keyPattern}):a.jsx(n,{secondary:!0,children:"-"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(U,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(c,{onClick:i=>{i.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(n,{secondary:!0,className:"text-xs",children:M(T(e.createdAt),{addSuffix:!0})})}],[t]);return f&&o.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(L,{title:"Redis",icon:l,iconColor:"text-red-600 dark:text-red-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"redis",label:"redis",onCleared:d},refreshing:r,autoRefreshEnabled:N,live:R,onAutoRefreshToggle:E,filters:p,filterControls:a.jsx(H,{route:"redis"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(S,{count:C,onClick:b,loading:r}),a.jsx($,{columns:v,data:o,keyExtractor:e=>e.id,onRowClick:e=>m(`/redis/${e.id}`),rowClassName:e=>P(e.id)?"highlight-new":"",emptyMessage:"No Redis commands recorded yet",error:j,onRetry:d,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(W,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
@@ -1 +1 @@
1
- import{j as e,i as f}from"./index-BaD1MX7a.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-BC_kcJT3.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-BHYinjn2.js";import{u as M,T as S,C as v}from"./EntryDetailPage-DUWwJ_hP.js";import{U as I}from"./UserCard-B4mNJVOd.js";import"./search-BtkJjUPF.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]),[i,l]=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:()=>l(a.id),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${i===a.id?"bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow-xs":"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-sm ${i===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:[i==="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 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))})]}),i==="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 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))}),i==="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 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))}),i==="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 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))}),i==="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 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))}),i==="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 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))}),i==="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 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,i=(P.map(l=>s[l]).find(l=>typeof l=="string"&&l.trim().length>0)??r.type).replace(/\s+/g," ").trim();return i.length>70?`${i.slice(0,70)}…`:i};function z({request:r,related:s}){const{spans:t,window:i}=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 ",$(i)]})]}),e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:t.map(l=>{const g=Math.min(Math.max(l.duration/i*100,.75),100),a=Math.min(l.offset/i*100,100-g),d=K[l.entry.type]??"bg-gray-400";return e.jsxs(p,{to:`/entries/${l.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:l.entry.type}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-mono text-gray-700 dark:text-gray-300 truncate",title:l.label,children:l.label}),e.jsx("span",{className:"relative w-1/2 shrink-0 h-4 rounded-sm bg-gray-100 dark:bg-gray-800",children:e.jsx("span",{className:`absolute top-0 h-full rounded-sm ${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:l.duration>0?$(l.duration):""})]},`${l.entry.type}-${l.entry.id}`)})})]})}function G(r){if(r===0)return"0 B";const s=1024,t=["B","KB","MB","GB"],i=Math.floor(Math.log(r)/Math.log(s));return`${parseFloat((r/Math.pow(s,i)).toFixed(1))} ${t[i]}`}function _(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}function W(r,s){if(s){const t=Object.keys(s).find(i=>i.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 le({entry:r,related:s=[]}){const{payload:t,createdAt:i}=r,l=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:"*:not-first:border-y-0",children:[e.jsx(y,{label:"Time",value:e.jsxs("span",{children:[R(k(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",q(k(i),{addSuffix:!0}),")"]})]})}),e.jsx(y,{label:"Hostname",value:l!=="-"?e.jsx(x,{listType:"requests",filterType:"hostnames",filterValue:l,className:"font-mono",children:l}):"-"}),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{le as default};
1
+ import{j as e,i as f}from"./index-DPytPgll.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-CxyUq52b.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-ClDKWGzY.js";import{u as M,T as S,C as v}from"./EntryDetailPage-D0maRTjK.js";import{U as I}from"./UserCard-8jIvwXOn.js";import"./search-DAygxhiQ.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]),[i,l]=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:()=>l(a.id),className:`px-3 py-1.5 text-sm font-medium rounded-md transition-colors flex items-center gap-2 ${i===a.id?"bg-white dark:bg-gray-900 text-gray-900 dark:text-white shadow-xs":"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-sm ${i===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:[i==="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 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))})]}),i==="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 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))}),i==="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 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))}),i==="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 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))}),i==="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 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))}),i==="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 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))}),i==="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 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,i=(P.map(l=>s[l]).find(l=>typeof l=="string"&&l.trim().length>0)??r.type).replace(/\s+/g," ").trim();return i.length>70?`${i.slice(0,70)}…`:i};function z({request:r,related:s}){const{spans:t,window:i}=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 ",$(i)]})]}),e.jsx("div",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:t.map(l=>{const g=Math.min(Math.max(l.duration/i*100,.75),100),a=Math.min(l.offset/i*100,100-g),d=K[l.entry.type]??"bg-gray-400";return e.jsxs(p,{to:`/entries/${l.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:l.entry.type}),e.jsx("span",{className:"flex-1 min-w-0 text-sm font-mono text-gray-700 dark:text-gray-300 truncate",title:l.label,children:l.label}),e.jsx("span",{className:"relative w-1/2 shrink-0 h-4 rounded-sm bg-gray-100 dark:bg-gray-800",children:e.jsx("span",{className:`absolute top-0 h-full rounded-sm ${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:l.duration>0?$(l.duration):""})]},`${l.entry.type}-${l.entry.id}`)})})]})}function G(r){if(r===0)return"0 B";const s=1024,t=["B","KB","MB","GB"],i=Math.floor(Math.log(r)/Math.log(s));return`${parseFloat((r/Math.pow(s,i)).toFixed(1))} ${t[i]}`}function _(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}function W(r,s){if(s){const t=Object.keys(s).find(i=>i.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 le({entry:r,related:s=[]}){const{payload:t,createdAt:i}=r,l=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:"*:not-first:border-y-0",children:[e.jsx(y,{label:"Time",value:e.jsxs("span",{children:[R(k(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",q(k(i),{addSuffix:!0}),")"]})]})}),e.jsx(y,{label:"Hostname",value:l!=="-"?e.jsx(x,{listType:"requests",filterType:"hostnames",filterValue:l,className:"font-mono",children:l}):"-"}),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{le as default};