nestlens 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/dto/cursor-query.dto.d.ts +10 -0
- package/dist/api/dto/cursor-query.dto.js +63 -5
- package/dist/core/data-masker.service.js +27 -5
- package/dist/dashboard/public/assets/{BatchDetailView-CNyv7Vc1.js → BatchDetailView-CBbONEZ6.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-BrvAux3V.js → BatchesPage-C5asqolh.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-CtmDMMR2.js → CacheDetailView-CqMU8Hge.js} +1 -1
- package/dist/dashboard/public/assets/{CachePage-D-LhEY8p.js → CachePage-Ce_yT75F.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-B_6u-4-M.js → CommandDetailView-LlOynfrs.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-BtMSnG2A.js → CommandsPage-BwMh373Z.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-C2sNp4HP.js → CopyButton-YkpN9Yi5.js} +1 -1
- package/dist/dashboard/public/assets/{DashboardPage-wUYPGV_y.js → DashboardPage-DdaOxHZ2.js} +1 -1
- package/dist/dashboard/public/assets/{DataTable-PCSvmOPj.js → DataTable-C9UKN_wr.js} +1 -1
- package/dist/dashboard/public/assets/{DetailRow-CfonsGvS.js → DetailRow-D_sZP7WV.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-DGy7eSQl.js → DumpDetailView-B6Zk2IcH.js} +1 -1
- package/dist/dashboard/public/assets/{DumpsPage-jeUeiAuN.js → DumpsPage-BrYuIT5U.js} +1 -1
- package/dist/dashboard/public/assets/{EntryDetailPage-C5QubCqk.js → EntryDetailPage-D7qvNuMn.js} +3 -3
- package/dist/dashboard/public/assets/{EntrySearchInput-DLuCL4Ys.js → EntrySearchInput-DeOYz9h4.js} +1 -1
- package/dist/dashboard/public/assets/{EventDetailView-DrExHdP3.js → EventDetailView-dR0UDb6r.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage-CA-mVFw2.js → EventsPage-O1icFuRw.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-xmNdG8Nb.js → ExceptionDetailView-FijwhgLY.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionsPage-D6ww4tft.js → ExceptionsPage-KuyeMrqK.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-Db3NrQmm.js → GateDetailView-CCUc65Vb.js} +1 -1
- package/dist/dashboard/public/assets/{GatesPage-CuEy3xE1.js → GatesPage-BKLfGgS9.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLDetailView-DZPwXidi.js → GraphQLDetailView-DN7qwLjl.js} +1 -1
- package/dist/dashboard/public/assets/{GraphQLPage-D4vF4fhg.js → GraphQLPage-BqkJnBEt.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientDetailView-7v6RERdZ.js → HttpClientDetailView-D7SRccHj.js} +1 -1
- package/dist/dashboard/public/assets/{HttpClientPage-Dz07Icgz.js → HttpClientPage-qC_nBzq2.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-DrDFXY-t.js → JobDetailView-B4A5Y2PM.js} +1 -1
- package/dist/dashboard/public/assets/{JobsPage-C7MOQ5N5.js → JobsPage-DyiOLpB1.js} +1 -1
- package/dist/dashboard/public/assets/{LogDetailView-OhpY0czv.js → LogDetailView-DZyruHPx.js} +1 -1
- package/dist/dashboard/public/assets/{LogsPage-CELJRQdo.js → LogsPage-6dDP3Pu_.js} +1 -1
- package/dist/dashboard/public/assets/{MailDetailView-rmPDboFn.js → MailDetailView-CLhOX0PN.js} +1 -1
- package/dist/dashboard/public/assets/{MailPage-CPmDY6cW.js → MailPage-tBhdhWmz.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-DVh-32OU.js → ModelDetailView-CVszB9Qw.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-Bi2hB6U7.js → ModelsPage-BTLkoWRR.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-C_IGKjY3.js → NotificationDetailView-CwpaMgGn.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-Bn3roYs1.js → NotificationsPage-BOPuEc8u.js} +1 -1
- package/dist/dashboard/public/assets/{PageHeader-CIBDYg8j.js → PageHeader-BQ2bLFIt.js} +1 -1
- package/dist/dashboard/public/assets/{QueriesPage-DzWPvH8G.js → QueriesPage-Plp4pZSN.js} +1 -1
- package/dist/dashboard/public/assets/{QueryDetailView-RUxW9Uqs.js → QueryDetailView-B64qfjgM.js} +1 -1
- package/dist/dashboard/public/assets/{RedisDetailView-Ceo27Mx3.js → RedisDetailView-BJ2OaAFq.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-pBNy_8Qd.js → RedisPage-CS2bcK-q.js} +1 -1
- package/dist/dashboard/public/assets/{RequestDetailView-t5odupt4.js → RequestDetailView-DtTVzNFt.js} +1 -1
- package/dist/dashboard/public/assets/{RequestsPage-B2dLu5n_.js → RequestsPage-D9KghDZ-.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-D8OZ-_yh.js → ScheduleDetailView-D8WOTS8u.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-CZ_j6ucP.js → SchedulePage-B3mUO2Ng.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-Dom0aCbz.js → UserCard-B8lhlqKk.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-Bxd64RN9.js → ViewDetailView-CUH2MA6k.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-Bvm7RI_3.js → ViewsPage-BhlcyTU3.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-BMPz0Z6s.js → calendar-gUrKMEEq.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-t2lIvGjF.js → circle-alert-WNDYen0I.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-DfHJ1LXS.js → circle-check-big-B6oE8hF5.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-Cgixh9fi.js → circle-x-Ch0JMytg.js} +1 -1
- package/dist/dashboard/public/assets/{eye-DRW5kZff.js → eye-DWj2WfH_.js} +1 -1
- package/dist/dashboard/public/assets/{index-DOVqOa07.js → index-B1QFrlfD.js} +2 -2
- package/dist/dashboard/public/assets/{search-DgNz5G1h.js → search-n3qpR8sp.js} +1 -1
- package/dist/dashboard/public/assets/{send-BKsI3HhT.js → send-DkLuIqBH.js} +1 -1
- package/dist/dashboard/public/assets/{timer-hkll0vuQ.js → timer-Dczpo1G1.js} +1 -1
- package/dist/dashboard/public/assets/{types-nsz9P0qo.js → types-DwzjtRI3.js} +1 -1
- package/dist/dashboard/public/assets/{users-CTNyAW4A.js → users-D7CwV95U.js} +1 -1
- package/dist/dashboard/public/assets/{zap-BolYLTQe.js → zap-C7m34sPr.js} +1 -1
- package/dist/dashboard/public/index.html +1 -1
- package/package.json +1 -1
|
@@ -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-DdaOxHZ2.js","./vendor-DBTT3jXp.js","./badgeColors-DQ_P_DOX.js","./zap-C7m34sPr.js","./calendar-gUrKMEEq.js","./RequestsPage-D9KghDZ-.js","./PageHeader-BQ2bLFIt.js","./types-DwzjtRI3.js","./EntrySearchInput-DeOYz9h4.js","./search-n3qpR8sp.js","./DataTable-C9UKN_wr.js","./QueriesPage-Plp4pZSN.js","./ExceptionsPage-KuyeMrqK.js","./circle-check-big-B6oE8hF5.js","./LogsPage-6dDP3Pu_.js","./EventsPage-O1icFuRw.js","./JobsPage-DyiOLpB1.js","./CachePage-Ce_yT75F.js","./MailPage-tBhdhWmz.js","./SchedulePage-B3mUO2Ng.js","./format-BlNP-apw.js","./HttpClientPage-qC_nBzq2.js","./RedisPage-CS2bcK-q.js","./ModelsPage-BTLkoWRR.js","./NotificationsPage-BOPuEc8u.js","./ViewsPage-BhlcyTU3.js","./eye-DWj2WfH_.js","./CommandsPage-BwMh373Z.js","./GatesPage-BKLfGgS9.js","./BatchesPage-C5asqolh.js","./DumpsPage-BrYuIT5U.js","./GraphQLPage-BqkJnBEt.js","./EntryDetailPage-D7qvNuMn.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.2"]})]})]})}),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-wUYPGV_y.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),ps=r.lazy(()=>v(()=>import("./RequestsPage-B2dLu5n_.js"),__vite__mapDeps([5,1,2,6,7,8,9,10]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./QueriesPage-DzWPvH8G.js"),__vite__mapDeps([11,1,2,6,7,8,9,10,3]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./ExceptionsPage-D6ww4tft.js"),__vite__mapDeps([12,1,2,6,7,8,9,10,13]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./LogsPage-CELJRQdo.js"),__vite__mapDeps([14,1,2,6,7,8,9,10]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./EventsPage-CA-mVFw2.js"),__vite__mapDeps([15,1,2,6,7,10]),import.meta.url)),js=r.lazy(()=>v(()=>import("./JobsPage-C7MOQ5N5.js"),__vite__mapDeps([16,1,2,6,7,10]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./CachePage-D-LhEY8p.js"),__vite__mapDeps([17,1,2,6,7,10]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./MailPage-CPmDY6cW.js"),__vite__mapDeps([18,1,2,6,7,10]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./SchedulePage-CZ_j6ucP.js"),__vite__mapDeps([19,1,20,2,6,7,10]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./HttpClientPage-Dz07Icgz.js"),__vite__mapDeps([21,1,2,6,7,10]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./RedisPage-pBNy_8Qd.js"),__vite__mapDeps([22,1,2,6,7,10]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./ModelsPage-Bi2hB6U7.js"),__vite__mapDeps([23,1,2,6,7,10]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./NotificationsPage-Bn3roYs1.js"),__vite__mapDeps([24,1,2,6,7,10]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ViewsPage-Bvm7RI_3.js"),__vite__mapDeps([25,1,2,6,7,10,26]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BtMSnG2A.js"),__vite__mapDeps([27,1,2,6,7,10]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./GatesPage-CuEy3xE1.js"),__vite__mapDeps([28,1,2,6,7,10]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./BatchesPage-BrvAux3V.js"),__vite__mapDeps([29,1,2,6,7,10]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./DumpsPage-jeUeiAuN.js"),__vite__mapDeps([30,1,2,6,7,10]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./GraphQLPage-D4vF4fhg.js"),__vite__mapDeps([31,1,2,8,9,6,7,10]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-C5QubCqk.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.4"]})]})]})}),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-DdaOxHZ2.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),ps=r.lazy(()=>v(()=>import("./RequestsPage-D9KghDZ-.js"),__vite__mapDeps([5,1,2,6,7,8,9,10]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./QueriesPage-Plp4pZSN.js"),__vite__mapDeps([11,1,2,6,7,8,9,10,3]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./ExceptionsPage-KuyeMrqK.js"),__vite__mapDeps([12,1,2,6,7,8,9,10,13]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./LogsPage-6dDP3Pu_.js"),__vite__mapDeps([14,1,2,6,7,8,9,10]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./EventsPage-O1icFuRw.js"),__vite__mapDeps([15,1,2,6,7,10]),import.meta.url)),js=r.lazy(()=>v(()=>import("./JobsPage-DyiOLpB1.js"),__vite__mapDeps([16,1,2,6,7,10]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./CachePage-Ce_yT75F.js"),__vite__mapDeps([17,1,2,6,7,10]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./MailPage-tBhdhWmz.js"),__vite__mapDeps([18,1,2,6,7,10]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./SchedulePage-B3mUO2Ng.js"),__vite__mapDeps([19,1,20,2,6,7,10]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./HttpClientPage-qC_nBzq2.js"),__vite__mapDeps([21,1,2,6,7,10]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./RedisPage-CS2bcK-q.js"),__vite__mapDeps([22,1,2,6,7,10]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./ModelsPage-BTLkoWRR.js"),__vite__mapDeps([23,1,2,6,7,10]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./NotificationsPage-BOPuEc8u.js"),__vite__mapDeps([24,1,2,6,7,10]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ViewsPage-BhlcyTU3.js"),__vite__mapDeps([25,1,2,6,7,10,26]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BwMh373Z.js"),__vite__mapDeps([27,1,2,6,7,10]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./GatesPage-BKLfGgS9.js"),__vite__mapDeps([28,1,2,6,7,10]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./BatchesPage-C5asqolh.js"),__vite__mapDeps([29,1,2,6,7,10]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./DumpsPage-BrYuIT5U.js"),__vite__mapDeps([30,1,2,6,7,10]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./GraphQLPage-BqkJnBEt.js"),__vite__mapDeps([31,1,2,8,9,6,7,10]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-D7qvNuMn.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-DOVqOa07.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-B1QFrlfD.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-B1QFrlfD.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>
|