nestlens 0.17.0 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/dashboard/public/assets/{BatchDetailView-BtqVdobP.js → BatchDetailView-MwxKpCBw.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-Bf9lrBmD.js → BatchesPage-vFo0vIr2.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-OIzXBHoa.js → CacheDetailView-CcGupoLQ.js} +1 -1
- package/dist/dashboard/public/assets/{CachePage-BkcnMR-M.js → CachePage-CU847w5_.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-CWi9A25p.js → CommandDetailView-CVZrIKo6.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-BY0PP3s3.js → CommandsPage-BbiQyAea.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-CrKlNGl8.js → CopyButton-DpZHVixQ.js} +1 -1
- package/dist/dashboard/public/assets/{DashboardPage-BvMG0MnS.js → DashboardPage-Ck0F9Z12.js} +1 -1
- package/dist/dashboard/public/assets/{DataTable-BqULsda4.js → DataTable-CCXj8zzB.js} +1 -1
- package/dist/dashboard/public/assets/{DetailRow-B2fCGvfq.js → DetailRow-C35E-Fg7.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-BeNqtvaw.js → DumpDetailView-C3AszicE.js} +1 -1
- package/dist/dashboard/public/assets/{DumpsPage-99LRTJbq.js → DumpsPage-nKkfeRGr.js} +1 -1
- package/dist/dashboard/public/assets/{EntryDetailPage-CwdNk12N.js → EntryDetailPage-C63KztnI.js} +3 -3
- package/dist/dashboard/public/assets/{EntrySearchInput-CvLKMnhr.js → EntrySearchInput-BNjSxfmZ.js} +1 -1
- package/dist/dashboard/public/assets/{EventDetailView-DMp6_lrH.js → EventDetailView-i_T5zzxK.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage-BpPYK8yv.js → EventsPage--LGwQSIW.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-CxSYyRmG.js → ExceptionDetailView-BD375JkM.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionsPage-CiziAm9b.js → ExceptionsPage-DJRQKir2.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-CJiPkG4t.js → GateDetailView-DjS0BcxS.js} +1 -1
- package/dist/dashboard/public/assets/{GatesPage-QoTsDoC0.js → GatesPage-CP3_e7g1.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLDetailView-7qVpFgqW.js → GraphQLDetailView-BubeJCJT.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLPage-DWrVF7vh.js → GraphQLPage-BCr6tRBy.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientDetailView-BWC9wJ5q.js → HttpClientDetailView-yb-3URIg.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientPage-C11SEV-2.js → HttpClientPage-opI4zxU2.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-D2W4qgDK.js → JobDetailView-4qAPrQWH.js} +1 -1
- package/dist/dashboard/public/assets/{JobsPage-CS-tIrOt.js → JobsPage-BuCIb8wu.js} +1 -1
- package/dist/dashboard/public/assets/{LogDetailView--zV_XqOF.js → LogDetailView--AEX1d6S.js} +1 -1
- package/dist/dashboard/public/assets/{LogsPage-EbR5l-NM.js → LogsPage-BYUqINeg.js} +1 -1
- package/dist/dashboard/public/assets/{MailDetailView-BMHWHwco.js → MailDetailView-BPFRJcUh.js} +1 -1
- package/dist/dashboard/public/assets/{MailPage-BEkKMb9k.js → MailPage-n712tj0J.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-dOsZS8GV.js → ModelDetailView-BDzUh_Kg.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-BjFVL3Gx.js → ModelsPage-BgXuFcOx.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-CEuURlgO.js → NotificationDetailView-D-wwNBBg.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-Dlw7HM8W.js → NotificationsPage-eznKkQYP.js} +1 -1
- package/dist/dashboard/public/assets/{PageHeader-BOb_n_ci.js → PageHeader-Dhs9cPza.js} +1 -1
- package/dist/dashboard/public/assets/{QueriesPage-BiFenFBG.js → QueriesPage-Df7S76B_.js} +1 -1
- package/dist/dashboard/public/assets/{QueryDetailView-C7S5T4gR.js → QueryDetailView-BkUuf3JM.js} +1 -1
- package/dist/dashboard/public/assets/{RedisDetailView-C4GIOOnP.js → RedisDetailView-EHqxefP1.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-DnpXXKH4.js → RedisPage-BqyStSRQ.js} +1 -1
- package/dist/dashboard/public/assets/{RequestDetailView-Cn4ODjd1.js → RequestDetailView-D0pFJlIF.js} +1 -1
- package/dist/dashboard/public/assets/{RequestsPage-DIwAluED.js → RequestsPage-CSmOa0Pi.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-BDaEHt5R.js → ScheduleDetailView-BPjjgHxu.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-Cnc-hnPG.js → SchedulePage-Brf1dEFU.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-BmYUQi3r.js → UserCard-CEq6mQ5k.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-Zackmb6o.js → ViewDetailView-DzuPi6K1.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-B1t3Tr3J.js → ViewsPage-ClbTUhv0.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-9qQ8uPVL.js → calendar-CMjU8s5-.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-Bli60vcy.js → circle-alert-DQGZE3D0.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-U-LCU5sf.js → circle-check-big-Br_lvQdJ.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-_vJ4oOLg.js → circle-x-DFyAuyMN.js} +1 -1
- package/dist/dashboard/public/assets/{eye-BObEd0Qa.js → eye-BlDJOCMu.js} +1 -1
- package/dist/dashboard/public/assets/{index-BDYXzJp7.js → index-CNTaNUkj.js} +2 -2
- package/dist/dashboard/public/assets/{search-CGungMBv.js → search-CcMiea1V.js} +1 -1
- package/dist/dashboard/public/assets/{send-Bl_d6qCZ.js → send-CSgocT8I.js} +1 -1
- package/dist/dashboard/public/assets/{timer-CRZQMSbo.js → timer-CDc7JIAB.js} +1 -1
- package/dist/dashboard/public/assets/{types-C8DOK2OD.js → types-DqF5HlZi.js} +1 -1
- package/dist/dashboard/public/assets/{users-D556e-Le.js → users-D9yOg5Si.js} +1 -1
- package/dist/dashboard/public/assets/{zap-Bl3Cqtzd.js → zap-QXV06WYA.js} +1 -1
- package/dist/dashboard/public/index.html +1 -1
- package/dist/nestlens.module.d.ts +2 -1
- package/dist/nestlens.module.js +46 -7
- package/package.json +19 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as b,j as e,C as n}from"./index-
|
|
1
|
+
import{O as b,j as e,C as n}from"./index-CNTaNUkj.js";import{f as a,c as N}from"./format-BlNP-apw.js";import{C as o,B as v}from"./types-DqF5HlZi.js";import{p as l,f as m}from"./date-Dwgqy666.js";import{D as t,f as g}from"./DetailRow-C35E-Fg7.js";import{C as u}from"./circle-x-DFyAuyMN.js";import{C as k}from"./circle-check-big-Br_lvQdJ.js";import{T as w}from"./timer-CDc7JIAB.js";import{C as T}from"./calendar-CMjU8s5-.js";import"./vendor-DBTT3jXp.js";function d(i){try{return N.toString(i)}catch{return null}}const h={started:{icon:b,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30",label:"STARTED"},completed:{icon:k,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30",label:"COMPLETED"},failed:{icon:u,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30",label:"FAILED"}},C=["started","completed","failed"];function I({entry:i}){const{payload:s,createdAt:c,tags:j}=i,x=(j??[]).filter(f=>!C.includes(f.toLowerCase())),r=h[s.status]||h.started,p=r.icon,y=()=>s.cron?s.cron:s.interval?`${s.interval}ms`:"-";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(n,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white truncate font-mono",children:s.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Scheduled Task"})]})]})})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${s.status==="completed"?"text-green-600 dark:text-green-400":s.status==="failed"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"}`,children:r.label})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.duration!==void 0?e.jsxs(e.Fragment,{children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]}):"-"})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(T,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Schedule"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:y()}),s.cron&&d(s.cron)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d(s.cron)}),s.interval&&a(s.interval)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.interval)})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(n,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Timeout"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.timeout!==void 0?e.jsxs(e.Fragment,{children:[s.timeout,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]}):"-"}),s.timeout!==void 0&&a(s.timeout)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.timeout)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[g(l(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",m(l(c),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Task Name",value:e.jsx(o,{listType:"schedule",filterType:"names",filterValue:s.name,className:"font-mono",children:s.name})}),s.cron&&e.jsx(t,{label:"Cron Expression",value:e.jsxs("div",{children:[e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.cron}),d(s.cron)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:d(s.cron)})]})}),s.interval&&e.jsx(t,{label:"Interval",value:e.jsxs("div",{children:[e.jsxs("span",{children:[s.interval,"ms"]}),a(s.interval)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.interval)})]})}),e.jsx(t,{label:"Status",value:e.jsx(o,{listType:"schedule",filterType:"statuses",filterValue:s.status,children:s.status})}),s.duration!==void 0&&e.jsx(t,{label:"Duration",value:`${s.duration}ms`}),s.timeout!==void 0&&e.jsx(t,{label:"Timeout",value:e.jsxs("div",{children:[e.jsxs("span",{children:[s.timeout,"ms"]}),a(s.timeout)&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:a(s.timeout)})]})}),s.nextRun&&e.jsx(t,{label:"Next Run",value:e.jsxs("span",{children:[g(l(s.nextRun),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",m(l(s.nextRun),{addSuffix:!0}),")"]})]})}),x.length>0&&e.jsx(t,{label:"Tags",value:e.jsx(v,{items:x,listType:"schedule"})})]})})]}),s.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(u,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:s.error})})]})]})}export{I as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,C as u}from"./index-
|
|
1
|
+
import{j as a,C as u}from"./index-CNTaNUkj.js";import{e as P,b as h}from"./vendor-DBTT3jXp.js";import{f as m,c as H}from"./format-BlNP-apw.js";import{f as B,p as W}from"./date-Dwgqy666.js";import{u as $,a as I,P as q,R as z,N as G,L as J}from"./PageHeader-Dhs9cPza.js";import{u as K,h as O,C as p}from"./types-DqF5HlZi.js";import{T as i,D as Q,a as U,b as V}from"./DataTable-CCXj8zzB.js";import"./timer-CDc7JIAB.js";const X=["started","completed","failed"];function x(t){try{return H.toString(t)}catch{return null}}function le(){const t=P(),{addFilter:n,clearAll:g,serverFilters:f,headerFilters:y}=K("schedule"),{rangeFilters:j,windowMinutes:k}=$(),{entries:C,loading:b,refreshing:s,error:w,refresh:d,newEntriesCount:N,hasMore:T,loadMore:v,loadNew:E,autoRefreshEnabled:R,live:S,setAutoRefresh:F,meta:r,isHighlighted:M}=I({type:"schedule",limit:50,filters:{...f,...j},windowMinutes:k}),l=C.filter(e=>O(e)),c=h.useCallback(e=>e.payload.cron?e.payload.cron:e.payload.interval?`${e.payload.interval}ms`:"-",[]),D=h.useMemo(()=>[{key:"task",header:"Task",minWidth:"200px",render:e=>a.jsx(p,{listType:"schedule",filterType:"names",className:"font-mono",children:e.payload.name})},{key:"schedule",header:"Schedule",minWidth:"150px",render:e=>a.jsxs("div",{children:[a.jsx(i,{mono:!0,children:c(e)}),e.payload.cron&&x(e.payload.cron)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:x(e.payload.cron)}),e.payload.interval&&m(e.payload.interval)&&a.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 block mt-0.5",children:m(e.payload.interval)})]})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(p,{listType:"schedule",filterType:"statuses",children:e.payload.status})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?a.jsx(Q,{ms:e.payload.duration}):a.jsx(i,{secondary:!0,children:"—"})},{key:"tags",header:"Tags",minWidth:"150px",render:e=>{const A=(e.tags??[]).filter(o=>!X.includes(o.toLowerCase()));return a.jsx(U,{tags:A,max:3,onTagClick:(o,L)=>{L.stopPropagation(),n("tags",o)}})}},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:B(W(e.createdAt),{addSuffix:!0})})}],[n,c]);return b&&l.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(q,{title:"Schedule",icon:u,iconColor:"text-gray-600 dark:text-gray-400",count:l.length,totalCount:r==null?void 0:r.total,clearable:{type:"schedule",label:"schedule",onCleared:d},refreshing:s,autoRefreshEnabled:R,live:S,onAutoRefreshToggle:F,filters:y,filterControls:a.jsx(z,{route:"schedule"}),onClearAllFilters:g}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(G,{count:N,onClick:E,loading:s}),a.jsx(V,{columns:D,data:l,keyExtractor:e=>e.id,onRowClick:e=>t(`/schedule/${e.id}`),rowClassName:e=>M(e.id)?"highlight-new":"",emptyMessage:"No scheduled tasks recorded yet",error:w,onRetry:d,emptyIcon:a.jsx(u,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(J,{hasMore:T,onClick:v,loading:s})]})]})}export{le as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-CNTaNUkj.js";import{D as i}from"./DetailRow-C35E-Fg7.js";const s=["bg-red-100 text-red-800 dark:bg-red-900/40 dark:text-red-300","bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300","bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300","bg-teal-100 text-teal-800 dark:bg-teal-900/40 dark:text-teal-300","bg-blue-100 text-blue-800 dark:bg-blue-900/40 dark:text-blue-300","bg-indigo-100 text-indigo-800 dark:bg-indigo-900/40 dark:text-indigo-300","bg-purple-100 text-purple-800 dark:bg-purple-900/40 dark:text-purple-300","bg-pink-100 text-pink-800 dark:bg-pink-900/40 dark:text-pink-300"];function x(e){let r=0;for(let a=0;a<e.length;a+=1)r=r*31+e.charCodeAt(a)|0;return s[Math.abs(r)%s.length]}function g(e){var d,l;const r=(d=e.name)==null?void 0:d.trim(),a=(l=e.email)==null?void 0:l.trim().split("@")[0],n=(r||a||String(e.id??"")).split(/[\s._-]+/).filter(o=>o.length>0);return n.length===0?"?":(n.length>1?`${n[0][0]}${n[1][0]}`:n[0].slice(0,2)).toUpperCase()}function c({user:e}){const r=e.email??e.name??String(e.id??"");return t.jsx("span",{"aria-hidden":"true",className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold ${x(r)}`,children:g(e)})}function k({user:e}){return t.jsxs("div",{className:"card",children:[t.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:t.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Authenticated User"})}),t.jsx("div",{className:"p-4",children:t.jsxs("dl",{className:"divide-y-0",children:[t.jsx(i,{label:"ID",value:t.jsx("code",{className:"text-sm font-mono bg-gray-100 dark:bg-gray-800 px-2 py-0.5 rounded",children:String(e.id)})}),e.name&&t.jsx(i,{label:"Name",value:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(c,{user:e}),t.jsx("span",{children:e.name})]})}),e.email&&t.jsx(i,{label:"Email Address",value:t.jsx("a",{href:`mailto:${e.email}`,className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:e.email})})]})})]})}export{k as U};
|
package/dist/dashboard/public/assets/{ViewDetailView-Zackmb6o.js → ViewDetailView-DzuPi6K1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,F as p,C as h}from"./index-
|
|
1
|
+
import{j as e,F as p,C as h}from"./index-CNTaNUkj.js";import{p as i,f as j}from"./date-Dwgqy666.js";import{D as s,f as g}from"./DetailRow-C35E-Fg7.js";import{C as c}from"./types-DqF5HlZi.js";import{u as b,C as f,T as N}from"./EntryDetailPage-C63KztnI.js";import{C as u}from"./CopyButton-DpZHVixQ.js";import{E as o}from"./eye-BlDJOCMu.js";import{C as y}from"./circle-check-big-Br_lvQdJ.js";import{C as x}from"./circle-x-DFyAuyMN.js";import"./vendor-DBTT3jXp.js";import"./search-CcMiea1V.js";function M({entry:n}){const{payload:a,createdAt:d}=n,r=b(),t=a.status==="rendered"?{icon:y,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:x,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},m=t.icon,l=[];return a.locals!==void 0&&l.push({id:"locals",label:"Locals",content:e.jsx(f,{data:a.locals,toolbarState:r.state,searchBar:r.SearchBar,maxHeight:400})}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(o,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.template}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"View Render"})]})]}),e.jsx(u,{text:a.template,label:"Copy template"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Format"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono",children:a.format||"HTML"})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(h,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Cache"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:a.cacheHit?"Yes":"No"})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(s,{label:"Time",value:e.jsxs("span",{children:[g(i(d),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",j(i(d),{addSuffix:!0}),")"]})]})}),e.jsx(s,{label:"Template",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:a.template})}),a.format&&e.jsx(s,{label:"Format",value:e.jsx(c,{listType:"views",filterType:"formats",filterValue:a.format,children:a.format})}),e.jsx(s,{label:"Status",value:e.jsx(c,{listType:"views",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(s,{label:"Duration",value:`${a.duration}ms`}),a.cacheHit!==void 0&&e.jsx(s,{label:"Cached",value:a.cacheHit?"Yes":"No"}),a.dataSize!==void 0&&e.jsx(s,{label:"Data Size",value:`${a.dataSize} bytes`}),a.outputSize!==void 0&&e.jsx(s,{label:"Output Size",value:`${a.outputSize} bytes`})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(x,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),l.length>0&&e.jsx(N,{tabs:l,defaultTab:"locals",hashKey:"view",headerRight:a.locals!==void 0?e.jsx(r.Toolbar,{data:a.locals}):void 0})]})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-CNTaNUkj.js";import{e as D,b as M}from"./vendor-DBTT3jXp.js";import{f as P,p as A}from"./date-Dwgqy666.js";import{u as H,a as B,P as L,R as V,N as S,L as W}from"./PageHeader-Dhs9cPza.js";import{u as I,n as U,C as d}from"./types-DqF5HlZi.js";import{T as r,D as Y,b as $}from"./DataTable-CCXj8zzB.js";import{E as c}from"./eye-BlDJOCMu.js";import"./timer-CDc7JIAB.js";function Z(){const m=D(),{addFilter:s,clearAll:u,serverFilters:h,headerFilters:p}=I("views"),{rangeFilters:x,windowMinutes:g}=H(),{entries:f,loading:y,refreshing:i,error:w,refresh:l,newEntriesCount:j,hasMore:C,loadMore:v,loadNew:k,autoRefreshEnabled:N,live:b,setAutoRefresh:E,meta:o,isHighlighted:F}=B({type:"view",limit:50,filters:{...h,...x},windowMinutes:g}),n=f.filter(e=>U(e)),R=M.useMemo(()=>[{key:"template",header:"Template",minWidth:"250px",render:e=>t.jsx(r,{mono:!0,truncate:!0,maxWidth:"350px",children:e.payload.template})},{key:"format",header:"Format",width:"100px",render:e=>{const a=e.payload.format;return a?t.jsx(d,{onClick:T=>{T.stopPropagation(),s("formats",a)},className:"font-mono",children:a}):t.jsx(r,{secondary:!0,children:"-"})}},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>t.jsx(Y,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(d,{onClick:a=>{a.stopPropagation(),s("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"cache",header:"Cache",width:"80px",align:"center",render:e=>e.payload.cacheHit!==void 0?t.jsx(r,{children:e.payload.cacheHit?"Yes":"No"}):t.jsx(r,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(r,{secondary:!0,className:"text-xs",children:P(A(e.createdAt),{addSuffix:!0})})}],[s]);return y&&n.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx(L,{title:"Views",icon:c,iconColor:"text-teal-600 dark:text-teal-400",count:n.length,totalCount:o==null?void 0:o.total,clearable:{type:"view",label:"views",onCleared:l},refreshing:i,autoRefreshEnabled:N,live:b,onAutoRefreshToggle:E,filters:p,filterControls:t.jsx(V,{route:"views"}),onClearAllFilters:u}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(S,{count:j,onClick:k,loading:i}),t.jsx($,{columns:R,data:n,keyExtractor:e=>e.id,onRowClick:e=>m(`/views/${e.id}`),rowClassName:e=>F(e.id)?"highlight-new":"",emptyMessage:"No view renders recorded yet",error:w,onRetry:l,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:C,onClick:v,loading:i})]})]})}export{Z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DashboardPage-Ck0F9Z12.js","./vendor-DBTT3jXp.js","./date-Dwgqy666.js","./eye-BlDJOCMu.js","./zap-QXV06WYA.js","./calendar-CMjU8s5-.js","./RequestsPage-CSmOa0Pi.js","./PageHeader-Dhs9cPza.js","./types-DqF5HlZi.js","./timer-CDc7JIAB.js","./EntrySearchInput-BNjSxfmZ.js","./search-CcMiea1V.js","./DataTable-CCXj8zzB.js","./QueriesPage-Df7S76B_.js","./ExceptionsPage-DJRQKir2.js","./circle-check-big-Br_lvQdJ.js","./LogsPage-BYUqINeg.js","./EventsPage--LGwQSIW.js","./JobsPage-BuCIb8wu.js","./CachePage-CU847w5_.js","./MailPage-n712tj0J.js","./SchedulePage-Brf1dEFU.js","./format-BlNP-apw.js","./HttpClientPage-opI4zxU2.js","./RedisPage-BqyStSRQ.js","./ModelsPage-BgXuFcOx.js","./NotificationsPage-eznKkQYP.js","./ViewsPage-ClbTUhv0.js","./CommandsPage-BbiQyAea.js","./GatesPage-CP3_e7g1.js","./BatchesPage-vFo0vIr2.js","./DumpsPage-nKkfeRGr.js","./GraphQLPage-BCr6tRBy.js","./EntryDetailPage-C63KztnI.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Ce=Object.defineProperty;var Pe=(s,a,e)=>a in s?Ce(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e;var I=(s,a,e)=>Pe(s,typeof a!="symbol"?a+"":a,e);import{r as Re,a as Le,g as Te,b as r,u as De,L as M,O as Oe,R as Ae,c as p,N as Me,d as qe,B as $e}from"./vendor-DBTT3jXp.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function e(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=e(l);fetch(l.href,i)}})();var G={exports:{}},q={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
@@ -358,4 +358,4 @@ to {
|
|
|
358
358
|
*
|
|
359
359
|
* This source code is licensed under the ISC license.
|
|
360
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const rs=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),we=()=>window.__NESTLENS_BASE__??"",ns=s=>`${window.location.origin}${we()}/__nestlens__${s}`,Se=ns("/api");class os extends Error{constructor(){super("This entry is no longer stored"),this.name="EntryGoneError"}}async function _(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw e.status===404?new os:new Error(`API error: ${e.status}`);return e.json()}async function Is(s){return _(`/entries/${s}`)}async function ce(){return _("/stats")}async function is(s){var i;const a=s?`?type=${encodeURIComponent(s)}`:"",e=await fetch(`${Se}/entries${a}`,{method:"DELETE"});if(!e.ok)throw new Error(`API error: ${e.status}`);const o=await e.json();if(o.success===!1)throw new Error(o.error??"The request was refused");const l=((i=o.data)==null?void 0:i.deleted)??0;return{success:!0,message:o.message??`Cleared ${l} entries`,deleted:l}}async function zs(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search),e.from&&a.set("from",e.from),e.to&&a.set("to",e.to),e.minDuration!==void 0&&a.set("minDuration",e.minDuration.toString()),e.maxDuration!==void 0&&a.set("maxDuration",e.maxDuration.toString())}return _(`/entries/cursor?${a.toString()}`)}async function Ks(s){const a=new URLSearchParams;return s&&a.set("type",s),_(`/entries/latest-sequence?${a.toString()}`)}async function Vs(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),_(`/entries/check-new?${e.toString()}`)}async function Fs(){return _("/storage/stats")}async function Bs(){return _("/pruning/status")}async function Hs(){return _("/pruning/run",{method:"POST"})}async function Gs(){return _("/tags/monitored")}async function Js(s){return _("/tags/monitored",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:s})})}async function Us(s){return _(`/tags/monitored/${encodeURIComponent(s)}`,{method:"DELETE"})}async function Ws(s,a){return _(`/tags/entry/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Qs(s,a){return _(`/tags/entry/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Zs(s){return _(`/entries/${s}/resolve`,{method:"PATCH"})}async function Xs(s){return _(`/entries/${s}/unresolve`,{method:"PATCH"})}async function ls(s){return _("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function cs(){return _("/recording/resume",{method:"POST"})}async function ds(){return _("/recording/status")}function us(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:m,preventDefault:y=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,h=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class Ee extends r.Component{constructor(){super(...arguments);I(this,"state",{hasError:!1});I(this,"handleReload",()=>{window.location.reload()});I(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(ve,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(ts,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}const Ne=r.createContext(void 0);function hs(){const s=r.useContext(Ne);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function de(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await ds();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await cs();a(i.data),A.success("Recording resumed")}else{const i=await ls();a(i.data),A.success("Recording paused")}}catch{A.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Yt,{className:"h-5 w-5"}):t.jsx(Xt,{className:"h-5 w-5"})}):null}const ue={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},he=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Jt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:qt,colorKey:"request"},{name:"Queries",href:"/queries",icon:Vt,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:Bt,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Ft,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:zt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:Kt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Qt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:as,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:It,colorKey:"redis"},{name:"Models",href:"/models",icon:Gt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Ht,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ut,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:$t,colorKey:"notification"},{name:"Events",href:"/events",icon:es,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Zt,colorKey:"view"},{name:"Gates",href:"/gates",icon:ss,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function me(s){return s!=="system"?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches}function ms(){const s=De(),[a,e]=r.useState(!1),{stats:o}=hs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[u,x]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),d=r.useCallback(h=>{i(w=>{const N=new Set(w);return N.has(h)?N.delete(h):N.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...N])),N})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),y=r.useCallback(h=>{const w=me(h);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";x(h),localStorage.setItem("nestlens-theme",h),y(h)},[n,y]),k=r.useCallback(async()=>{if(window.confirm("Are you sure you want to clear all entries?")){try{await is()}catch(h){A.error(`Could not clear entries: ${h instanceof Error?h.message:String(h)}`);return}A.success("All entries cleared"),window.location.reload()}},[]);return r.useEffect(()=>{const h=me(u);if(document.documentElement.classList.toggle("dark",h),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),N=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",N),()=>w.removeEventListener("change",N)}},[u]),us([{key:"k",ctrl:!0,handler:()=>k()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(rs,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(M,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(J,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.17.0"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${C?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Wt,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Ee,{children:t.jsx(Oe,{})},s.pathname)})]})]})}function f(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const ps=r.lazy(()=>v(()=>import("./DashboardPage-BvMG0MnS.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./RequestsPage-DIwAluED.js"),__vite__mapDeps([6,1,2,7,8,9,10,11,12]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./QueriesPage-BiFenFBG.js"),__vite__mapDeps([13,1,2,7,8,9,10,11,12,4]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./ExceptionsPage-CiziAm9b.js"),__vite__mapDeps([14,1,2,7,8,9,10,11,12,15]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./LogsPage-EbR5l-NM.js"),__vite__mapDeps([16,1,2,7,8,9,10,11,12]),import.meta.url)),js=r.lazy(()=>v(()=>import("./EventsPage-BpPYK8yv.js"),__vite__mapDeps([17,1,2,7,8,9,12]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./JobsPage-CS-tIrOt.js"),__vite__mapDeps([18,1,2,7,8,9,12]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./CachePage-BkcnMR-M.js"),__vite__mapDeps([19,1,2,7,8,9,12]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./MailPage-BEkKMb9k.js"),__vite__mapDeps([20,1,2,7,8,9,12]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./SchedulePage-Cnc-hnPG.js"),__vite__mapDeps([21,1,22,2,7,8,9,12]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./HttpClientPage-C11SEV-2.js"),__vite__mapDeps([23,1,2,7,8,9,12]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./RedisPage-DnpXXKH4.js"),__vite__mapDeps([24,1,2,7,8,9,12]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ModelsPage-BjFVL3Gx.js"),__vite__mapDeps([25,1,2,7,8,9,12]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./NotificationsPage-Dlw7HM8W.js"),__vite__mapDeps([26,1,2,7,8,9,12]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./ViewsPage-B1t3Tr3J.js"),__vite__mapDeps([27,1,2,7,8,9,12,3]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BY0PP3s3.js"),__vite__mapDeps([28,1,2,7,8,9,12]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./GatesPage-QoTsDoC0.js"),__vite__mapDeps([29,1,2,7,8,9,12]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./BatchesPage-Bf9lrBmD.js"),__vite__mapDeps([30,1,2,7,8,9,12]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./DumpsPage-99LRTJbq.js"),__vite__mapDeps([31,1,2,7,8,9,12]),import.meta.url)),Ds=r.lazy(()=>v(()=>import("./GraphQLPage-DWrVF7vh.js"),__vite__mapDeps([32,1,2,10,11,7,8,9,12]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-CwdNk12N.js").then(s=>s.E),__vite__mapDeps([33,1,2,8,11]),import.meta.url));function Os(){return t.jsx(Ae,{children:t.jsxs(p,{path:"/",element:t.jsx(ms,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ds,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Me,{to:"/",replace:!0})})]})})}const As=1e4;function Ms({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),i.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const m=d instanceof Error?d:new Error("Failed to fetch stats");l(m),console.error("Failed to fetch stats:",d),i.current&&A.error("Failed to load statistics"),i.current=!1},[]),x=r.useCallback(async()=>ce().then(d=>c(d.data),d=>u(d)),[c,u]);return r.useEffect(()=>{n.current=!0;const d=setInterval(()=>void x(),As);return ce().then(m=>c(m.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ne.Provider,{value:{stats:a,error:o,refreshStats:x},children:s})}const _e=document.getElementById("root");if(!_e)throw new Error("NestLens dashboard: no #root element in the served index.html");Fe.createRoot(_e).render(t.jsx(qe.StrictMode,{children:t.jsx(Ee,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ms,{children:[t.jsx(Os,{}),t.jsx(Lt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{qt as A,zt as B,Kt as C,Vt as D,os as E,Ft as F,Bt as G,ne as H,Qs as I,Ws as J,Ee as K,Gt as L,Ut as M,Is as N,Yt as O,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,Js as a,as as b,g as c,It as d,Ht as e,$t as f,Gs as g,Zt as h,ae as i,t as j,le as k,ts as l,Fs as m,Bs as n,Hs as o,zs as p,Xs as q,Us as r,Zs as s,ns as t,hs as u,Vs as v,Ks as w,se as x,is as y,A as z};
|
|
361
|
+
*/const rs=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),we=()=>window.__NESTLENS_BASE__??"",ns=s=>`${window.location.origin}${we()}/__nestlens__${s}`,Se=ns("/api");class os extends Error{constructor(){super("This entry is no longer stored"),this.name="EntryGoneError"}}async function _(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw e.status===404?new os:new Error(`API error: ${e.status}`);return e.json()}async function Is(s){return _(`/entries/${s}`)}async function ce(){return _("/stats")}async function is(s){var i;const a=s?`?type=${encodeURIComponent(s)}`:"",e=await fetch(`${Se}/entries${a}`,{method:"DELETE"});if(!e.ok)throw new Error(`API error: ${e.status}`);const o=await e.json();if(o.success===!1)throw new Error(o.error??"The request was refused");const l=((i=o.data)==null?void 0:i.deleted)??0;return{success:!0,message:o.message??`Cleared ${l} entries`,deleted:l}}async function zs(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search),e.from&&a.set("from",e.from),e.to&&a.set("to",e.to),e.minDuration!==void 0&&a.set("minDuration",e.minDuration.toString()),e.maxDuration!==void 0&&a.set("maxDuration",e.maxDuration.toString())}return _(`/entries/cursor?${a.toString()}`)}async function Ks(s){const a=new URLSearchParams;return s&&a.set("type",s),_(`/entries/latest-sequence?${a.toString()}`)}async function Vs(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),_(`/entries/check-new?${e.toString()}`)}async function Fs(){return _("/storage/stats")}async function Bs(){return _("/pruning/status")}async function Hs(){return _("/pruning/run",{method:"POST"})}async function Gs(){return _("/tags/monitored")}async function Js(s){return _("/tags/monitored",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:s})})}async function Us(s){return _(`/tags/monitored/${encodeURIComponent(s)}`,{method:"DELETE"})}async function Ws(s,a){return _(`/tags/entry/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Qs(s,a){return _(`/tags/entry/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Zs(s){return _(`/entries/${s}/resolve`,{method:"PATCH"})}async function Xs(s){return _(`/entries/${s}/unresolve`,{method:"PATCH"})}async function ls(s){return _("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function cs(){return _("/recording/resume",{method:"POST"})}async function ds(){return _("/recording/status")}function us(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:m,preventDefault:y=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,h=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class Ee extends r.Component{constructor(){super(...arguments);I(this,"state",{hasError:!1});I(this,"handleReload",()=>{window.location.reload()});I(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(ve,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(ts,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}const Ne=r.createContext(void 0);function hs(){const s=r.useContext(Ne);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function de(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await ds();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await cs();a(i.data),A.success("Recording resumed")}else{const i=await ls();a(i.data),A.success("Recording paused")}}catch{A.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Yt,{className:"h-5 w-5"}):t.jsx(Xt,{className:"h-5 w-5"})}):null}const ue={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},he=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Jt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:qt,colorKey:"request"},{name:"Queries",href:"/queries",icon:Vt,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:Bt,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Ft,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:zt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:Kt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Qt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:as,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:It,colorKey:"redis"},{name:"Models",href:"/models",icon:Gt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Ht,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ut,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:$t,colorKey:"notification"},{name:"Events",href:"/events",icon:es,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Zt,colorKey:"view"},{name:"Gates",href:"/gates",icon:ss,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function me(s){return s!=="system"?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches}function ms(){const s=De(),[a,e]=r.useState(!1),{stats:o}=hs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[u,x]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),d=r.useCallback(h=>{i(w=>{const N=new Set(w);return N.has(h)?N.delete(h):N.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...N])),N})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),y=r.useCallback(h=>{const w=me(h);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";x(h),localStorage.setItem("nestlens-theme",h),y(h)},[n,y]),k=r.useCallback(async()=>{if(window.confirm("Are you sure you want to clear all entries?")){try{await is()}catch(h){A.error(`Could not clear entries: ${h instanceof Error?h.message:String(h)}`);return}A.success("All entries cleared"),window.location.reload()}},[]);return r.useEffect(()=>{const h=me(u);if(document.documentElement.classList.toggle("dark",h),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),N=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",N),()=>w.removeEventListener("change",N)}},[u]),us([{key:"k",ctrl:!0,handler:()=>k()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(rs,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(M,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(J,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.17.2"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${C?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Wt,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Ee,{children:t.jsx(Oe,{})},s.pathname)})]})]})}function f(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const ps=r.lazy(()=>v(()=>import("./DashboardPage-Ck0F9Z12.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./RequestsPage-CSmOa0Pi.js"),__vite__mapDeps([6,1,2,7,8,9,10,11,12]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./QueriesPage-Df7S76B_.js"),__vite__mapDeps([13,1,2,7,8,9,10,11,12,4]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./ExceptionsPage-DJRQKir2.js"),__vite__mapDeps([14,1,2,7,8,9,10,11,12,15]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./LogsPage-BYUqINeg.js"),__vite__mapDeps([16,1,2,7,8,9,10,11,12]),import.meta.url)),js=r.lazy(()=>v(()=>import("./EventsPage--LGwQSIW.js"),__vite__mapDeps([17,1,2,7,8,9,12]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./JobsPage-BuCIb8wu.js"),__vite__mapDeps([18,1,2,7,8,9,12]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./CachePage-CU847w5_.js"),__vite__mapDeps([19,1,2,7,8,9,12]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./MailPage-n712tj0J.js"),__vite__mapDeps([20,1,2,7,8,9,12]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./SchedulePage-Brf1dEFU.js"),__vite__mapDeps([21,1,22,2,7,8,9,12]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./HttpClientPage-opI4zxU2.js"),__vite__mapDeps([23,1,2,7,8,9,12]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./RedisPage-BqyStSRQ.js"),__vite__mapDeps([24,1,2,7,8,9,12]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ModelsPage-BgXuFcOx.js"),__vite__mapDeps([25,1,2,7,8,9,12]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./NotificationsPage-eznKkQYP.js"),__vite__mapDeps([26,1,2,7,8,9,12]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./ViewsPage-ClbTUhv0.js"),__vite__mapDeps([27,1,2,7,8,9,12,3]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BbiQyAea.js"),__vite__mapDeps([28,1,2,7,8,9,12]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./GatesPage-CP3_e7g1.js"),__vite__mapDeps([29,1,2,7,8,9,12]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./BatchesPage-vFo0vIr2.js"),__vite__mapDeps([30,1,2,7,8,9,12]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./DumpsPage-nKkfeRGr.js"),__vite__mapDeps([31,1,2,7,8,9,12]),import.meta.url)),Ds=r.lazy(()=>v(()=>import("./GraphQLPage-BCr6tRBy.js"),__vite__mapDeps([32,1,2,10,11,7,8,9,12]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-C63KztnI.js").then(s=>s.E),__vite__mapDeps([33,1,2,8,11]),import.meta.url));function Os(){return t.jsx(Ae,{children:t.jsxs(p,{path:"/",element:t.jsx(ms,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ds,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Me,{to:"/",replace:!0})})]})})}const As=1e4;function Ms({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),i.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const m=d instanceof Error?d:new Error("Failed to fetch stats");l(m),console.error("Failed to fetch stats:",d),i.current&&A.error("Failed to load statistics"),i.current=!1},[]),x=r.useCallback(async()=>ce().then(d=>c(d.data),d=>u(d)),[c,u]);return r.useEffect(()=>{n.current=!0;const d=setInterval(()=>void x(),As);return ce().then(m=>c(m.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ne.Provider,{value:{stats:a,error:o,refreshStats:x},children:s})}const _e=document.getElementById("root");if(!_e)throw new Error("NestLens dashboard: no #root element in the served index.html");Fe.createRoot(_e).render(t.jsx(qe.StrictMode,{children:t.jsx(Ee,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ms,{children:[t.jsx(Os,{}),t.jsx(Lt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{qt as A,zt as B,Kt as C,Vt as D,os as E,Ft as F,Bt as G,ne as H,Qs as I,Ws as J,Ee as K,Gt as L,Ut as M,Is as N,Yt as O,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,Js as a,as as b,g as c,It as d,Ht as e,$t as f,Gs as g,Zt as h,ae as i,t as j,le as k,ts as l,Fs as m,Bs as n,Hs as o,zs as p,Xs as q,Us as r,Zs as s,ns as t,hs as u,Vs as v,Ks as w,se as x,is as y,A as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E}from"./index-BDYXzJp7.js";import{f as D,b as d,e as C,u as L}from"./vendor-DBTT3jXp.js";import{g as R,h as w}from"./date-Dwgqy666.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",measuresDuration:!0,filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",measuresDuration:!1,filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",measuresDuration:!1,filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",measuresDuration:!0,filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",measuresDuration:!0,filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",measuresDuration:!0,filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",measuresDuration:!0,filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",measuresDuration:!0,filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",measuresDuration:!0,filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",measuresDuration:!0,filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",measuresDuration:!0,filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",measuresDuration:!0,filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",measuresDuration:!0,filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",measuresDuration:!0,filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",measuresDuration:!0,filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},q={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function k(e){if(e in T)return T[e];const s=q[e];if(s)return T[s]}const x=k;function B(e){const[s,i]=D(),a=x(e),c=d.useCallback(r=>{if(r==="tags")return"tags";if(!a)return r;const t=a.filters[r];return(t==null?void 0:t.urlKey)||r},[a]),o=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(u=>u.urlKey);t.push("tags","search");for(const u of t){const n=s.get(u);n&&(r[u]=n.split(",").filter(Boolean))}return r},[s,a]),N=d.useCallback((r,t)=>{!a&&r!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const u=c(r),n=o[u]||[];if(!n.includes(t)){const l=new URLSearchParams(s);l.set(u,[...n,t].join(",")),i(l,{replace:!0})}},[a,c,o,s,i]),p=d.useCallback((r,t)=>{const n=(o[r]||[]).filter(f=>f!==t),l=new URLSearchParams(s);n.length>0?l.set(r,n.join(",")):l.delete(r),i(l,{replace:!0})},[o,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>o,[o]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,u]of Object.entries(o)){if(u.length===0)continue;let n=t,l=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,l=h.displayName;break}r.push({category:n,urlKey:t,displayName:l,values:u})}return r},[o,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const u of t.values)r.push({category:t.displayName,value:u.toUpperCase(),onRemove:()=>p(t.urlKey,u)});return r},[y,p]),K=y.length>0;return{addFilter:N,removeFilter:p,clearAll:S,serverFilters:g,activeFilters:y,headerFilters:m,hasFilters:K,getUrlKey:c}}function O(e,s){if(s==="tags")return"tags";const i=x(e);if(!i)return s;const a=i.filters[s];return(a==null?void 0:a.urlKey)||s}const M=["localhost"],A=(e,s)=>{if(s&&s!=="tag")return s;if(/^user:/i.test(e))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return"ips";const i=e.toUpperCase();if(w.includes(i))return"methods";const a=parseInt(e,10);return!isNaN(a)&&a>=100&&a<600?"statuses":/^[a-fA-F0-9:]+$/.test(e)&&e.includes(":")&&!e.includes(".")?"ips":e.includes("#")||e.includes("::")||/Controller\./i.test(e)?"controllers":M.includes(e.toLowerCase())||(e.includes(".")||e.includes(":"))&&!e.startsWith("/")&&!/^\d+$/.test(e)?"hostnames":"tags"};function H({children:e,listType:s,filterType:i="tag",filterValue:a,onClick:c,clickable:o=!0,className:N="",ariaLabel:p}){const S=C(),g=L(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&o){const l=a||String(e),f=i&&i!=="tag"?O(s,i):A(l,i),h=g.pathname,v=h===`/${s}`||h.startsWith(`/${s}/`)?new URLSearchParams(g.search):new URLSearchParams,b=v.get(f);if(b){const P=b.split(",");P.includes(l)||v.set(f,[...P,l].join(","))}else v.set(f,l);S(`/${s}?${v.toString()}`)}},m=o&&(!!c||!!s),K=R(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),u=p||(m?`Click to filter by ${t}`:void 0);return E.jsx("span",{onClick:m?y:void 0,role:m?"button":void 0,"aria-label":u,tabIndex:m?0:void 0,onKeyDown:m?n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),y(n))}:void 0,title:t,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${K} ${r} ${m?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${N}`,children:t})}function I({items:e,listType:s,filterType:i="tag",maxItems:a=99,clickable:c=!0}){if(!e||e.length===0)return null;const o=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(p=>E.jsx(H,{listType:s,filterType:i,clickable:c,children:p},p)),N>0&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",N]})]})}function $(e){return e.type==="request"}function Q(e){return e.type==="query"}function V(e){return e.type==="exception"}function z(e){return e.type==="log"}function J(e){return e.type==="cache"}function Y(e){return e.type==="event"}function Z(e){return e.type==="job"}function _(e){return e.type==="schedule"}function W(e){return e.type==="mail"}function X(e){return e.type==="http-client"}function ee(e){return e.type==="redis"}function se(e){return e.type==="model"}function te(e){return e.type==="notification"}function ae(e){return e.type==="view"}function re(e){return e.type==="command"}function ne(e){return e.type==="gate"}function ie(e){return e.type==="batch"}function ue(e){return e.type==="dump"}function le(e){return e.type==="graphql"}export{I as B,H as C,Q as a,V as b,z as c,Y as d,Z as e,J as f,W as g,_ as h,$ as i,X as j,ee as k,se as l,te as m,ae as n,re as o,ne as p,ie as q,ue as r,le as s,x as t,B as u};
|
|
1
|
+
import{j as E}from"./index-CNTaNUkj.js";import{f as D,b as d,e as C,u as L}from"./vendor-DBTT3jXp.js";import{g as R,h as w}from"./date-Dwgqy666.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",measuresDuration:!0,filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",measuresDuration:!1,filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",measuresDuration:!1,filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",measuresDuration:!0,filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",measuresDuration:!0,filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",measuresDuration:!0,filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",measuresDuration:!0,filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",measuresDuration:!0,filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",measuresDuration:!0,filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",measuresDuration:!0,filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",measuresDuration:!0,filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",measuresDuration:!0,filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",measuresDuration:!0,filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",measuresDuration:!0,filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",measuresDuration:!0,filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},q={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function k(e){if(e in T)return T[e];const s=q[e];if(s)return T[s]}const x=k;function B(e){const[s,i]=D(),a=x(e),c=d.useCallback(r=>{if(r==="tags")return"tags";if(!a)return r;const t=a.filters[r];return(t==null?void 0:t.urlKey)||r},[a]),o=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(u=>u.urlKey);t.push("tags","search");for(const u of t){const n=s.get(u);n&&(r[u]=n.split(",").filter(Boolean))}return r},[s,a]),N=d.useCallback((r,t)=>{!a&&r!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const u=c(r),n=o[u]||[];if(!n.includes(t)){const l=new URLSearchParams(s);l.set(u,[...n,t].join(",")),i(l,{replace:!0})}},[a,c,o,s,i]),p=d.useCallback((r,t)=>{const n=(o[r]||[]).filter(f=>f!==t),l=new URLSearchParams(s);n.length>0?l.set(r,n.join(",")):l.delete(r),i(l,{replace:!0})},[o,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>o,[o]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,u]of Object.entries(o)){if(u.length===0)continue;let n=t,l=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,l=h.displayName;break}r.push({category:n,urlKey:t,displayName:l,values:u})}return r},[o,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const u of t.values)r.push({category:t.displayName,value:u.toUpperCase(),onRemove:()=>p(t.urlKey,u)});return r},[y,p]),K=y.length>0;return{addFilter:N,removeFilter:p,clearAll:S,serverFilters:g,activeFilters:y,headerFilters:m,hasFilters:K,getUrlKey:c}}function O(e,s){if(s==="tags")return"tags";const i=x(e);if(!i)return s;const a=i.filters[s];return(a==null?void 0:a.urlKey)||s}const M=["localhost"],A=(e,s)=>{if(s&&s!=="tag")return s;if(/^user:/i.test(e))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return"ips";const i=e.toUpperCase();if(w.includes(i))return"methods";const a=parseInt(e,10);return!isNaN(a)&&a>=100&&a<600?"statuses":/^[a-fA-F0-9:]+$/.test(e)&&e.includes(":")&&!e.includes(".")?"ips":e.includes("#")||e.includes("::")||/Controller\./i.test(e)?"controllers":M.includes(e.toLowerCase())||(e.includes(".")||e.includes(":"))&&!e.startsWith("/")&&!/^\d+$/.test(e)?"hostnames":"tags"};function H({children:e,listType:s,filterType:i="tag",filterValue:a,onClick:c,clickable:o=!0,className:N="",ariaLabel:p}){const S=C(),g=L(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&o){const l=a||String(e),f=i&&i!=="tag"?O(s,i):A(l,i),h=g.pathname,v=h===`/${s}`||h.startsWith(`/${s}/`)?new URLSearchParams(g.search):new URLSearchParams,b=v.get(f);if(b){const P=b.split(",");P.includes(l)||v.set(f,[...P,l].join(","))}else v.set(f,l);S(`/${s}?${v.toString()}`)}},m=o&&(!!c||!!s),K=R(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),u=p||(m?`Click to filter by ${t}`:void 0);return E.jsx("span",{onClick:m?y:void 0,role:m?"button":void 0,"aria-label":u,tabIndex:m?0:void 0,onKeyDown:m?n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),y(n))}:void 0,title:t,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${K} ${r} ${m?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${N}`,children:t})}function I({items:e,listType:s,filterType:i="tag",maxItems:a=99,clickable:c=!0}){if(!e||e.length===0)return null;const o=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(p=>E.jsx(H,{listType:s,filterType:i,clickable:c,children:p},p)),N>0&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",N]})]})}function $(e){return e.type==="request"}function Q(e){return e.type==="query"}function V(e){return e.type==="exception"}function z(e){return e.type==="log"}function J(e){return e.type==="cache"}function Y(e){return e.type==="event"}function Z(e){return e.type==="job"}function _(e){return e.type==="schedule"}function W(e){return e.type==="mail"}function X(e){return e.type==="http-client"}function ee(e){return e.type==="redis"}function se(e){return e.type==="model"}function te(e){return e.type==="notification"}function ae(e){return e.type==="view"}function re(e){return e.type==="command"}function ne(e){return e.type==="gate"}function ie(e){return e.type==="batch"}function ue(e){return e.type==="dump"}function le(e){return e.type==="graphql"}export{I as B,H as C,Q as a,V as b,z as c,Y as d,Z as e,J as f,W as g,_ as h,$ as i,X as j,ee as k,se as l,te as m,ae as n,re as o,ne as p,ie as q,ue as r,le as s,x as t,B as u};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="./nestlens-icon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>NestLens - Debug Dashboard</title>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-CNTaNUkj.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/vendor-DBTT3jXp.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-ReuerEhs.css">
|
|
11
11
|
</head>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MiddlewareConsumer, NestModule, DynamicModule, OnModuleInit } from '@nestjs/common';
|
|
2
|
+
import { ModuleRef } from '@nestjs/core';
|
|
2
3
|
import { NestLensConfig } from './nestlens.config';
|
|
3
4
|
export declare class NestLensModule implements NestModule, OnModuleInit {
|
|
4
5
|
private readonly config;
|
|
5
|
-
constructor(config: NestLensConfig);
|
|
6
|
+
constructor(config: NestLensConfig | undefined, moduleRef: ModuleRef);
|
|
6
7
|
/**
|
|
7
8
|
* Opens a request context around every request.
|
|
8
9
|
*
|
package/dist/nestlens.module.js
CHANGED
|
@@ -180,9 +180,39 @@ const ALL_WATCHERS_OFF = {
|
|
|
180
180
|
enabled: false,
|
|
181
181
|
watchers: Object.fromEntries(Object.keys(nestlens_config_1.DEFAULT_CONFIG.watchers ?? {}).map((key) => [key, false])),
|
|
182
182
|
};
|
|
183
|
+
/**
|
|
184
|
+
* The configuration as `forRoot` resolved it, for the module `forRoot` returned.
|
|
185
|
+
*
|
|
186
|
+
* Provided there and never exported. `imports: [NestLensModule]` in a feature
|
|
187
|
+
* module makes Nest instantiate the class a second time, and the hooks below
|
|
188
|
+
* belong to the class: through the global `NESTLENS_CONFIG` that instance
|
|
189
|
+
* printed the startup summary again and applied the request-context middleware
|
|
190
|
+
* a second time on every request — and with NestLens off, where nothing shares
|
|
191
|
+
* `NESTLENS_CONFIG`, it stopped the application booting. Only the module
|
|
192
|
+
* `forRoot` built can see this token, so the other instance does nothing.
|
|
193
|
+
*/
|
|
194
|
+
const FOR_ROOT_CONFIG = Symbol('NESTLENS_FOR_ROOT_CONFIG');
|
|
195
|
+
/** Whether a `forRoot` anywhere in this application provided a configuration. */
|
|
196
|
+
const configuredElsewhere = (moduleRef) => {
|
|
197
|
+
try {
|
|
198
|
+
moduleRef.get(nestlens_config_1.NESTLENS_CONFIG, { strict: false });
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
183
205
|
let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
184
|
-
constructor(config) {
|
|
206
|
+
constructor(config, moduleRef) {
|
|
185
207
|
this.config = config;
|
|
208
|
+
// The class imported with no `forRoot` in the application configures
|
|
209
|
+
// nothing. Asked through the container rather than a static flag, so two
|
|
210
|
+
// applications in one process each get their own answer.
|
|
211
|
+
if (!config && !configuredElsewhere(moduleRef)) {
|
|
212
|
+
throw new Error('NestLensModule was imported without NestLensModule.forRoot(), so nothing configures it ' +
|
|
213
|
+
'and it would record nothing. Call NestLensModule.forRoot() once, in the root module; ' +
|
|
214
|
+
'it is global, so feature modules do not import NestLensModule.');
|
|
215
|
+
}
|
|
186
216
|
}
|
|
187
217
|
/**
|
|
188
218
|
* Opens a request context around every request.
|
|
@@ -198,7 +228,7 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
198
228
|
* the library off, plus a property written onto every request object.
|
|
199
229
|
*/
|
|
200
230
|
configure(consumer) {
|
|
201
|
-
if (this.config.enabled === false) {
|
|
231
|
+
if (!this.config || this.config.enabled === false) {
|
|
202
232
|
return;
|
|
203
233
|
}
|
|
204
234
|
consumer.apply(request_context_middleware_1.RequestContextMiddleware).forRoutes('*');
|
|
@@ -216,6 +246,7 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
216
246
|
provide: nestlens_config_1.NESTLENS_CONFIG,
|
|
217
247
|
useValue: mergedConfig,
|
|
218
248
|
},
|
|
249
|
+
{ provide: FOR_ROOT_CONFIG, useValue: mergedConfig },
|
|
219
250
|
// Still injectable, and inert: a service written against a watcher's
|
|
220
251
|
// manual API boots, and its calls do nothing.
|
|
221
252
|
...[...OPT_IN_WATCHERS, watchers_1.NestLensLogger].map((provided) => ({
|
|
@@ -235,9 +266,12 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
235
266
|
const ownServer = mergedConfig.server;
|
|
236
267
|
// Settles the SPA catch-all's syntax against the adapter Nest was given;
|
|
237
268
|
// see spa-wildcard.ts for why that cannot be decided here.
|
|
238
|
-
const providers =
|
|
239
|
-
|
|
240
|
-
|
|
269
|
+
const providers = [
|
|
270
|
+
{ provide: FOR_ROOT_CONFIG, useValue: mergedConfig },
|
|
271
|
+
...(ownServer
|
|
272
|
+
? [{ provide: api_1.NESTLENS_SERVER_CONFIG, useValue: ownServer }, api_1.NestLensDashboardServer]
|
|
273
|
+
: [api_1.NestLensGuard, api_1.SpaRouteRegistrar]),
|
|
274
|
+
];
|
|
241
275
|
// API controllers must be registered before Dashboard to prevent catch-all from overriding API routes
|
|
242
276
|
const controllers = ownServer
|
|
243
277
|
? []
|
|
@@ -379,6 +413,10 @@ let NestLensModule = NestLensModule_1 = class NestLensModule {
|
|
|
379
413
|
};
|
|
380
414
|
}
|
|
381
415
|
async onModuleInit() {
|
|
416
|
+
// forRoot has already said "NestLens is disabled"; a summary after it
|
|
417
|
+
// described a recorder and a dashboard that do not exist.
|
|
418
|
+
if (!this.config || this.config.enabled === false)
|
|
419
|
+
return;
|
|
382
420
|
// What it is doing, not that it started: three of the four configuration
|
|
383
421
|
// mistakes an application reported are visible in this line.
|
|
384
422
|
NestLensModule_1.logger.log((0, startup_summary_1.startupSummary)(this.config));
|
|
@@ -388,6 +426,7 @@ exports.NestLensModule = NestLensModule;
|
|
|
388
426
|
NestLensModule.logger = new common_1.Logger('NestLens');
|
|
389
427
|
exports.NestLensModule = NestLensModule = NestLensModule_1 = __decorate([
|
|
390
428
|
(0, common_1.Module)({}),
|
|
391
|
-
__param(0, (0, common_1.
|
|
392
|
-
|
|
429
|
+
__param(0, (0, common_1.Optional)()),
|
|
430
|
+
__param(0, (0, common_1.Inject)(FOR_ROOT_CONFIG)),
|
|
431
|
+
__metadata("design:paramtypes", [Object, core_1.ModuleRef])
|
|
393
432
|
], NestLensModule);
|