nestlens 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/public/assets/{BatchDetailView-Bsy2PuQe.js → BatchDetailView-BVwqprXl.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-CQW14t60.js → BatchesPage-D6Y-VbZW.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-BBslUKHC.js → CacheDetailView-DAKwW79l.js} +1 -1
- package/dist/dashboard/public/assets/{CachePage-Br6fWq6s.js → CachePage-D3ZAuKbE.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-DMo7dvVp.js → CommandDetailView-DUlOruy-.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-B9ZRrqza.js → CommandsPage-8Ly-1pVn.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-Bv-9LOsE.js → CopyButton-CCiHK8SA.js} +1 -1
- package/dist/dashboard/public/assets/{DashboardPage-DtM7fkcY.js → DashboardPage-HQJ5EqZi.js} +1 -1
- package/dist/dashboard/public/assets/{DataTable-pg6TAu1Z.js → DataTable-IY4rgbLi.js} +1 -1
- package/dist/dashboard/public/assets/{DetailRow-xr5glUSW.js → DetailRow-BrSIGemm.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-DHfLzTkk.js → DumpDetailView-Df-ygu8R.js} +1 -1
- package/dist/dashboard/public/assets/{DumpsPage-BWPfahsl.js → DumpsPage-DX7kzOSi.js} +1 -1
- package/dist/dashboard/public/assets/{EntryDetailPage-ySspbjmO.js → EntryDetailPage-CvuUpMuM.js} +3 -3
- package/dist/dashboard/public/assets/{EntrySearchInput-CrfYeyav.js → EntrySearchInput-Cep2-s2v.js} +1 -1
- package/dist/dashboard/public/assets/{EventDetailView-BXOS4iRB.js → EventDetailView-DTTwJXmG.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage-4naKmzZP.js → EventsPage-DDPJ2rMk.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-t-C62EFX.js → ExceptionDetailView-IU2r55Ep.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionsPage-RNtSJjtv.js → ExceptionsPage-DBYRnysW.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-u2tpVkwV.js → GateDetailView-Dk4Dflc1.js} +1 -1
- package/dist/dashboard/public/assets/{GatesPage-D0S_s9d2.js → GatesPage-CbZbVBab.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLDetailView-DaEBjzVl.js → GraphQLDetailView-CkaJ573i.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLPage-odQNxTG7.js → GraphQLPage-CT1lBIqP.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientDetailView-BrGjL9iv.js → HttpClientDetailView-uzkJ0a2W.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientPage-CnqFgPVQ.js → HttpClientPage-UVqfS3lX.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-Bsv60ngi.js → JobDetailView-Bw_G0h-k.js} +1 -1
- package/dist/dashboard/public/assets/{JobsPage-C5Wtc-ZI.js → JobsPage-BehPu36v.js} +1 -1
- package/dist/dashboard/public/assets/{LogDetailView-D4EFIzfT.js → LogDetailView-C4zHaxtW.js} +1 -1
- package/dist/dashboard/public/assets/{LogsPage-DNKoG2HW.js → LogsPage-rc3m7U7I.js} +1 -1
- package/dist/dashboard/public/assets/{MailDetailView-eHk6RL2H.js → MailDetailView-C0agIRwB.js} +1 -1
- package/dist/dashboard/public/assets/{MailPage-Dogt7WFX.js → MailPage-DKkMqiyO.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-DZTyFWs2.js → ModelDetailView-ezmk3atr.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-B8jJXA-k.js → ModelsPage-BHnRG1du.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-D2bnswRz.js → NotificationDetailView-BRxW--Ek.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-C382Yi-6.js → NotificationsPage-BrTG1nga.js} +1 -1
- package/dist/dashboard/public/assets/PageHeader-CA02rA6z.js +1 -0
- package/dist/dashboard/public/assets/{QueriesPage-CCRF79oW.js → QueriesPage-kGgFPHUq.js} +1 -1
- package/dist/dashboard/public/assets/{QueryDetailView-DJizBKvS.js → QueryDetailView-BuP7IA2L.js} +1 -1
- package/dist/dashboard/public/assets/{RedisDetailView-2LOCbEXy.js → RedisDetailView-CnhWC0Lh.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-BQK_yXXY.js → RedisPage-BSyT0Q7O.js} +1 -1
- package/dist/dashboard/public/assets/{RequestDetailView-DR3QV73i.js → RequestDetailView-Nb4Miizp.js} +1 -1
- package/dist/dashboard/public/assets/{RequestsPage-DOhCESjF.js → RequestsPage-ExHuUYNY.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-G1k7GH69.js → ScheduleDetailView-sPecJ0Wy.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-BAiOo2WT.js → SchedulePage-BqISID5x.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-u_N1SazL.js → UserCard-Ds2eFQ5u.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-BzX5tTbb.js → ViewDetailView-B-euVoGK.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-DONQdCnP.js → ViewsPage-Czow9YAd.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-DDr-oSF5.js → calendar-DjIv6CVc.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-cVAzBh7n.js → circle-alert-YrNLnEY3.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-DvFFRD4F.js → circle-check-big-DArmNZLQ.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-DlEioxNB.js → circle-x-BAiU-N3B.js} +1 -1
- package/dist/dashboard/public/assets/{eye-BUQogHkE.js → eye-DMeWKkCr.js} +1 -1
- package/dist/dashboard/public/assets/{index-Bg4OUR33.js → index-CCIS1AbN.js} +2 -2
- package/dist/dashboard/public/assets/{search-acMA4Jyn.js → search-CtGPQIEG.js} +1 -1
- package/dist/dashboard/public/assets/{send-C9Kq2qwM.js → send-BjuXpyOz.js} +1 -1
- package/dist/dashboard/public/assets/{timer-BiQjyWxR.js → timer-C0_HYkkd.js} +1 -1
- package/dist/dashboard/public/assets/{types-DW_MOGQx.js → types-DTQLegxJ.js} +1 -1
- package/dist/dashboard/public/assets/{users-vCP8fjU_.js → users-CUxyUz2K.js} +1 -1
- package/dist/dashboard/public/assets/{zap-CiyapLvl.js → zap-DzO0l81l.js} +1 -1
- package/dist/dashboard/public/index.html +1 -1
- package/package.json +1 -1
- package/dist/dashboard/public/assets/PageHeader-X7MTogey.js +0 -1
package/dist/dashboard/public/assets/{ViewDetailView-BzX5tTbb.js → ViewDetailView-B-euVoGK.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-CCIS1AbN.js";import{p as i,f as j}from"./badgeColors-DQ_P_DOX.js";import{D as s,f as g}from"./DetailRow-BrSIGemm.js";import{C as c}from"./types-DTQLegxJ.js";import{u as b,C as f,T as N}from"./EntryDetailPage-CvuUpMuM.js";import{C as u}from"./CopyButton-CCiHK8SA.js";import{E as o}from"./eye-DMeWKkCr.js";import{C as y}from"./circle-check-big-DArmNZLQ.js";import{C as x}from"./circle-x-BAiU-N3B.js";import"./vendor-DBTT3jXp.js";import"./search-CtGPQIEG.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-CCIS1AbN.js";import{e as P,b as T}from"./vendor-DBTT3jXp.js";import{f as D,p as A}from"./badgeColors-DQ_P_DOX.js";import{u as M,P as R,N as H,L as B}from"./PageHeader-CA02rA6z.js";import{u as L,n as V,C as l}from"./types-DTQLegxJ.js";import{T as r,D as S,b as W}from"./DataTable-IY4rgbLi.js";import{E as d}from"./eye-DMeWKkCr.js";function J(){const c=P(),{addFilter:s,clearAll:h,serverFilters:m,headerFilters:u,hasFilters:p}=L("views"),{entries:x,loading:g,refreshing:i,newEntriesCount:f,hasMore:y,loadMore:w,loadNew:j,autoRefreshEnabled:C,live:k,setAutoRefresh:N,meta:o,isHighlighted:v}=M({type:"view",limit:50,filters:m}),n=x.filter(e=>V(e)),E=T.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(l,{onClick:F=>{F.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(S,{ms:e.payload.duration||0})},{key:"status",header:"Status",width:"100px",render:e=>t.jsx(l,{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:D(A(e.createdAt),{addSuffix:!0})})}],[s]);if(g&&n.length===0)return 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"})});const b=p?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(R,{title:"Views",icon:d,iconColor:"text-teal-600 dark:text-teal-400",count:n.length,totalCount:o==null?void 0:o.total,refreshing:i,autoRefreshEnabled:C,live:k,onAutoRefreshToggle:N,filters:u,onClearAllFilters:h}),t.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[t.jsx(H,{count:f,onClick:j,loading:i}),t.jsx(W,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>c(`/views/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No view renders recorded yet",emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(B,{hasMore:y,onClick:w,loading:i})]})]})}export{J 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-HQJ5EqZi.js","./vendor-DBTT3jXp.js","./badgeColors-DQ_P_DOX.js","./zap-DzO0l81l.js","./calendar-DjIv6CVc.js","./RequestsPage-ExHuUYNY.js","./PageHeader-CA02rA6z.js","./types-DTQLegxJ.js","./EntrySearchInput-Cep2-s2v.js","./search-CtGPQIEG.js","./DataTable-IY4rgbLi.js","./QueriesPage-kGgFPHUq.js","./ExceptionsPage-DBYRnysW.js","./circle-check-big-DArmNZLQ.js","./LogsPage-rc3m7U7I.js","./EventsPage-DDPJ2rMk.js","./JobsPage-BehPu36v.js","./CachePage-D3ZAuKbE.js","./MailPage-DKkMqiyO.js","./SchedulePage-BqISID5x.js","./format-BlNP-apw.js","./HttpClientPage-UVqfS3lX.js","./RedisPage-BSyT0Q7O.js","./ModelsPage-BHnRG1du.js","./NotificationsPage-BrTG1nga.js","./ViewsPage-Czow9YAd.js","./eye-DMeWKkCr.js","./CommandsPage-8Ly-1pVn.js","./GatesPage-CbZbVBab.js","./BatchesPage-D6Y-VbZW.js","./DumpsPage-DX7kzOSi.js","./GraphQLPage-CT1lBIqP.js","./EntryDetailPage-CvuUpMuM.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Pe=Object.defineProperty;var Ce=(s,a,e)=>a in s?Pe(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e;var z=(s,a,e)=>Ce(s,typeof a!="symbol"?a+"":a,e);import{r as Re,a as Le,g as Te,b as r,u as Ae,L as D,O as Oe,R as De,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"]'))i(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const n of o.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&i(n)}).observe(document,{childList:!0,subtree:!0});function e(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(l){if(l.ep)return;l.ep=!0;const o=e(l);fetch(l.href,o)}})();var G={exports:{}},M={};/**
|
|
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");async function P(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function $s(s){return P(`/entries/${s}`)}async function ce(){return P("/stats")}async function os(){return(await fetch(`${Se}/entries`,{method:"DELETE"})).json()}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)}return P(`/entries/cursor?${a.toString()}`)}async function Is(s){const a=new URLSearchParams;return s&&a.set("type",s),P(`/entries/latest-sequence?${a.toString()}`)}async function Ks(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),P(`/entries/check-new?${e.toString()}`)}async function Vs(){return P("/storage/stats")}async function Bs(){return P("/pruning/status")}async function Fs(){return P("/pruning/run",{method:"POST"})}async function Hs(s){return P(`/entries/${s}/resolve`,{method:"PATCH"})}async function Gs(s){return P(`/entries/${s}/unresolve`,{method:"PATCH"})}async function is(s){return P("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function ls(){return P("/recording/resume",{method:"POST"})}async function cs(){return P("/recording/status")}function ds(s){const a=r.useCallback(e=>{const i=e.target,l=i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable;for(const o of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:h,preventDefault:y=!0}=o;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,m=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&m){y&&e.preventDefault(),h(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&m){y&&e.preventDefault(),h(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&m){y&&e.preventDefault(),h(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class _e extends r.Component{constructor(){super(...arguments);z(this,"state",{hasError:!1});z(this,"handleReload",()=>{window.location.reload()});z(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,i){console.error("ErrorBoundary caught an error:",e,i),this.setState({errorInfo:i})}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 Ee=r.createContext(void 0);function us(){const s=r.useContext(Ee);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,i]=r.useState(!1);r.useEffect(()=>{const o=async()=>{try{const c=await cs();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};o();const n=setInterval(o,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){i(!0);try{if(s.isPaused){const o=await ls();a(o.data),q.success("Recording resumed")}else{const o=await is();a(o.data),q.success("Recording paused")}}catch{q.error("Failed to toggle recording")}finally{i(!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:Ut,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:Ft,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Bt,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:It,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:zt,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:Jt,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 hs(){const s=Ae(),[a,e]=r.useState(!1),{stats:i}=us(),[l,o]=r.useState(()=>{if(typeof window<"u"){const m=localStorage.getItem("nestlens-collapsed-groups");return m?new Set(JSON.parse(m)):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 m=localStorage.getItem("nestlens-theme");if(m==="system"||m==="light"||m==="dark")return m}return"system"}),d=r.useCallback(m=>{o(w=>{const E=new Set(w);return E.has(m)?E.delete(m):E.add(m),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...E])),E})},[]),h=r.useCallback(m=>{if(!i)return 0;switch(m){case"exceptions":return i.unresolvedExceptions??i.byType.exception??0;default:return 0}},[i]),y=r.useCallback(m=>{const w=me(m);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const m=n?"light":"dark";x(m),localStorage.setItem("nestlens-theme",m),y(m)},[n,y]),k=r.useCallback(async()=>{window.confirm("Are you sure you want to clear all entries?")&&(await os(),q.success("All entries cleared"),window.location.reload())},[]);return r.useEffect(()=>{const m=me(u);if(document.documentElement.classList.toggle("dark",m),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),E=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",E),()=>w.removeEventListener("change",E)}},[u]),ds([{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(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{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((m,w)=>{const E=l.has(m.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(m.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":!E,"aria-controls":`nav-group-${m.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:m.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:m.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?h(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${N?"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})]}),C>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:C>99?"99+":C})]},b.name)})})]},m.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(D,{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(U,{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.9.6"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((m,w)=>{const E=l.has(m.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(m.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":!E,"aria-controls":`desktop-nav-group-${m.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:m.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:m.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?h(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${N?"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})]}),C>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 ${N?"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:C>99?"99+":C})]},b.name)})})]},m.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(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{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(_e,{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 ms=r.lazy(()=>v(()=>import("./DashboardPage-DtM7fkcY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),ps=r.lazy(()=>v(()=>import("./RequestsPage-DOhCESjF.js"),__vite__mapDeps([5,1,2,6,7,8,9,10]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./QueriesPage-CCRF79oW.js"),__vite__mapDeps([11,1,2,6,7,8,9,10,3]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./ExceptionsPage-RNtSJjtv.js"),__vite__mapDeps([12,1,2,6,7,8,9,10,13]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./LogsPage-DNKoG2HW.js"),__vite__mapDeps([14,1,2,6,7,8,9,10]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./EventsPage-4naKmzZP.js"),__vite__mapDeps([15,1,2,6,7,10]),import.meta.url)),js=r.lazy(()=>v(()=>import("./JobsPage-C5Wtc-ZI.js"),__vite__mapDeps([16,1,2,6,7,10]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./CachePage-Br6fWq6s.js"),__vite__mapDeps([17,1,2,6,7,10]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./MailPage-Dogt7WFX.js"),__vite__mapDeps([18,1,2,6,7,10]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./SchedulePage-BAiOo2WT.js"),__vite__mapDeps([19,1,20,2,6,7,10]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./HttpClientPage-CnqFgPVQ.js"),__vite__mapDeps([21,1,2,6,7,10]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./RedisPage-BQK_yXXY.js"),__vite__mapDeps([22,1,2,6,7,10]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./ModelsPage-B8jJXA-k.js"),__vite__mapDeps([23,1,2,6,7,10]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./NotificationsPage-C382Yi-6.js"),__vite__mapDeps([24,1,2,6,7,10]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ViewsPage-DONQdCnP.js"),__vite__mapDeps([25,1,2,6,7,10,26]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-B9ZRrqza.js"),__vite__mapDeps([27,1,2,6,7,10]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./GatesPage-D0S_s9d2.js"),__vite__mapDeps([28,1,2,6,7,10]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./BatchesPage-CQW14t60.js"),__vite__mapDeps([29,1,2,6,7,10]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./DumpsPage-BWPfahsl.js"),__vite__mapDeps([30,1,2,6,7,10]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./GraphQLPage-odQNxTG7.js"),__vite__mapDeps([31,1,2,8,9,6,7,10]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-ySspbjmO.js").then(s=>s.E),__vite__mapDeps([32,1,2,7,9]),import.meta.url));function As(){return t.jsx(De,{children:t.jsxs(p,{path:"/",element:t.jsx(hs,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ms,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),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(Cs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),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 Os=1e4;function Ds({children:s}){const[a,e]=r.useState(null),[i,l]=r.useState(null),o=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),o.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const h=d instanceof Error?d:new Error("Failed to fetch stats");l(h),console.error("Failed to fetch stats:",d),o.current&&q.error("Failed to load statistics"),o.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(),Os);return ce().then(h=>c(h.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ee.Provider,{value:{stats:a,error:i,refreshStats:x},children:s})}const Ne=document.getElementById("root");if(!Ne)throw new Error("NestLens dashboard: no #root element in the served index.html");Be.createRoot(Ne).render(t.jsx(qe.StrictMode,{children:t.jsx(_e,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ds,{children:[t.jsx(As,{}),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,It as B,Kt as C,Vt as D,Bt as F,Ft as G,ne as H,Gt as L,Jt as M,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,as as a,zt as b,g as c,Ht as d,$t as e,Zt as f,ae as g,le as h,ts as i,t as j,Vs as k,Bs as l,zs as m,Gs as n,Hs as o,ns as p,Is as q,Fs as r,Ks as s,se as t,us as u,$s as v,Yt as w,q 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");async function P(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function $s(s){return P(`/entries/${s}`)}async function ce(){return P("/stats")}async function os(){return(await fetch(`${Se}/entries`,{method:"DELETE"})).json()}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)}return P(`/entries/cursor?${a.toString()}`)}async function Is(s){const a=new URLSearchParams;return s&&a.set("type",s),P(`/entries/latest-sequence?${a.toString()}`)}async function Ks(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),P(`/entries/check-new?${e.toString()}`)}async function Vs(){return P("/storage/stats")}async function Bs(){return P("/pruning/status")}async function Fs(){return P("/pruning/run",{method:"POST"})}async function Hs(s){return P(`/entries/${s}/resolve`,{method:"PATCH"})}async function Gs(s){return P(`/entries/${s}/unresolve`,{method:"PATCH"})}async function is(s){return P("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function ls(){return P("/recording/resume",{method:"POST"})}async function cs(){return P("/recording/status")}function ds(s){const a=r.useCallback(e=>{const i=e.target,l=i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.isContentEditable;for(const o of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:h,preventDefault:y=!0}=o;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,m=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&m){y&&e.preventDefault(),h(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&m){y&&e.preventDefault(),h(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&m){y&&e.preventDefault(),h(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class _e extends r.Component{constructor(){super(...arguments);z(this,"state",{hasError:!1});z(this,"handleReload",()=>{window.location.reload()});z(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,i){console.error("ErrorBoundary caught an error:",e,i),this.setState({errorInfo:i})}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 Ee=r.createContext(void 0);function us(){const s=r.useContext(Ee);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,i]=r.useState(!1);r.useEffect(()=>{const o=async()=>{try{const c=await cs();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};o();const n=setInterval(o,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){i(!0);try{if(s.isPaused){const o=await ls();a(o.data),q.success("Recording resumed")}else{const o=await is();a(o.data),q.success("Recording paused")}}catch{q.error("Failed to toggle recording")}finally{i(!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:Ut,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:Ft,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Bt,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:It,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:zt,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:Jt,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 hs(){const s=Ae(),[a,e]=r.useState(!1),{stats:i}=us(),[l,o]=r.useState(()=>{if(typeof window<"u"){const m=localStorage.getItem("nestlens-collapsed-groups");return m?new Set(JSON.parse(m)):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 m=localStorage.getItem("nestlens-theme");if(m==="system"||m==="light"||m==="dark")return m}return"system"}),d=r.useCallback(m=>{o(w=>{const E=new Set(w);return E.has(m)?E.delete(m):E.add(m),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...E])),E})},[]),h=r.useCallback(m=>{if(!i)return 0;switch(m){case"exceptions":return i.unresolvedExceptions??i.byType.exception??0;default:return 0}},[i]),y=r.useCallback(m=>{const w=me(m);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const m=n?"light":"dark";x(m),localStorage.setItem("nestlens-theme",m),y(m)},[n,y]),k=r.useCallback(async()=>{window.confirm("Are you sure you want to clear all entries?")&&(await os(),q.success("All entries cleared"),window.location.reload())},[]);return r.useEffect(()=>{const m=me(u);if(document.documentElement.classList.toggle("dark",m),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),E=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",E),()=>w.removeEventListener("change",E)}},[u]),ds([{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(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{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((m,w)=>{const E=l.has(m.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(m.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":!E,"aria-controls":`nav-group-${m.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:m.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:m.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?h(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${N?"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})]}),C>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:C>99?"99+":C})]},b.name)})})]},m.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(D,{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(U,{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.9.7"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((m,w)=>{const E=l.has(m.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(m.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":!E,"aria-controls":`desktop-nav-group-${m.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:m.name}),E?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!E&&t.jsx("div",{className:"mt-1 space-y-0.5",children:m.items.map(b=>{const N=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),C="badge"in b?h(b.badge):0;return t.jsxs(D,{to:b.href,"aria-current":N?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${N?"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})]}),C>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 ${N?"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:C>99?"99+":C})]},b.name)})})]},m.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(D,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(U,{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(_e,{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 ms=r.lazy(()=>v(()=>import("./DashboardPage-HQJ5EqZi.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),ps=r.lazy(()=>v(()=>import("./RequestsPage-ExHuUYNY.js"),__vite__mapDeps([5,1,2,6,7,8,9,10]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./QueriesPage-kGgFPHUq.js"),__vite__mapDeps([11,1,2,6,7,8,9,10,3]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./ExceptionsPage-DBYRnysW.js"),__vite__mapDeps([12,1,2,6,7,8,9,10,13]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./LogsPage-rc3m7U7I.js"),__vite__mapDeps([14,1,2,6,7,8,9,10]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./EventsPage-DDPJ2rMk.js"),__vite__mapDeps([15,1,2,6,7,10]),import.meta.url)),js=r.lazy(()=>v(()=>import("./JobsPage-BehPu36v.js"),__vite__mapDeps([16,1,2,6,7,10]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./CachePage-D3ZAuKbE.js"),__vite__mapDeps([17,1,2,6,7,10]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./MailPage-DKkMqiyO.js"),__vite__mapDeps([18,1,2,6,7,10]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./SchedulePage-BqISID5x.js"),__vite__mapDeps([19,1,20,2,6,7,10]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./HttpClientPage-UVqfS3lX.js"),__vite__mapDeps([21,1,2,6,7,10]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./RedisPage-BSyT0Q7O.js"),__vite__mapDeps([22,1,2,6,7,10]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./ModelsPage-BHnRG1du.js"),__vite__mapDeps([23,1,2,6,7,10]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./NotificationsPage-BrTG1nga.js"),__vite__mapDeps([24,1,2,6,7,10]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ViewsPage-Czow9YAd.js"),__vite__mapDeps([25,1,2,6,7,10,26]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-8Ly-1pVn.js"),__vite__mapDeps([27,1,2,6,7,10]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./GatesPage-CbZbVBab.js"),__vite__mapDeps([28,1,2,6,7,10]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./BatchesPage-D6Y-VbZW.js"),__vite__mapDeps([29,1,2,6,7,10]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./DumpsPage-DX7kzOSi.js"),__vite__mapDeps([30,1,2,6,7,10]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./GraphQLPage-CT1lBIqP.js"),__vite__mapDeps([31,1,2,8,9,6,7,10]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-CvuUpMuM.js").then(s=>s.E),__vite__mapDeps([32,1,2,7,9]),import.meta.url));function As(){return t.jsx(De,{children:t.jsxs(p,{path:"/",element:t.jsx(hs,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ms,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),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(Cs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),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 Os=1e4;function Ds({children:s}){const[a,e]=r.useState(null),[i,l]=r.useState(null),o=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),o.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const h=d instanceof Error?d:new Error("Failed to fetch stats");l(h),console.error("Failed to fetch stats:",d),o.current&&q.error("Failed to load statistics"),o.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(),Os);return ce().then(h=>c(h.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ee.Provider,{value:{stats:a,error:i,refreshStats:x},children:s})}const Ne=document.getElementById("root");if(!Ne)throw new Error("NestLens dashboard: no #root element in the served index.html");Be.createRoot(Ne).render(t.jsx(qe.StrictMode,{children:t.jsx(_e,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ds,{children:[t.jsx(As,{}),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,It as B,Kt as C,Vt as D,Bt as F,Ft as G,ne as H,Gt as L,Jt as M,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,as as a,zt as b,g as c,Ht as d,$t as e,Zt as f,ae as g,le as h,ts as i,t as j,Vs as k,Bs as l,zs as m,Gs as n,Hs as o,ns as p,Is as q,Fs as r,Ks as s,se as t,us as u,$s as v,Yt as w,q as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E}from"./index-Bg4OUR33.js";import{f as C,b as d,e as L,u as R}from"./vendor-DBTT3jXp.js";import{g as w,h as q}from"./badgeColors-DQ_P_DOX.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",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",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",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",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",filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",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",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",filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",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",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",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",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",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",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",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",filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",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",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",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:[]}}}},k={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 O(e){if(e in T)return T[e];const s=k[e];if(s)return T[s]}const x=O;function B(e){const[s,i]=C(),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]),u=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(l=>l.urlKey);t.push("tags","search");for(const l of t){const n=s.get(l);n&&(r[l]=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 l=c(r),n=u[l]||[];if(!n.includes(t)){const o=new URLSearchParams(s);o.set(l,[...n,t].join(",")),i(o,{replace:!0})}},[a,c,u,s,i]),p=d.useCallback((r,t)=>{const n=(u[r]||[]).filter(f=>f!==t),o=new URLSearchParams(s);n.length>0?o.set(r,n.join(",")):o.delete(r),i(o,{replace:!0})},[u,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>u,[u]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,l]of Object.entries(u)){if(l.length===0)continue;let n=t,o=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,o=h.displayName;break}r.push({category:n,urlKey:t,displayName:o,values:l})}return r},[u,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const l of t.values)r.push({category:t.displayName,value:l.toUpperCase(),onRemove:()=>p(t.urlKey,l)});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 D(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(q.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:u=!0,className:N="",ariaLabel:p}){const S=L(),g=R(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&u){const o=a||String(e),f=i&&i!=="tag"?D(s,i):A(o,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(o)||v.set(f,[...P,o].join(","))}else v.set(f,o);S(`/${s}?${v.toString()}`)}},m=u&&(!!c||!!s),K=w(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),l=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":l,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 u=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u.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 le(e){return e.type==="dump"}function oe(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,le as r,oe as s,B as u};
|
|
1
|
+
import{j as E}from"./index-CCIS1AbN.js";import{f as C,b as d,e as L,u as R}from"./vendor-DBTT3jXp.js";import{g as w,h as q}from"./badgeColors-DQ_P_DOX.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",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",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",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",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",filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",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",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",filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",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",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",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",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",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",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",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",filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",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",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",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:[]}}}},k={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 O(e){if(e in T)return T[e];const s=k[e];if(s)return T[s]}const x=O;function B(e){const[s,i]=C(),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]),u=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(l=>l.urlKey);t.push("tags","search");for(const l of t){const n=s.get(l);n&&(r[l]=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 l=c(r),n=u[l]||[];if(!n.includes(t)){const o=new URLSearchParams(s);o.set(l,[...n,t].join(",")),i(o,{replace:!0})}},[a,c,u,s,i]),p=d.useCallback((r,t)=>{const n=(u[r]||[]).filter(f=>f!==t),o=new URLSearchParams(s);n.length>0?o.set(r,n.join(",")):o.delete(r),i(o,{replace:!0})},[u,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>u,[u]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,l]of Object.entries(u)){if(l.length===0)continue;let n=t,o=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,o=h.displayName;break}r.push({category:n,urlKey:t,displayName:o,values:l})}return r},[u,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const l of t.values)r.push({category:t.displayName,value:l.toUpperCase(),onRemove:()=>p(t.urlKey,l)});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 D(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(q.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:u=!0,className:N="",ariaLabel:p}){const S=L(),g=R(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&u){const o=a||String(e),f=i&&i!=="tag"?D(s,i):A(o,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(o)||v.set(f,[...P,o].join(","))}else v.set(f,o);S(`/${s}?${v.toString()}`)}},m=u&&(!!c||!!s),K=w(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),l=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":l,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 u=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[u.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 le(e){return e.type==="dump"}function oe(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,le as r,oe as s,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-CCIS1AbN.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/vendor-DBTT3jXp.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="./assets/index-B9BCPNKv.css">
|
|
11
11
|
</head>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./vendor-DBTT3jXp.js";import{p as ae,z as O,m as F,q as se,s as U,j as r,i as H,e as ne,t as ce,X as le}from"./index-Bg4OUR33.js";function ie(){return ae("/stream")}function oe(s,t=!0){const n=a.useRef(s),[i,u]=a.useState(!1);return a.useEffect(()=>{n.current=s},[s]),a.useEffect(()=>{if(!t||typeof EventSource>"u")return;const l=new EventSource(ie(),{withCredentials:!0}),p=g=>{try{n.current(JSON.parse(g.data))}catch{}};return l.addEventListener("entry",p),l.onopen=()=>u(!0),l.onerror=()=>u(!1),()=>{l.removeEventListener("entry",p),l.close(),u(!1)}},[t]),{connected:i}}function D(s){return s==null?"":typeof s!="object"?String(s):Array.isArray(s)?"["+s.map(D).join(",")+"]":"{"+Object.keys(s).sort().map(n=>`"${n}":${D(s[n])}`).join(",")+"}"}const P="nestlens-auto-refresh";function de(){try{const s=localStorage.getItem(P);return s===null?!0:s==="true"}catch{return!0}}function ue(s){try{localStorage.setItem(P,String(s))}catch{}}function me(s={}){const{type:t,limit:n=50,autoRefresh:i,autoRefreshInterval:u=5e3,filters:l}=s,p=D(l),g=`${t}|${n}|${p}`,[$,f]=a.useState([]),[j,q]=a.useState(null),[S,h]=a.useState(!1),[L,k]=a.useState(null),[x,v]=a.useState(null),[E,o]=a.useState(0),[m,w]=a.useState(i??de()),d=a.useRef(null),R=a.useRef(null),_=a.useRef(!0),z=j===null&&L===null,G=S||j!==null&&j!==g,J=a.useRef(p),C=a.useRef(new Map),[,W]=a.useState(0),T=1e4,K=a.useCallback(e=>{f(e.data),v(e.meta),d.current=e.meta.newestSequence,o(0),k(null),_.current=!1,J.current=p,q(g)},[p,g]),B=a.useCallback(e=>{const c=e instanceof Error?e:new Error("Failed to fetch entries");k(c),console.error("Failed to fetch entries:",e),O.error("Failed to load entries"),q(g)},[g]),X=a.useCallback(async()=>{if(!(!(x!=null&&x.oldestSequence)||!x.hasMore)){h(!0);try{const e=await F({type:t,limit:n,beforeSequence:x.oldestSequence,filters:l});f(c=>[...c,...e.data]),v(e.meta)}catch(e){console.error("Failed to load more entries:",e),O.error("Failed to load more entries")}finally{h(!1)}}},[t,n,x,l]),Y=a.useCallback(async()=>{if(d.current){h(!0);try{const e=await F({type:t,limit:E||n,afterSequence:d.current,filters:l});if(e.data.length>0){const c=Date.now();e.data.forEach(y=>{C.current.set(y.id,c)}),f(y=>[...e.data,...y]),d.current=e.meta.newestSequence,o(0)}}catch(e){console.error("Failed to load new entries:",e),O.error("Failed to load new entries")}finally{h(!1)}}},[t,n,E,l]),Q=a.useCallback(async()=>{h(!0);try{k(null);const e=await F({type:t,limit:n,filters:l});f(e.data),v(e.meta),d.current=e.meta.newestSequence,o(0)}catch(e){const c=e instanceof Error?e:new Error("Failed to refresh entries");k(c),console.error("Failed to refresh entries:",e),O.error("Failed to refresh entries")}finally{h(!1)}},[t,n,l]),A=a.useCallback(async()=>{if(!d.current){try{(await se(t)).data&&o(1)}catch{}return}try{const e=await U(d.current,t);o(e.data.count)}catch{}},[t]),V=a.useCallback(e=>{w(e),ue(e)},[]),Z=a.useCallback(e=>{f(c=>c.map(y=>y.id===e.id?e:y))},[]);a.useEffect(()=>{F({type:t,limit:n,filters:l}).then(K,B)},[t,n,l,K,B]);const ee=a.useCallback(e=>{const c=C.current.get(e);return c?Date.now()-c<T:!1},[]),M=a.useCallback(()=>{const e=Date.now();let c=!1;C.current.forEach((y,b)=>{e-y>=T&&(C.current.delete(b),c=!0)}),c&&W(y=>y+1)},[]),I=a.useCallback(async()=>{if(d.current)try{const e=await U(d.current,t);if(e.data.count>0){const c=await F({type:t,limit:e.data.count,afterSequence:d.current,filters:l});if(c.data.length>0){const y=Date.now();c.data.forEach(b=>{C.current.set(b.id,y)}),f(b=>[...c.data,...b]),d.current=c.meta.newestSequence,v(b=>b?{...b,total:b.total+c.data.length,newestSequence:c.meta.newestSequence}:c.meta)}}}catch{}},[t,l]);a.useEffect(()=>(m?R.current=setInterval(I,u):R.current=setInterval(A,u),()=>{R.current&&(clearInterval(R.current),R.current=null)}),[m,u,I,A]),a.useEffect(()=>{const e=setInterval(M,1e3);return()=>clearInterval(e)},[M]);const N=a.useRef(null),re=a.useCallback(e=>{t&&e.type!==t||N.current||(N.current=setTimeout(()=>{N.current=null,m?I():A()},200))},[t,m,I,A]),{connected:te}=oe(re);return a.useEffect(()=>()=>{N.current&&(clearTimeout(N.current),N.current=null)},[]),{entries:$,loading:z,refreshing:G,error:L,meta:x,newEntriesCount:E,hasMore:(x==null?void 0:x.hasMore)??!1,loadMore:X,loadNew:Y,refresh:Q,setAutoRefresh:V,autoRefreshEnabled:m,updateEntry:Z,isHighlighted:ee,live:te}}function ye({count:s,onClick:t,loading:n}){return s===0?null:r.jsxs("button",{onClick:t,disabled:n,className:"w-full py-3 px-4 bg-primary-50 dark:bg-primary-900/20 text-primary-600 dark:text-primary-400 font-medium rounded-lg hover:bg-primary-100 dark:hover:bg-primary-900/30 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?r.jsx(H,{className:"h-4 w-4 animate-spin"}):r.jsx(ne,{className:"h-4 w-4"}),r.jsxs("span",{children:["Load ",s," new ",s===1?"entry":"entries"]})]})}function fe({hasMore:s,onClick:t,loading:n}){return s?r.jsxs("button",{onClick:t,disabled:n,className:"w-full py-3 px-4 bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors flex items-center justify-center space-x-2 disabled:opacity-50",children:[n?r.jsx(H,{className:"h-4 w-4 animate-spin"}):r.jsx(ce,{className:"h-4 w-4"}),r.jsx("span",{children:"Load older entries"})]}):null}function pe({title:s,icon:t,iconColor:n="text-primary-600 dark:text-primary-400",count:i,totalCount:u,subtitle:l,loading:p,refreshing:g,onRefresh:$,autoRefreshEnabled:f,onAutoRefreshToggle:j,live:q,filters:S=[],onClearAllFilters:h,actions:L,filterControls:k}){const x=S.length>0,v=i??u,E=S.reduce((o,m)=>(o[m.category]||(o[m.category]=[]),o[m.category].push(m),o),{});return r.jsxs("div",{className:"fixed top-0 left-0 right-0 lg:left-64 z-30 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:[r.jsxs("div",{className:"h-16 px-4 lg:px-6 flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"hidden sm:flex p-2 rounded-lg bg-gray-100 dark:bg-gray-800",children:r.jsx(t,{className:`h-5 w-5 ${n}`})}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white",children:s}),v!==void 0&&r.jsxs("span",{role:"status","aria-live":"polite",className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-300",children:[v.toLocaleString(),u!==void 0&&i!==void 0&&i!==u&&r.jsxs("span",{className:"text-gray-400 dark:text-gray-500 ml-1",children:["/ ",u.toLocaleString()]})]}),l&&r.jsx("span",{className:"hidden md:inline text-sm text-gray-500 dark:text-gray-400",children:l})]})]}),r.jsxs("div",{className:"flex items-center space-x-2",children:[L,q&&r.jsxs("span",{"data-testid":"live-indicator",className:"hidden sm:flex items-center space-x-1.5 px-2.5 py-1.5 rounded-lg text-sm font-medium bg-red-50 text-red-600 dark:bg-red-900/20 dark:text-red-400",title:"Live — entries stream in real time",children:[r.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),r.jsx("span",{children:"Live"})]}),j&&r.jsxs("button",{onClick:()=>j(!f),className:`hidden sm:flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors whitespace-nowrap ${f?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,title:f?"Auto-refresh enabled":"Auto-refresh disabled",children:[r.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${f?"bg-green-500 animate-pulse":"bg-gray-400"}`}),r.jsx("span",{children:"Auto Refresh"})]}),$&&r.jsx("button",{onClick:$,disabled:!!p||!!g,"aria-busy":g,"aria-label":g?"Refreshing...":"Refresh",className:"p-2 rounded-lg text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-700 dark:hover:text-gray-200 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh",children:r.jsx(H,{className:`h-4 w-4 ${g?"animate-spin":""}`})})]})]}),k&&r.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:k}),x&&r.jsx("div",{className:"px-4 lg:px-6 py-2 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-gray-900/50",children:r.jsxs("div",{className:"flex items-center flex-wrap gap-2",children:[r.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mr-1",children:"Filters:"}),Object.entries(E).map(([o,m])=>r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:[o,":"]}),m.map((w,d)=>r.jsxs("button",{onClick:w.onRemove,"aria-label":`Remove ${o} filter: ${w.value}`,className:"inline-flex items-center space-x-1 px-2 py-0.5 rounded-md text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 hover:bg-primary-200 dark:hover:bg-primary-900/50 transition-colors group uppercase",children:[r.jsx("span",{children:w.value}),r.jsx(le,{className:"h-3 w-3 opacity-60 group-hover:opacity-100"})]},`${w.category}-${w.value}-${d}`))]},o)),h&&S.length>1&&r.jsx("button",{onClick:h,className:"ml-2 text-xs text-gray-500 dark:text-gray-400 hover:text-red-600 dark:hover:text-red-400 transition-colors",children:"Clear all"})]})})]})}function he({tabs:s,activeTab:t,onChange:n}){return r.jsx("div",{className:"flex items-center space-x-1",children:s.map(i=>r.jsxs("button",{onClick:()=>n(i.id),className:`px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${t===i.id?"bg-primary-100 text-primary-700 dark:bg-primary-900/50 dark:text-primary-300":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"}`,children:[i.label,i.count!==void 0&&r.jsx("span",{className:`ml-1.5 text-xs ${t===i.id?"text-primary-600 dark:text-primary-400":"text-gray-400 dark:text-gray-500"}`,children:i.count})]},i.id))})}function be({label:s,enabled:t,onChange:n,icon:i}){return r.jsxs("button",{onClick:()=>n(!t),className:`flex items-center space-x-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${t?"bg-primary-100 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300":"bg-gray-100 text-gray-600 dark:bg-gray-800 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700"}`,children:[i&&r.jsx(i,{className:"h-4 w-4"}),r.jsx("span",{children:s})]})}export{he as F,fe as L,ye as N,pe as P,be as T,me as u};
|