nestlens 0.17.2 → 0.18.0
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-MwxKpCBw.js → BatchDetailView-Rdxcyl60.js} +1 -1
- package/dist/dashboard/public/assets/{BatchesPage-vFo0vIr2.js → BatchesPage-BArrHcRL.js} +1 -1
- package/dist/dashboard/public/assets/{CacheDetailView-CcGupoLQ.js → CacheDetailView-Byz_zLtx.js} +2 -2
- package/dist/dashboard/public/assets/{CachePage-CU847w5_.js → CachePage--JS4eL4s.js} +1 -1
- package/dist/dashboard/public/assets/{CommandDetailView-CVZrIKo6.js → CommandDetailView-62xqrFAz.js} +1 -1
- package/dist/dashboard/public/assets/{CommandsPage-BbiQyAea.js → CommandsPage-BwpLnQiJ.js} +1 -1
- package/dist/dashboard/public/assets/{CopyButton-DpZHVixQ.js → CopyButton-CyIomCQt.js} +1 -1
- package/dist/dashboard/public/assets/DashboardPage-BhlJQ4dF.js +21 -0
- package/dist/dashboard/public/assets/{DataTable-CCXj8zzB.js → DataTable-DrEET9sA.js} +9 -9
- package/dist/dashboard/public/assets/{DetailRow-C35E-Fg7.js → DetailRow-CXRD4xLz.js} +1 -1
- package/dist/dashboard/public/assets/{DumpDetailView-C3AszicE.js → DumpDetailView-BVCk0wbu.js} +3 -3
- package/dist/dashboard/public/assets/{DumpsPage-nKkfeRGr.js → DumpsPage-DywSvYlf.js} +1 -1
- package/dist/dashboard/public/assets/EntryDetailPage-B_6RhOpQ.js +27 -0
- package/dist/dashboard/public/assets/EntrySearchInput-DgqVJlTJ.js +1 -0
- package/dist/dashboard/public/assets/{EventDetailView-i_T5zzxK.js → EventDetailView-D7QmGn8C.js} +1 -1
- package/dist/dashboard/public/assets/{EventsPage--LGwQSIW.js → EventsPage-CJ9p4LV5.js} +1 -1
- package/dist/dashboard/public/assets/{ExceptionDetailView-BD375JkM.js → ExceptionDetailView-DxcozV3-.js} +2 -2
- package/dist/dashboard/public/assets/{ExceptionsPage-DJRQKir2.js → ExceptionsPage-BIUcV_53.js} +1 -1
- package/dist/dashboard/public/assets/{GateDetailView-DjS0BcxS.js → GateDetailView-DLaK-MwZ.js} +2 -2
- package/dist/dashboard/public/assets/{GatesPage-CP3_e7g1.js → GatesPage-CAlV9WUm.js} +1 -1
- package/dist/dashboard/public/assets/GraphQLDetailView-BiH9ruC6.js +6 -0
- package/dist/dashboard/public/assets/{GraphQLPage-BCr6tRBy.js → GraphQLPage-CJoR0V6d.js} +1 -1
- package/dist/dashboard/public/assets/HttpClientDetailView-BSAiX1rf.js +1 -0
- package/dist/dashboard/public/assets/{HttpClientPage-opI4zxU2.js → HttpClientPage-C4Rv5O1y.js} +1 -1
- package/dist/dashboard/public/assets/{JobDetailView-4qAPrQWH.js → JobDetailView-_sLpppDg.js} +2 -2
- package/dist/dashboard/public/assets/{JobsPage-BuCIb8wu.js → JobsPage-C5AitKVg.js} +1 -1
- package/dist/dashboard/public/assets/LogDetailView-CqVysoB0.js +1 -0
- package/dist/dashboard/public/assets/{LogsPage-BYUqINeg.js → LogsPage-CoAlZx-S.js} +1 -1
- package/dist/dashboard/public/assets/{MailDetailView-BPFRJcUh.js → MailDetailView-DoJpjXl0.js} +2 -2
- package/dist/dashboard/public/assets/{MailPage-n712tj0J.js → MailPage-BnRl6UUD.js} +1 -1
- package/dist/dashboard/public/assets/{ModelDetailView-BDzUh_Kg.js → ModelDetailView-81sZ7qH6.js} +1 -1
- package/dist/dashboard/public/assets/{ModelsPage-BgXuFcOx.js → ModelsPage-DLXRkTGa.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationDetailView-D-wwNBBg.js → NotificationDetailView-BFsLWtVN.js} +1 -1
- package/dist/dashboard/public/assets/{NotificationsPage-eznKkQYP.js → NotificationsPage-BfBTA56F.js} +1 -1
- package/dist/dashboard/public/assets/PageHeader-D7-C2JjI.js +1 -0
- package/dist/dashboard/public/assets/QueriesPage-C-I7oeYj.js +1 -0
- package/dist/dashboard/public/assets/{QueryDetailView-BkUuf3JM.js → QueryDetailView-Do9ekpbv.js} +2 -2
- package/dist/dashboard/public/assets/{RedisDetailView-EHqxefP1.js → RedisDetailView-BCM_7SxV.js} +1 -1
- package/dist/dashboard/public/assets/{RedisPage-BqyStSRQ.js → RedisPage-DHm1OE6S.js} +1 -1
- package/dist/dashboard/public/assets/RequestDetailView-D-jv84LW.js +1 -0
- package/dist/dashboard/public/assets/{RequestsPage-CSmOa0Pi.js → RequestsPage-Mv5Runje.js} +1 -1
- package/dist/dashboard/public/assets/{ScheduleDetailView-BPjjgHxu.js → ScheduleDetailView-D8OSvpM4.js} +1 -1
- package/dist/dashboard/public/assets/{SchedulePage-Brf1dEFU.js → SchedulePage-B963z8i5.js} +1 -1
- package/dist/dashboard/public/assets/{UserCard-CEq6mQ5k.js → UserCard-CHwYS4S2.js} +1 -1
- package/dist/dashboard/public/assets/{ViewDetailView-DzuPi6K1.js → ViewDetailView-DJ6KBzxG.js} +1 -1
- package/dist/dashboard/public/assets/{ViewsPage-ClbTUhv0.js → ViewsPage-hxrXILl5.js} +1 -1
- package/dist/dashboard/public/assets/{calendar-CMjU8s5-.js → calendar-FShGw2V4.js} +1 -1
- package/dist/dashboard/public/assets/{circle-alert-DQGZE3D0.js → circle-alert-BXPSM30P.js} +1 -1
- package/dist/dashboard/public/assets/{circle-check-big-Br_lvQdJ.js → circle-check-big-CPeNdziU.js} +1 -1
- package/dist/dashboard/public/assets/{circle-x-DFyAuyMN.js → circle-x-_KknexSM.js} +1 -1
- package/dist/dashboard/public/assets/{eye-BlDJOCMu.js → eye-8eLIbu7g.js} +1 -1
- package/dist/dashboard/public/assets/index-CMvt7uFU.css +1 -0
- package/dist/dashboard/public/assets/{index-CNTaNUkj.js → index-CQsXkVIl.js} +2 -2
- package/dist/dashboard/public/assets/{search-CcMiea1V.js → search-DAC6jRig.js} +1 -1
- package/dist/dashboard/public/assets/{send-CSgocT8I.js → send-BMUa6Mk3.js} +1 -1
- package/dist/dashboard/public/assets/{timer-CDc7JIAB.js → timer-C_-APDOe.js} +1 -1
- package/dist/dashboard/public/assets/{types-DqF5HlZi.js → types-DURmcDi7.js} +1 -1
- package/dist/dashboard/public/assets/{users-D9yOg5Si.js → users-bmUgjdas.js} +1 -1
- package/dist/dashboard/public/assets/{zap-QXV06WYA.js → zap-Dh3JmlTx.js} +1 -1
- package/dist/dashboard/public/index.html +2 -2
- package/package.json +4 -4
- package/dist/dashboard/public/assets/DashboardPage-Ck0F9Z12.js +0 -21
- package/dist/dashboard/public/assets/EntryDetailPage-C63KztnI.js +0 -27
- package/dist/dashboard/public/assets/EntrySearchInput-BNjSxfmZ.js +0 -1
- package/dist/dashboard/public/assets/GraphQLDetailView-BubeJCJT.js +0 -6
- package/dist/dashboard/public/assets/HttpClientDetailView-yb-3URIg.js +0 -1
- package/dist/dashboard/public/assets/LogDetailView--AEX1d6S.js +0 -1
- package/dist/dashboard/public/assets/PageHeader-Dhs9cPza.js +0 -1
- package/dist/dashboard/public/assets/QueriesPage-Df7S76B_.js +0 -1
- package/dist/dashboard/public/assets/RequestDetailView-D0pFJlIF.js +0 -1
- package/dist/dashboard/public/assets/index-ReuerEhs.css +0 -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-BhlJQ4dF.js","./vendor-DBTT3jXp.js","./date-Dwgqy666.js","./eye-8eLIbu7g.js","./zap-Dh3JmlTx.js","./calendar-FShGw2V4.js","./RequestsPage-Mv5Runje.js","./PageHeader-D7-C2JjI.js","./types-DURmcDi7.js","./timer-C_-APDOe.js","./EntrySearchInput-DgqVJlTJ.js","./search-DAC6jRig.js","./DataTable-DrEET9sA.js","./QueriesPage-C-I7oeYj.js","./ExceptionsPage-BIUcV_53.js","./circle-check-big-CPeNdziU.js","./LogsPage-CoAlZx-S.js","./EventsPage-CJ9p4LV5.js","./JobsPage-C5AitKVg.js","./CachePage--JS4eL4s.js","./MailPage-BnRl6UUD.js","./SchedulePage-B963z8i5.js","./format-BlNP-apw.js","./HttpClientPage-C4Rv5O1y.js","./RedisPage-DHm1OE6S.js","./ModelsPage-DLXRkTGa.js","./NotificationsPage-BfBTA56F.js","./ViewsPage-hxrXILl5.js","./CommandsPage-BwpLnQiJ.js","./GatesPage-CAlV9WUm.js","./BatchesPage-BArrHcRL.js","./DumpsPage-DywSvYlf.js","./GraphQLPage-CJoR0V6d.js","./EntryDetailPage-B_6RhOpQ.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Ce=Object.defineProperty;var Pe=(s,a,e)=>a in s?Ce(s,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[a]=e;var I=(s,a,e)=>Pe(s,typeof a!="symbol"?a+"":a,e);import{r as Re,a as Le,g as Te,b as r,u as De,L as M,O as Oe,R as Ae,c as p,N as Me,d as qe,B as $e}from"./vendor-DBTT3jXp.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const n of i.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function e(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(l){if(l.ep)return;l.ep=!0;const i=e(l);fetch(l.href,i)}})();var G={exports:{}},q={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|
|
@@ -358,4 +358,4 @@ to {
|
|
|
358
358
|
*
|
|
359
359
|
* This source code is licensed under the ISC license.
|
|
360
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const rs=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),we=()=>window.__NESTLENS_BASE__??"",ns=s=>`${window.location.origin}${we()}/__nestlens__${s}`,Se=ns("/api");class os extends Error{constructor(){super("This entry is no longer stored"),this.name="EntryGoneError"}}async function _(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw e.status===404?new os:new Error(`API error: ${e.status}`);return e.json()}async function Is(s){return _(`/entries/${s}`)}async function ce(){return _("/stats")}async function is(s){var i;const a=s?`?type=${encodeURIComponent(s)}`:"",e=await fetch(`${Se}/entries${a}`,{method:"DELETE"});if(!e.ok)throw new Error(`API error: ${e.status}`);const o=await e.json();if(o.success===!1)throw new Error(o.error??"The request was refused");const l=((i=o.data)==null?void 0:i.deleted)??0;return{success:!0,message:o.message??`Cleared ${l} entries`,deleted:l}}async function zs(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search),e.from&&a.set("from",e.from),e.to&&a.set("to",e.to),e.minDuration!==void 0&&a.set("minDuration",e.minDuration.toString()),e.maxDuration!==void 0&&a.set("maxDuration",e.maxDuration.toString())}return _(`/entries/cursor?${a.toString()}`)}async function Ks(s){const a=new URLSearchParams;return s&&a.set("type",s),_(`/entries/latest-sequence?${a.toString()}`)}async function Vs(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),_(`/entries/check-new?${e.toString()}`)}async function Fs(){return _("/storage/stats")}async function Bs(){return _("/pruning/status")}async function Hs(){return _("/pruning/run",{method:"POST"})}async function Gs(){return _("/tags/monitored")}async function Js(s){return _("/tags/monitored",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:s})})}async function Us(s){return _(`/tags/monitored/${encodeURIComponent(s)}`,{method:"DELETE"})}async function Ws(s,a){return _(`/tags/entry/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Qs(s,a){return _(`/tags/entry/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Zs(s){return _(`/entries/${s}/resolve`,{method:"PATCH"})}async function Xs(s){return _(`/entries/${s}/unresolve`,{method:"PATCH"})}async function ls(s){return _("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function cs(){return _("/recording/resume",{method:"POST"})}async function ds(){return _("/recording/status")}function us(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:m,preventDefault:y=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,h=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class Ee extends r.Component{constructor(){super(...arguments);I(this,"state",{hasError:!1});I(this,"handleReload",()=>{window.location.reload()});I(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(ve,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(ts,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}const Ne=r.createContext(void 0);function hs(){const s=r.useContext(Ne);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function de(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await ds();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await cs();a(i.data),A.success("Recording resumed")}else{const i=await ls();a(i.data),A.success("Recording paused")}}catch{A.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Yt,{className:"h-5 w-5"}):t.jsx(Xt,{className:"h-5 w-5"})}):null}const ue={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},he=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Jt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:qt,colorKey:"request"},{name:"Queries",href:"/queries",icon:Vt,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:Bt,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Ft,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:zt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:Kt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Qt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:as,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:It,colorKey:"redis"},{name:"Models",href:"/models",icon:Gt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Ht,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ut,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:$t,colorKey:"notification"},{name:"Events",href:"/events",icon:es,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Zt,colorKey:"view"},{name:"Gates",href:"/gates",icon:ss,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function me(s){return s!=="system"?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches}function ms(){const s=De(),[a,e]=r.useState(!1),{stats:o}=hs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[u,x]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),d=r.useCallback(h=>{i(w=>{const N=new Set(w);return N.has(h)?N.delete(h):N.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...N])),N})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),y=r.useCallback(h=>{const w=me(h);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";x(h),localStorage.setItem("nestlens-theme",h),y(h)},[n,y]),k=r.useCallback(async()=>{if(window.confirm("Are you sure you want to clear all entries?")){try{await is()}catch(h){A.error(`Could not clear entries: ${h instanceof Error?h.message:String(h)}`);return}A.success("All entries cleared"),window.location.reload()}},[]);return r.useEffect(()=>{const h=me(u);if(document.documentElement.classList.toggle("dark",h),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),N=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",N),()=>w.removeEventListener("change",N)}},[u]),us([{key:"k",ctrl:!0,handler:()=>k()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(rs,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(M,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(J,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.17.2"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-sm":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${C?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"flex-shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Wt,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Ee,{children:t.jsx(Oe,{})},s.pathname)})]})]})}function f(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const ps=r.lazy(()=>v(()=>import("./DashboardPage-Ck0F9Z12.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./RequestsPage-CSmOa0Pi.js"),__vite__mapDeps([6,1,2,7,8,9,10,11,12]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./QueriesPage-Df7S76B_.js"),__vite__mapDeps([13,1,2,7,8,9,10,11,12,4]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./ExceptionsPage-DJRQKir2.js"),__vite__mapDeps([14,1,2,7,8,9,10,11,12,15]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./LogsPage-BYUqINeg.js"),__vite__mapDeps([16,1,2,7,8,9,10,11,12]),import.meta.url)),js=r.lazy(()=>v(()=>import("./EventsPage--LGwQSIW.js"),__vite__mapDeps([17,1,2,7,8,9,12]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./JobsPage-BuCIb8wu.js"),__vite__mapDeps([18,1,2,7,8,9,12]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./CachePage-CU847w5_.js"),__vite__mapDeps([19,1,2,7,8,9,12]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./MailPage-n712tj0J.js"),__vite__mapDeps([20,1,2,7,8,9,12]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./SchedulePage-Brf1dEFU.js"),__vite__mapDeps([21,1,22,2,7,8,9,12]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./HttpClientPage-opI4zxU2.js"),__vite__mapDeps([23,1,2,7,8,9,12]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./RedisPage-BqyStSRQ.js"),__vite__mapDeps([24,1,2,7,8,9,12]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ModelsPage-BgXuFcOx.js"),__vite__mapDeps([25,1,2,7,8,9,12]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./NotificationsPage-eznKkQYP.js"),__vite__mapDeps([26,1,2,7,8,9,12]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./ViewsPage-ClbTUhv0.js"),__vite__mapDeps([27,1,2,7,8,9,12,3]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BbiQyAea.js"),__vite__mapDeps([28,1,2,7,8,9,12]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./GatesPage-CP3_e7g1.js"),__vite__mapDeps([29,1,2,7,8,9,12]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./BatchesPage-vFo0vIr2.js"),__vite__mapDeps([30,1,2,7,8,9,12]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./DumpsPage-nKkfeRGr.js"),__vite__mapDeps([31,1,2,7,8,9,12]),import.meta.url)),Ds=r.lazy(()=>v(()=>import("./GraphQLPage-BCr6tRBy.js"),__vite__mapDeps([32,1,2,10,11,7,8,9,12]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-C63KztnI.js").then(s=>s.E),__vite__mapDeps([33,1,2,8,11]),import.meta.url));function Os(){return t.jsx(Ae,{children:t.jsxs(p,{path:"/",element:t.jsx(ms,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ds,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Me,{to:"/",replace:!0})})]})})}const As=1e4;function Ms({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),i.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const m=d instanceof Error?d:new Error("Failed to fetch stats");l(m),console.error("Failed to fetch stats:",d),i.current&&A.error("Failed to load statistics"),i.current=!1},[]),x=r.useCallback(async()=>ce().then(d=>c(d.data),d=>u(d)),[c,u]);return r.useEffect(()=>{n.current=!0;const d=setInterval(()=>void x(),As);return ce().then(m=>c(m.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ne.Provider,{value:{stats:a,error:o,refreshStats:x},children:s})}const _e=document.getElementById("root");if(!_e)throw new Error("NestLens dashboard: no #root element in the served index.html");Fe.createRoot(_e).render(t.jsx(qe.StrictMode,{children:t.jsx(Ee,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ms,{children:[t.jsx(Os,{}),t.jsx(Lt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{qt as A,zt as B,Kt as C,Vt as D,os as E,Ft as F,Bt as G,ne as H,Qs as I,Ws as J,Ee as K,Gt as L,Ut as M,Is as N,Yt as O,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,Js as a,as as b,g as c,It as d,Ht as e,$t as f,Gs as g,Zt as h,ae as i,t as j,le as k,ts as l,Fs as m,Bs as n,Hs as o,zs as p,Xs as q,Us as r,Zs as s,ns as t,hs as u,Vs as v,Ks as w,se as x,is as y,A as z};
|
|
361
|
+
*/const rs=g("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),we=()=>window.__NESTLENS_BASE__??"",ns=s=>`${window.location.origin}${we()}/__nestlens__${s}`,Se=ns("/api");class os extends Error{constructor(){super("This entry is no longer stored"),this.name="EntryGoneError"}}async function _(s,a){const e=await fetch(`${Se}${s}`,a);if(!e.ok)throw e.status===404?new os:new Error(`API error: ${e.status}`);return e.json()}async function Is(s){return _(`/entries/${s}`)}async function ce(){return _("/stats")}async function is(s){var i;const a=s?`?type=${encodeURIComponent(s)}`:"",e=await fetch(`${Se}/entries${a}`,{method:"DELETE"});if(!e.ok)throw new Error(`API error: ${e.status}`);const o=await e.json();if(o.success===!1)throw new Error(o.error??"The request was refused");const l=((i=o.data)==null?void 0:i.deleted)??0;return{success:!0,message:o.message??`Cleared ${l} entries`,deleted:l}}async function zs(s){const a=new URLSearchParams;if(s.type&&a.set("type",s.type),s.limit&&a.set("limit",s.limit.toString()),s.beforeSequence!==void 0&&a.set("beforeSequence",s.beforeSequence.toString()),s.afterSequence!==void 0&&a.set("afterSequence",s.afterSequence.toString()),s.filters){const e=s.filters;e.levels&&e.levels.length>0&&a.set("levels",e.levels.join(",")),e.contexts&&e.contexts.length>0&&a.set("contexts",e.contexts.join(",")),e.queryTypes&&e.queryTypes.length>0&&a.set("queryTypes",e.queryTypes.join(",")),e.sources&&e.sources.length>0&&a.set("sources",e.sources.join(",")),e.slow!==void 0&&a.set("slow",e.slow.toString()),e.names&&e.names.length>0&&a.set("names",e.names.join(",")),e.methods&&e.methods.length>0&&a.set("methods",e.methods.join(",")),e.paths&&e.paths.length>0&&a.set("paths",e.paths.join(",")),e.resolved!==void 0&&a.set("resolved",e.resolved.toString()),e.statuses&&e.statuses.length>0&&a.set("statuses",e.statuses.join(",")),e.hostnames&&e.hostnames.length>0&&a.set("hostnames",e.hostnames.join(",")),e.controllers&&e.controllers.length>0&&a.set("controllers",e.controllers.join(",")),e.ips&&e.ips.length>0&&a.set("ips",e.ips.join(",")),e.eventNames&&e.eventNames.length>0&&a.set("eventNames",e.eventNames.join(",")),e.scheduleStatuses&&e.scheduleStatuses.length>0&&a.set("scheduleStatuses",e.scheduleStatuses.join(",")),e.scheduleNames&&e.scheduleNames.length>0&&a.set("scheduleNames",e.scheduleNames.join(",")),e.jobStatuses&&e.jobStatuses.length>0&&a.set("jobStatuses",e.jobStatuses.join(",")),e.jobNames&&e.jobNames.length>0&&a.set("jobNames",e.jobNames.join(",")),e.queues&&e.queues.length>0&&a.set("queues",e.queues.join(",")),e.cacheOperations&&e.cacheOperations.length>0&&a.set("cacheOperations",e.cacheOperations.join(",")),e.mailStatuses&&e.mailStatuses.length>0&&a.set("mailStatuses",e.mailStatuses.join(",")),e.redisStatuses&&e.redisStatuses.length>0&&a.set("redisStatuses",e.redisStatuses.join(",")),e.redisCommands&&e.redisCommands.length>0&&a.set("redisCommands",e.redisCommands.join(",")),e.modelActions&&e.modelActions.length>0&&a.set("modelActions",e.modelActions.join(",")),e.entities&&e.entities.length>0&&a.set("entities",e.entities.join(",")),e.modelSources&&e.modelSources.length>0&&a.set("modelSources",e.modelSources.join(",")),e.notificationTypes&&e.notificationTypes.length>0&&a.set("notificationTypes",e.notificationTypes.join(",")),e.notificationStatuses&&e.notificationStatuses.length>0&&a.set("notificationStatuses",e.notificationStatuses.join(",")),e.viewFormats&&e.viewFormats.length>0&&a.set("viewFormats",e.viewFormats.join(",")),e.viewStatuses&&e.viewStatuses.length>0&&a.set("viewStatuses",e.viewStatuses.join(",")),e.commandStatuses&&e.commandStatuses.length>0&&a.set("commandStatuses",e.commandStatuses.join(",")),e.commandNames&&e.commandNames.length>0&&a.set("commandNames",e.commandNames.join(",")),e.gateNames&&e.gateNames.length>0&&a.set("gateNames",e.gateNames.join(",")),e.gateResults&&e.gateResults.length>0&&a.set("gateResults",e.gateResults.join(",")),e.batchStatuses&&e.batchStatuses.length>0&&a.set("batchStatuses",e.batchStatuses.join(",")),e.batchOperations&&e.batchOperations.length>0&&a.set("batchOperations",e.batchOperations.join(",")),e.dumpStatuses&&e.dumpStatuses.length>0&&a.set("dumpStatuses",e.dumpStatuses.join(",")),e.dumpOperations&&e.dumpOperations.length>0&&a.set("dumpOperations",e.dumpOperations.join(",")),e.dumpFormats&&e.dumpFormats.length>0&&a.set("dumpFormats",e.dumpFormats.join(",")),e.operationTypes&&e.operationTypes.length>0&&a.set("operationTypes",e.operationTypes.join(",")),e.operationNames&&e.operationNames.length>0&&a.set("operationNames",e.operationNames.join(",")),e.hasErrors!==void 0&&a.set("hasErrors",e.hasErrors.toString()),e.hasN1!==void 0&&a.set("hasN1",e.hasN1.toString()),e.tags&&e.tags.length>0&&a.set("tags",e.tags.join(",")),e.search&&a.set("search",e.search),e.from&&a.set("from",e.from),e.to&&a.set("to",e.to),e.minDuration!==void 0&&a.set("minDuration",e.minDuration.toString()),e.maxDuration!==void 0&&a.set("maxDuration",e.maxDuration.toString())}return _(`/entries/cursor?${a.toString()}`)}async function Ks(s){const a=new URLSearchParams;return s&&a.set("type",s),_(`/entries/latest-sequence?${a.toString()}`)}async function Vs(s,a){const e=new URLSearchParams;return e.set("afterSequence",s.toString()),a&&e.set("type",a),_(`/entries/check-new?${e.toString()}`)}async function Fs(){return _("/storage/stats")}async function Bs(){return _("/pruning/status")}async function Hs(){return _("/pruning/run",{method:"POST"})}async function Gs(){return _("/tags/monitored")}async function Js(s){return _("/tags/monitored",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag:s})})}async function Us(s){return _(`/tags/monitored/${encodeURIComponent(s)}`,{method:"DELETE"})}async function Ws(s,a){return _(`/tags/entry/${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Qs(s,a){return _(`/tags/entry/${s}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({tags:a})})}async function Zs(s){return _(`/entries/${s}/resolve`,{method:"PATCH"})}async function Xs(s){return _(`/entries/${s}/unresolve`,{method:"PATCH"})}async function ls(s){return _("/recording/pause",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:s})})}async function cs(){return _("/recording/resume",{method:"POST"})}async function ds(){return _("/recording/status")}function us(s){const a=r.useCallback(e=>{const o=e.target,l=o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.isContentEditable;for(const i of s){const{key:n,ctrl:c,meta:u,shift:x,alt:d,handler:m,preventDefault:y=!0}=i;if(l&&n.toLowerCase()!=="escape")continue;const j=e.key.toLowerCase()===n.toLowerCase(),k=x?e.shiftKey:!e.shiftKey,h=d?e.altKey:!e.altKey;if(c){if((e.ctrlKey||e.metaKey)&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(u){if(e.metaKey&&!e.ctrlKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}continue}if(!e.ctrlKey&&!e.metaKey&&j&&k&&h){y&&e.preventDefault(),m(e);return}}},[s]);r.useEffect(()=>(document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a)}),[a])}class Ee extends r.Component{constructor(){super(...arguments);I(this,"state",{hasError:!1});I(this,"handleReload",()=>{window.location.reload()});I(this,"handleReset",()=>{this.setState({hasError:!1,error:void 0,errorInfo:void 0})})}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,o){console.error("ErrorBoundary caught an error:",e,o),this.setState({errorInfo:o})}render(){return this.state.hasError?this.props.fallback?this.props.fallback:t.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 dark:bg-gray-900 p-4",children:t.jsxs("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6 text-center",children:[t.jsx("div",{className:"mx-auto w-12 h-12 flex items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30 mb-4",children:t.jsx(ve,{className:"h-6 w-6 text-red-600 dark:text-red-400"})}),t.jsx("h1",{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:"Something went wrong"}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"An unexpected error occurred. Please try refreshing the page."}),this.state.error&&t.jsx("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-lg text-left",children:t.jsx("p",{className:"text-sm font-mono text-red-600 dark:text-red-400 break-all",children:this.state.error.message})}),t.jsxs("div",{className:"flex gap-3 justify-center",children:[t.jsx("button",{onClick:this.handleReset,className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors",children:"Try Again"}),t.jsxs("button",{onClick:this.handleReload,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 rounded-lg transition-colors",children:[t.jsx(ts,{className:"h-4 w-4"}),"Refresh Page"]})]}),!1]})}):this.props.children}}const Ne=r.createContext(void 0);function hs(){const s=r.useContext(Ne);if(s===void 0)throw new Error("useStats must be used within a StatsProvider");return s}function de(){const[s,a]=r.useState(null),[e,o]=r.useState(!1);r.useEffect(()=>{const i=async()=>{try{const c=await ds();a(c.data)}catch(c){console.error("Failed to fetch recording status:",c)}};i();const n=setInterval(i,5e3);return()=>clearInterval(n)},[]);const l=async()=>{if(!(!s||e)){o(!0);try{if(s.isPaused){const i=await cs();a(i.data),A.success("Recording resumed")}else{const i=await ls();a(i.data),A.success("Recording paused")}}catch{A.error("Failed to toggle recording")}finally{o(!1)}}};return s?t.jsx("button",{onClick:l,disabled:e,className:`p-2.5 rounded-lg transition-colors ${s.isPaused?"text-yellow-600 hover:text-yellow-700 dark:text-yellow-400 dark:hover:text-yellow-300 hover:bg-yellow-50 dark:hover:bg-yellow-900/20":"text-green-600 hover:text-green-700 dark:text-green-400 dark:hover:text-green-300 hover:bg-green-50 dark:hover:bg-green-900/20"} ${e?"opacity-50 cursor-not-allowed":""}`,"aria-label":s.isPaused?"Resume recording":"Pause recording",title:s.isPaused?"Resume Recording":"Pause Recording",children:s.isPaused?t.jsx(Yt,{className:"h-5 w-5"}):t.jsx(Xt,{className:"h-5 w-5"})}):null}const ue={dashboard:"text-primary-500",request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",job:"text-yellow-500",schedule:"text-gray-500",batch:"text-lime-500",command:"text-slate-500",cache:"text-cyan-500",redis:"text-rose-500",model:"text-violet-500","http-client":"text-indigo-500",mail:"text-pink-500",notification:"text-orange-500",event:"text-emerald-500",view:"text-teal-500",gate:"text-amber-500",dump:"text-stone-500"},he=[{name:"Overview",items:[{name:"Dashboard",href:"/",icon:Jt,colorKey:"dashboard"}]},{name:"Core",items:[{name:"Requests",href:"/requests",icon:qt,colorKey:"request"},{name:"Queries",href:"/queries",icon:Vt,colorKey:"query"},{name:"GraphQL",href:"/graphql",icon:Bt,colorKey:"graphql"},{name:"Exceptions",href:"/exceptions",icon:ve,badge:"exceptions",colorKey:"exception"},{name:"Logs",href:"/logs",icon:Ft,colorKey:"log"}]},{name:"Background",items:[{name:"Jobs",href:"/jobs",icon:zt,colorKey:"job"},{name:"Schedule",href:"/schedule",icon:Kt,colorKey:"schedule"},{name:"Batches",href:"/batches",icon:Qt,colorKey:"batch"},{name:"Commands",href:"/commands",icon:as,colorKey:"command"}]},{name:"Data",items:[{name:"Cache",href:"/cache",icon:ne,colorKey:"cache"},{name:"Redis",href:"/redis",icon:It,colorKey:"redis"},{name:"Models",href:"/models",icon:Gt,colorKey:"model"}]},{name:"Communication",items:[{name:"HTTP Client",href:"/http-client",icon:Ht,colorKey:"http-client"},{name:"Mail",href:"/mail",icon:Ut,colorKey:"mail"},{name:"Notifications",href:"/notifications",icon:$t,colorKey:"notification"},{name:"Events",href:"/events",icon:es,colorKey:"event"}]},{name:"System",items:[{name:"Views",href:"/views",icon:Zt,colorKey:"view"},{name:"Gates",href:"/gates",icon:ss,colorKey:"gate"},{name:"Dumps",href:"/dumps",icon:ne,colorKey:"dump"}]}];function me(s){return s!=="system"?s==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches}function ms(){const s=De(),[a,e]=r.useState(!1),{stats:o}=hs(),[l,i]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-collapsed-groups");return h?new Set(JSON.parse(h)):new Set}return new Set}),[n,c]=r.useState(()=>typeof window<"u"?document.documentElement.classList.contains("dark"):!1),[u,x]=r.useState(()=>{if(typeof window<"u"){const h=localStorage.getItem("nestlens-theme");if(h==="system"||h==="light"||h==="dark")return h}return"system"}),d=r.useCallback(h=>{i(w=>{const N=new Set(w);return N.has(h)?N.delete(h):N.add(h),localStorage.setItem("nestlens-collapsed-groups",JSON.stringify([...N])),N})},[]),m=r.useCallback(h=>{if(!o)return 0;switch(h){case"exceptions":return o.unresolvedExceptions??o.byType.exception??0;default:return 0}},[o]),y=r.useCallback(h=>{const w=me(h);w?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),c(w)},[]),j=r.useCallback(()=>{const h=n?"light":"dark";x(h),localStorage.setItem("nestlens-theme",h),y(h)},[n,y]),k=r.useCallback(async()=>{if(window.confirm("Are you sure you want to clear all entries?")){try{await is()}catch(h){A.error(`Could not clear entries: ${h instanceof Error?h.message:String(h)}`);return}A.success("All entries cleared"),window.location.reload()}},[]);return r.useEffect(()=>{const h=me(u);if(document.documentElement.classList.toggle("dark",h),u==="system"){const w=window.matchMedia("(prefers-color-scheme: dark)"),N=b=>{document.documentElement.classList.toggle("dark",b.matches),c(b.matches)};return w.addEventListener("change",N),()=>w.removeEventListener("change",N)}},[u]),us([{key:"k",ctrl:!0,handler:()=>k()},{key:"Escape",handler:()=>{a&&e(!1)},preventDefault:!1},{key:"d",ctrl:!0,handler:()=>j()}]),t.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[t.jsxs("div",{className:`fixed inset-0 z-50 lg:hidden ${a?"":"hidden"}`,children:[t.jsx("div",{className:"fixed inset-0 bg-gray-900/80",onClick:()=>e(!1)}),t.jsxs("div",{id:"mobile-sidebar","data-testid":"mobile-sidebar",className:"fixed inset-y-0 left-0 w-64 bg-white dark:bg-gray-800 flex flex-col",children:[t.jsxs("div",{className:"flex h-16 items-center justify-between px-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-8 w-8 text-primary-600"}),t.jsx("span",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"NestLens"})]}),t.jsx("button",{onClick:()=>e(!1),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-label":"Close sidebar",children:t.jsx(rs,{className:"h-6 w-6","aria-hidden":"true"})})]}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-4":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-xs font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-colors ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"}`,onClick:()=>e(!1),children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-4 w-4 ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:"inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-medium bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400 rounded-full",children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})]}),t.jsx("div",{"data-testid":"sidebar",className:"hidden lg:fixed lg:inset-y-0 lg:flex lg:w-64 lg:flex-col",children:t.jsxs("div",{className:"flex flex-col h-full bg-white dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:[t.jsx("div",{className:"flex h-16 items-center px-4 border-b border-gray-200 dark:border-gray-700",children:t.jsxs(M,{to:"/",className:"flex items-center space-x-2.5",children:[t.jsx("div",{className:"p-1.5 bg-primary-100 dark:bg-primary-900/50 rounded-lg",children:t.jsx(J,{className:"h-6 w-6 text-primary-600 dark:text-primary-400"})}),t.jsxs("div",{children:[t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"}),t.jsxs("span",{className:"hidden xl:inline text-xs text-gray-400 dark:text-gray-500 ml-1.5",children:["v","0.18.0"]})]})]})}),t.jsx("nav",{className:"flex-1 min-h-0 overflow-y-auto py-4 px-3",children:he.map((h,w)=>{const N=l.has(h.name);return t.jsxs("div",{className:w>0?"mt-6":"",children:[t.jsxs("button",{onClick:()=>d(h.name),className:"flex items-center justify-between w-full px-2 py-1.5 text-[11px] font-semibold text-gray-400 dark:text-gray-500 uppercase tracking-wider hover:text-gray-600 dark:hover:text-gray-400 transition-colors","aria-expanded":!N,"aria-controls":`desktop-nav-group-${h.name.toLowerCase().replace(/\s+/g,"-")}`,children:[t.jsx("span",{children:h.name}),N?t.jsx(ae,{className:"h-3 w-3","aria-hidden":"true"}):t.jsx(se,{className:"h-3 w-3","aria-hidden":"true"})]}),!N&&t.jsx("div",{className:"mt-1 space-y-0.5",children:h.items.map(b=>{const C=b.href==="/"?s.pathname==="/":s.pathname.startsWith(b.href),P="badge"in b?m(b.badge):0;return t.jsxs(M,{to:b.href,"aria-current":C?"page":void 0,className:`group flex items-center justify-between px-3 py-2 rounded-lg transition-all duration-150 ${C?"bg-primary-50 text-primary-700 dark:bg-primary-900/50 dark:text-primary-200 font-medium shadow-xs":"text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800/50 hover:text-gray-900 dark:hover:text-white"}`,children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(b.icon,{className:`h-[18px] w-[18px] ${ue[b.colorKey]||"text-gray-400"}`}),t.jsx("span",{className:"text-sm",children:b.name})]}),P>0&&t.jsx("span",{className:`inline-flex items-center justify-center min-w-[20px] h-5 px-1.5 text-xs font-semibold rounded-full transition-colors ${C?"bg-primary-200 text-primary-800 dark:bg-primary-800 dark:text-primary-200":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-400"}`,children:P>99?"99+":P})]},b.name)})})]},h.name)})}),t.jsx("div",{className:"shrink-0 p-3 border-t border-gray-200 dark:border-gray-700",children:t.jsxs("div",{className:"flex items-center justify-center gap-1",children:[t.jsx(de,{}),t.jsx("button",{onClick:j,className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":n?"Switch to light mode":"Switch to dark mode",title:n?"Light Mode (⌘D)":"Dark Mode (⌘D)",children:n?t.jsx(ie,{className:"h-5 w-5"}):t.jsx(oe,{className:"h-5 w-5"})}),t.jsx("button",{onClick:k,className:"p-2.5 text-gray-500 hover:text-red-600 dark:text-gray-400 dark:hover:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded-lg transition-colors","aria-label":"Clear all data",title:"Clear All Data (⌘K)",children:t.jsx(le,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://github.com/mogretici/nestlens",target:"_blank",rel:"noopener noreferrer",className:"p-2.5 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors","aria-label":"Documentation",title:"Documentation",children:t.jsx(re,{className:"h-5 w-5"})})]})})]})}),t.jsxs("div",{className:"lg:pl-64",children:[t.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-4 border-b border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-4 lg:hidden",children:[t.jsx("button",{onClick:()=>e(!0),className:"text-gray-500 hover:text-gray-700 dark:text-gray-400","aria-expanded":a,"aria-controls":"mobile-sidebar","aria-label":"Open navigation menu",children:t.jsx(Wt,{className:"h-6 w-6","aria-hidden":"true"})}),t.jsxs(M,{to:"/",className:"flex items-center space-x-2",children:[t.jsx(J,{className:"h-6 w-6 text-primary-600"}),t.jsx("span",{className:"text-lg font-bold text-gray-900 dark:text-white",children:"NestLens"})]})]}),t.jsx("main",{className:"p-4 lg:p-6",children:t.jsx(Ee,{children:t.jsx(Oe,{})},s.pathname)})]})]})}function f(){return t.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:t.jsxs("div",{className:"flex flex-col items-center gap-3",children:[t.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-primary-600 dark:border-primary-400"}),t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Loading..."})]})})}const ps=r.lazy(()=>v(()=>import("./DashboardPage-BhlJQ4dF.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),xs=r.lazy(()=>v(()=>import("./RequestsPage-Mv5Runje.js"),__vite__mapDeps([6,1,2,7,8,9,10,11,12]),import.meta.url)),fs=r.lazy(()=>v(()=>import("./QueriesPage-C-I7oeYj.js"),__vite__mapDeps([13,1,2,7,8,9,10,11,12,4]),import.meta.url)),ys=r.lazy(()=>v(()=>import("./ExceptionsPage-BIUcV_53.js"),__vite__mapDeps([14,1,2,7,8,9,10,11,12,15]),import.meta.url)),gs=r.lazy(()=>v(()=>import("./LogsPage-CoAlZx-S.js"),__vite__mapDeps([16,1,2,7,8,9,10,11,12]),import.meta.url)),js=r.lazy(()=>v(()=>import("./EventsPage-CJ9p4LV5.js"),__vite__mapDeps([17,1,2,7,8,9,12]),import.meta.url)),bs=r.lazy(()=>v(()=>import("./JobsPage-C5AitKVg.js"),__vite__mapDeps([18,1,2,7,8,9,12]),import.meta.url)),ks=r.lazy(()=>v(()=>import("./CachePage--JS4eL4s.js"),__vite__mapDeps([19,1,2,7,8,9,12]),import.meta.url)),vs=r.lazy(()=>v(()=>import("./MailPage-BnRl6UUD.js"),__vite__mapDeps([20,1,2,7,8,9,12]),import.meta.url)),ws=r.lazy(()=>v(()=>import("./SchedulePage-B963z8i5.js"),__vite__mapDeps([21,1,22,2,7,8,9,12]),import.meta.url)),Ss=r.lazy(()=>v(()=>import("./HttpClientPage-C4Rv5O1y.js"),__vite__mapDeps([23,1,2,7,8,9,12]),import.meta.url)),Es=r.lazy(()=>v(()=>import("./RedisPage-DHm1OE6S.js"),__vite__mapDeps([24,1,2,7,8,9,12]),import.meta.url)),Ns=r.lazy(()=>v(()=>import("./ModelsPage-DLXRkTGa.js"),__vite__mapDeps([25,1,2,7,8,9,12]),import.meta.url)),_s=r.lazy(()=>v(()=>import("./NotificationsPage-BfBTA56F.js"),__vite__mapDeps([26,1,2,7,8,9,12]),import.meta.url)),Cs=r.lazy(()=>v(()=>import("./ViewsPage-hxrXILl5.js"),__vite__mapDeps([27,1,2,7,8,9,12,3]),import.meta.url)),Ps=r.lazy(()=>v(()=>import("./CommandsPage-BwpLnQiJ.js"),__vite__mapDeps([28,1,2,7,8,9,12]),import.meta.url)),Rs=r.lazy(()=>v(()=>import("./GatesPage-CAlV9WUm.js"),__vite__mapDeps([29,1,2,7,8,9,12]),import.meta.url)),Ls=r.lazy(()=>v(()=>import("./BatchesPage-BArrHcRL.js"),__vite__mapDeps([30,1,2,7,8,9,12]),import.meta.url)),Ts=r.lazy(()=>v(()=>import("./DumpsPage-DywSvYlf.js"),__vite__mapDeps([31,1,2,7,8,9,12]),import.meta.url)),Ds=r.lazy(()=>v(()=>import("./GraphQLPage-CJoR0V6d.js"),__vite__mapDeps([32,1,2,10,11,7,8,9,12]),import.meta.url)),S=r.lazy(()=>v(()=>import("./EntryDetailPage-B_6RhOpQ.js").then(s=>s.E),__vite__mapDeps([33,1,2,8,11]),import.meta.url));function Os(){return t.jsx(Ae,{children:t.jsxs(p,{path:"/",element:t.jsx(ms,{}),children:[t.jsx(p,{index:!0,element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ps,{})})}),t.jsx(p,{path:"requests",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(xs,{})})}),t.jsx(p,{path:"queries",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(fs,{})})}),t.jsx(p,{path:"exceptions",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ys,{})})}),t.jsx(p,{path:"logs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(gs,{})})}),t.jsx(p,{path:"events",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(js,{})})}),t.jsx(p,{path:"jobs",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(bs,{})})}),t.jsx(p,{path:"cache",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ks,{})})}),t.jsx(p,{path:"mail",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(vs,{})})}),t.jsx(p,{path:"schedule",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(ws,{})})}),t.jsx(p,{path:"http-client",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ss,{})})}),t.jsx(p,{path:"redis",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Es,{})})}),t.jsx(p,{path:"models",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ns,{})})}),t.jsx(p,{path:"notifications",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(_s,{})})}),t.jsx(p,{path:"views",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Cs,{})})}),t.jsx(p,{path:"commands",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ps,{})})}),t.jsx(p,{path:"gates",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Rs,{})})}),t.jsx(p,{path:"batches",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ls,{})})}),t.jsx(p,{path:"dumps",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ts,{})})}),t.jsx(p,{path:"graphql",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(Ds,{})})}),t.jsx(p,{path:"requests/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"queries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"exceptions/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"logs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"events/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"jobs/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"cache/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"mail/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"schedule/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"http-client/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"redis/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"models/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"notifications/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"views/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"commands/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"gates/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"batches/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"dumps/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"graphql/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"entries/:id",element:t.jsx(r.Suspense,{fallback:t.jsx(f,{}),children:t.jsx(S,{})})}),t.jsx(p,{path:"*",element:t.jsx(Me,{to:"/",replace:!0})})]})})}const As=1e4;function Ms({children:s}){const[a,e]=r.useState(null),[o,l]=r.useState(null),i=r.useRef(!0),n=r.useRef(!0),c=r.useCallback(d=>{n.current&&(e(d),l(null),i.current=!1)},[]),u=r.useCallback(d=>{if(!n.current)return;const m=d instanceof Error?d:new Error("Failed to fetch stats");l(m),console.error("Failed to fetch stats:",d),i.current&&A.error("Failed to load statistics"),i.current=!1},[]),x=r.useCallback(async()=>ce().then(d=>c(d.data),d=>u(d)),[c,u]);return r.useEffect(()=>{n.current=!0;const d=setInterval(()=>void x(),As);return ce().then(m=>c(m.data),u),()=>{n.current=!1,clearInterval(d)}},[x,c,u]),t.jsx(Ne.Provider,{value:{stats:a,error:o,refreshStats:x},children:s})}const _e=document.getElementById("root");if(!_e)throw new Error("NestLens dashboard: no #root element in the served index.html");Fe.createRoot(_e).render(t.jsx(qe.StrictMode,{children:t.jsx(Ee,{children:t.jsx($e,{basename:we(),children:t.jsxs(Ms,{children:[t.jsx(Os,{}),t.jsx(Lt,{position:"bottom-right",toastOptions:{duration:3e3,style:{background:"#1f2937",color:"#f3f4f6",borderRadius:"0.5rem"},success:{iconTheme:{primary:"#10b981",secondary:"#f3f4f6"}},error:{iconTheme:{primary:"#ef4444",secondary:"#f3f4f6"}}}})]})})})}));export{qt as A,zt as B,Kt as C,Vt as D,os as E,Ft as F,Bt as G,ne as H,Qs as I,Ws as J,Ee as K,Gt as L,Ut as M,Is as N,Yt as O,Qt as P,es as R,ss as S,ve as T,rs as X,v as _,Js as a,as as b,g as c,It as d,Ht as e,$t as f,Gs as g,Zt as h,ae as i,t as j,le as k,ts as l,Fs as m,Bs as n,Hs as o,zs as p,Xs as q,Us as r,Zs as s,ns as t,hs as u,Vs as v,Ks as w,se as x,is as y,A as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as E}from"./index-CNTaNUkj.js";import{f as D,b as d,e as C,u as L}from"./vendor-DBTT3jXp.js";import{g as R,h as w}from"./date-Dwgqy666.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",measuresDuration:!0,filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",measuresDuration:!1,filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",measuresDuration:!1,filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",measuresDuration:!0,filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",measuresDuration:!0,filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",measuresDuration:!0,filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",measuresDuration:!0,filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",measuresDuration:!0,filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",measuresDuration:!0,filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",measuresDuration:!0,filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",measuresDuration:!0,filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",measuresDuration:!0,filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",measuresDuration:!0,filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",measuresDuration:!0,filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",measuresDuration:!0,filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},q={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function k(e){if(e in T)return T[e];const s=q[e];if(s)return T[s]}const x=k;function B(e){const[s,i]=D(),a=x(e),c=d.useCallback(r=>{if(r==="tags")return"tags";if(!a)return r;const t=a.filters[r];return(t==null?void 0:t.urlKey)||r},[a]),o=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(u=>u.urlKey);t.push("tags","search");for(const u of t){const n=s.get(u);n&&(r[u]=n.split(",").filter(Boolean))}return r},[s,a]),N=d.useCallback((r,t)=>{!a&&r!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const u=c(r),n=o[u]||[];if(!n.includes(t)){const l=new URLSearchParams(s);l.set(u,[...n,t].join(",")),i(l,{replace:!0})}},[a,c,o,s,i]),p=d.useCallback((r,t)=>{const n=(o[r]||[]).filter(f=>f!==t),l=new URLSearchParams(s);n.length>0?l.set(r,n.join(",")):l.delete(r),i(l,{replace:!0})},[o,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>o,[o]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,u]of Object.entries(o)){if(u.length===0)continue;let n=t,l=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,l=h.displayName;break}r.push({category:n,urlKey:t,displayName:l,values:u})}return r},[o,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const u of t.values)r.push({category:t.displayName,value:u.toUpperCase(),onRemove:()=>p(t.urlKey,u)});return r},[y,p]),K=y.length>0;return{addFilter:N,removeFilter:p,clearAll:S,serverFilters:g,activeFilters:y,headerFilters:m,hasFilters:K,getUrlKey:c}}function O(e,s){if(s==="tags")return"tags";const i=x(e);if(!i)return s;const a=i.filters[s];return(a==null?void 0:a.urlKey)||s}const M=["localhost"],A=(e,s)=>{if(s&&s!=="tag")return s;if(/^user:/i.test(e))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return"ips";const i=e.toUpperCase();if(w.includes(i))return"methods";const a=parseInt(e,10);return!isNaN(a)&&a>=100&&a<600?"statuses":/^[a-fA-F0-9:]+$/.test(e)&&e.includes(":")&&!e.includes(".")?"ips":e.includes("#")||e.includes("::")||/Controller\./i.test(e)?"controllers":M.includes(e.toLowerCase())||(e.includes(".")||e.includes(":"))&&!e.startsWith("/")&&!/^\d+$/.test(e)?"hostnames":"tags"};function H({children:e,listType:s,filterType:i="tag",filterValue:a,onClick:c,clickable:o=!0,className:N="",ariaLabel:p}){const S=C(),g=L(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&o){const l=a||String(e),f=i&&i!=="tag"?O(s,i):A(l,i),h=g.pathname,v=h===`/${s}`||h.startsWith(`/${s}/`)?new URLSearchParams(g.search):new URLSearchParams,b=v.get(f);if(b){const P=b.split(",");P.includes(l)||v.set(f,[...P,l].join(","))}else v.set(f,l);S(`/${s}?${v.toString()}`)}},m=o&&(!!c||!!s),K=R(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),u=p||(m?`Click to filter by ${t}`:void 0);return E.jsx("span",{onClick:m?y:void 0,role:m?"button":void 0,"aria-label":u,tabIndex:m?0:void 0,onKeyDown:m?n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),y(n))}:void 0,title:t,className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow ${K} ${r} ${m?"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${N}`,children:t})}function I({items:e,listType:s,filterType:i="tag",maxItems:a=99,clickable:c=!0}){if(!e||e.length===0)return null;const o=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(p=>E.jsx(H,{listType:s,filterType:i,clickable:c,children:p},p)),N>0&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",N]})]})}function $(e){return e.type==="request"}function Q(e){return e.type==="query"}function V(e){return e.type==="exception"}function z(e){return e.type==="log"}function J(e){return e.type==="cache"}function Y(e){return e.type==="event"}function Z(e){return e.type==="job"}function _(e){return e.type==="schedule"}function W(e){return e.type==="mail"}function X(e){return e.type==="http-client"}function ee(e){return e.type==="redis"}function se(e){return e.type==="model"}function te(e){return e.type==="notification"}function ae(e){return e.type==="view"}function re(e){return e.type==="command"}function ne(e){return e.type==="gate"}function ie(e){return e.type==="batch"}function ue(e){return e.type==="dump"}function le(e){return e.type==="graphql"}export{I as B,H as C,Q as a,V as b,z as c,Y as d,Z as e,J as f,W as g,_ as h,$ as i,X as j,ee as k,se as l,te as m,ae as n,re as o,ne as p,ie as q,ue as r,le as s,x as t,B as u};
|
|
1
|
+
import{j as E}from"./index-CQsXkVIl.js";import{f as D,b as d,e as C,u as L}from"./vendor-DBTT3jXp.js";import{g as R,h as w}from"./date-Dwgqy666.js";const T={request:{displayName:"Request",pluralName:"Requests",route:"requests",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","GRAPHQL"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},paths:{urlKey:"paths",displayName:"Path",values:[]},controllers:{urlKey:"controllers",displayName:"Controller",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}},query:{displayName:"Query",pluralName:"Queries",route:"queries",icon:"Database",measuresDuration:!0,filters:{types:{urlKey:"queryTypes",displayName:"Type",values:["SELECT","INSERT","UPDATE","DELETE","CREATE","ALTER","DROP","TRUNCATE"]},sources:{urlKey:"sources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","knex","mikro-orm","drizzle"]}}},exception:{displayName:"Exception",pluralName:"Exceptions",route:"exceptions",icon:"AlertTriangle",measuresDuration:!1,filters:{names:{urlKey:"names",displayName:"Name",values:[]},methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},paths:{urlKey:"paths",displayName:"Path",values:[]}}},log:{displayName:"Log",pluralName:"Logs",route:"logs",icon:"FileText",measuresDuration:!1,filters:{levels:{urlKey:"levels",displayName:"Level",values:["log","error","warn","debug","verbose","fatal","info"]},contexts:{urlKey:"contexts",displayName:"Context",values:[]}}},event:{displayName:"Event",pluralName:"Events",route:"events",icon:"Zap",measuresDuration:!0,filters:{names:{urlKey:"eventNames",displayName:"Event",values:[]}}},job:{displayName:"Job",pluralName:"Jobs",route:"jobs",icon:"Briefcase",measuresDuration:!0,filters:{names:{urlKey:"jobNames",displayName:"Job",values:[]},statuses:{urlKey:"jobStatuses",displayName:"Status",values:["waiting","active","completed","failed","delayed","paused","stuck"]},queues:{urlKey:"queues",displayName:"Queue",values:[]}}},schedule:{displayName:"Schedule",pluralName:"Schedule",route:"schedule",icon:"Clock",measuresDuration:!0,filters:{names:{urlKey:"scheduleNames",displayName:"Task",values:[]},statuses:{urlKey:"scheduleStatuses",displayName:"Status",values:["started","completed","failed","skipped","running"]}}},cache:{displayName:"Cache",pluralName:"Cache",route:"cache",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"cacheOperations",displayName:"Operation",values:["get","set","del","clear","has","reset","mget","mset"]}}},mail:{displayName:"Mail",pluralName:"Mail",route:"mail",icon:"Mail",measuresDuration:!0,filters:{statuses:{urlKey:"mailStatuses",displayName:"Status",values:["sent","failed","pending","queued","delivered","bounced","error"]}}},"http-client":{displayName:"HTTP Client",pluralName:"HTTP Client",route:"http-client",icon:"Globe",measuresDuration:!0,filters:{methods:{urlKey:"methods",displayName:"Method",values:["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},hostnames:{urlKey:"hostnames",displayName:"Hostname",values:[]}}},redis:{displayName:"Redis",pluralName:"Redis",route:"redis",icon:"Database",measuresDuration:!0,filters:{commands:{urlKey:"redisCommands",displayName:"Command",values:["GET","SET","DEL","HGET","HSET","HDEL","HGETALL","LPUSH","RPUSH","LPOP","RPOP","LRANGE","SADD","SREM","SMEMBERS","ZADD","ZRANGE","ZREM","EXPIRE","TTL","KEYS","SCAN","PING","INFO","INCR","DECR","MGET","MSET","PUBLISH","SUBSCRIBE"]},statuses:{urlKey:"redisStatuses",displayName:"Status",values:["success","failed","error","timeout"]}}},model:{displayName:"Model",pluralName:"Models",route:"models",icon:"Box",measuresDuration:!0,filters:{actions:{urlKey:"modelActions",displayName:"Action",values:["find","findOne","findMany","create","update","delete","save","remove","count","aggregate","upsert","createMany","updateMany","deleteMany"]},entities:{urlKey:"entities",displayName:"Entity",values:[]},sources:{urlKey:"modelSources",displayName:"Source",values:["typeorm","prisma","mongoose","sequelize","mikro-orm","drizzle"]}}},notification:{displayName:"Notification",pluralName:"Notifications",route:"notifications",icon:"Bell",measuresDuration:!0,filters:{types:{urlKey:"notificationTypes",displayName:"Type",values:["email","sms","push","socket","webhook","slack","telegram","discord"]},statuses:{urlKey:"notificationStatuses",displayName:"Status",values:["sent","failed","pending","delivered","read","error","queued"]}}},view:{displayName:"View",pluralName:"Views",route:"views",icon:"Layout",measuresDuration:!0,filters:{formats:{urlKey:"viewFormats",displayName:"Format",values:["html","json","xml","pdf","csv","text","markdown"]},statuses:{urlKey:"viewStatuses",displayName:"Status",values:["rendered","error","failed","cached","success"]}}},command:{displayName:"Command",pluralName:"Commands",route:"commands",icon:"Terminal",measuresDuration:!0,filters:{statuses:{urlKey:"commandStatuses",displayName:"Status",values:["executing","completed","failed","cancelled","timeout","running"]},names:{urlKey:"commandNames",displayName:"Command",values:[]}}},gate:{displayName:"Gate",pluralName:"Gates",route:"gates",icon:"Shield",measuresDuration:!0,filters:{names:{urlKey:"gateNames",displayName:"Gate",values:[]},results:{urlKey:"gateResults",displayName:"Result",values:["allowed","denied"]}}},batch:{displayName:"Batch",pluralName:"Batches",route:"batches",icon:"Layers",measuresDuration:!0,filters:{operations:{urlKey:"batchOperations",displayName:"Operation",values:["insert","update","delete","upsert","sync"]},statuses:{urlKey:"batchStatuses",displayName:"Status",values:["pending","processing","completed","failed","partial","cancelled"]}}},dump:{displayName:"Dump",pluralName:"Dumps",route:"dumps",icon:"HardDrive",measuresDuration:!0,filters:{operations:{urlKey:"dumpOperations",displayName:"Operation",values:["export","import","backup","restore","migrate","sync"]},formats:{urlKey:"dumpFormats",displayName:"Format",values:["json","csv","xml","sql","yaml","binary","xlsx"]},statuses:{urlKey:"dumpStatuses",displayName:"Status",values:["pending","completed","failed","error","success","cancelled","running"]}}},graphql:{displayName:"GraphQL",pluralName:"GraphQL",route:"graphql",icon:"Hexagon",measuresDuration:!0,filters:{operationTypes:{urlKey:"operationTypes",displayName:"Type",values:["query","mutation","subscription"]},operationNames:{urlKey:"operationNames",displayName:"Operation",values:[]},statuses:{urlKey:"statuses",displayName:"Status",values:[]},ips:{urlKey:"ips",displayName:"IP",values:[]}}}},q={requests:"request",queries:"query",exceptions:"exception",logs:"log",events:"event",jobs:"job",schedule:"schedule",cache:"cache",mail:"mail","http-client":"http-client",redis:"redis",models:"model",notifications:"notification",views:"view",commands:"command",gates:"gate",batches:"batch",dumps:"dump",graphql:"graphql"};function k(e){if(e in T)return T[e];const s=q[e];if(s)return T[s]}const x=k;function B(e){const[s,i]=D(),a=x(e),c=d.useCallback(r=>{if(r==="tags")return"tags";if(!a)return r;const t=a.filters[r];return(t==null?void 0:t.urlKey)||r},[a]),o=d.useMemo(()=>{const r={};if(!a)return r;const t=Object.values(a.filters).map(u=>u.urlKey);t.push("tags","search");for(const u of t){const n=s.get(u);n&&(r[u]=n.split(",").filter(Boolean))}return r},[s,a]),N=d.useCallback((r,t)=>{!a&&r!=="tags"&&console.warn("[useEntryFilters] No config found for entry type, using category as urlKey");const u=c(r),n=o[u]||[];if(!n.includes(t)){const l=new URLSearchParams(s);l.set(u,[...n,t].join(",")),i(l,{replace:!0})}},[a,c,o,s,i]),p=d.useCallback((r,t)=>{const n=(o[r]||[]).filter(f=>f!==t),l=new URLSearchParams(s);n.length>0?l.set(r,n.join(",")):l.delete(r),i(l,{replace:!0})},[o,s,i]),S=d.useCallback(()=>{i({},{replace:!0})},[i]),g=d.useMemo(()=>o,[o]),y=d.useMemo(()=>{if(!a)return[];const r=[];for(const[t,u]of Object.entries(o)){if(u.length===0)continue;let n=t,l=t==="tags"?"Tag":t;for(const[f,h]of Object.entries(a.filters))if(h.urlKey===t){n=f,l=h.displayName;break}r.push({category:n,urlKey:t,displayName:l,values:u})}return r},[o,a]),m=d.useMemo(()=>{const r=[];for(const t of y)for(const u of t.values)r.push({category:t.displayName,value:u.toUpperCase(),onRemove:()=>p(t.urlKey,u)});return r},[y,p]),K=y.length>0;return{addFilter:N,removeFilter:p,clearAll:S,serverFilters:g,activeFilters:y,headerFilters:m,hasFilters:K,getUrlKey:c}}function O(e,s){if(s==="tags")return"tags";const i=x(e);if(!i)return s;const a=i.filters[s];return(a==null?void 0:a.urlKey)||s}const M=["localhost"],A=(e,s)=>{if(s&&s!=="tag")return s;if(/^user:/i.test(e))return"tags";if(/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return"ips";const i=e.toUpperCase();if(w.includes(i))return"methods";const a=parseInt(e,10);return!isNaN(a)&&a>=100&&a<600?"statuses":/^[a-fA-F0-9:]+$/.test(e)&&e.includes(":")&&!e.includes(".")?"ips":e.includes("#")||e.includes("::")||/Controller\./i.test(e)?"controllers":M.includes(e.toLowerCase())||(e.includes(".")||e.includes(":"))&&!e.startsWith("/")&&!/^\d+$/.test(e)?"hostnames":"tags"};function H({children:e,listType:s,filterType:i="tag",filterValue:a,onClick:c,clickable:o=!0,className:N="",ariaLabel:p}){const S=C(),g=L(),y=n=>{if(n.preventDefault(),n.stopPropagation(),c){c(n);return}if(s&&o){const l=a||String(e),f=i&&i!=="tag"?O(s,i):A(l,i),h=g.pathname,v=h===`/${s}`||h.startsWith(`/${s}/`)?new URLSearchParams(g.search):new URLSearchParams,b=v.get(f);if(b){const P=b.split(",");P.includes(l)||v.set(f,[...P,l].join(","))}else v.set(f,l);S(`/${s}?${v.toString()}`)}},m=o&&(!!c||!!s),K=R(String(e)),r=m?"cursor-pointer hover:scale-105 transition-transform":"",t=String(e).toUpperCase(),u=p||(m?`Click to filter by ${t}`:void 0);return E.jsx("span",{onClick:m?y:void 0,role:m?"button":void 0,"aria-label":u,tabIndex:m?0:void 0,onKeyDown:m?n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),y(n))}:void 0,title:t,className:`inline-flex items-center px-2 py-0.5 rounded-sm text-xs font-bold uppercase tracking-wide max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap shadow-sm ${K} ${r} ${m?"focus:outline-hidden focus:ring-2 focus:ring-primary-500 focus:ring-offset-1":""} ${N}`,children:t})}function I({items:e,listType:s,filterType:i="tag",maxItems:a=99,clickable:c=!0}){if(!e||e.length===0)return null;const o=e.slice(0,a),N=e.length-a;return E.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.map(p=>E.jsx(H,{listType:s,filterType:i,clickable:c,children:p},p)),N>0&&E.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["+",N]})]})}function $(e){return e.type==="request"}function Q(e){return e.type==="query"}function V(e){return e.type==="exception"}function z(e){return e.type==="log"}function J(e){return e.type==="cache"}function Y(e){return e.type==="event"}function Z(e){return e.type==="job"}function _(e){return e.type==="schedule"}function W(e){return e.type==="mail"}function X(e){return e.type==="http-client"}function ee(e){return e.type==="redis"}function se(e){return e.type==="model"}function te(e){return e.type==="notification"}function ae(e){return e.type==="view"}function re(e){return e.type==="command"}function ne(e){return e.type==="gate"}function ie(e){return e.type==="batch"}function ue(e){return e.type==="dump"}function le(e){return e.type==="graphql"}export{I as B,H as C,Q as a,V as b,z as c,Y as d,Z as e,J as f,W as g,_ as h,$ as i,X as j,ee as k,se as l,te as m,ae as n,re as o,ne as p,ie as q,ue as r,le as s,x as t,B as u};
|
|
@@ -5,9 +5,9 @@
|
|
|
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-CQsXkVIl.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/vendor-DBTT3jXp.js">
|
|
10
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
10
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CMvt7uFU.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body class="bg-gray-50 dark:bg-gray-900">
|
|
13
13
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestlens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Laravel Telescope-like debugging and monitoring tool for NestJS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@nestjs/core": "^9.4.3 || ^10.0.0 || ^11.0.0 || ^12.0.0",
|
|
114
114
|
"@nestjs/graphql": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
115
115
|
"@nestjs/mercurius": "^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
|
|
116
|
-
"better-sqlite3": "^
|
|
116
|
+
"better-sqlite3": "^12.0.0",
|
|
117
117
|
"bullmq": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0",
|
|
118
118
|
"graphql": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
119
119
|
"ioredis": "^5.0.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"uuid": "^11.1.1"
|
|
164
164
|
},
|
|
165
165
|
"optionalDependencies": {
|
|
166
|
-
"better-sqlite3": "^11.
|
|
166
|
+
"better-sqlite3": "^12.11.1"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
169
|
"@apollo/server": "^5.5.1",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
231
|
"engines": {
|
|
232
|
-
"node": ">=
|
|
232
|
+
"node": ">=22.13.0"
|
|
233
233
|
},
|
|
234
234
|
"packageManager": "npm@11.21.3",
|
|
235
235
|
"devEngines": {
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{c as $,g as pe,j as e,X as he,a as be,z as j,r as fe,u as ke,T as v,D as oe,C as I,A as G,G as ve,F as je,B as Ne,P as we,b as Ee,H,d as Ce,L as Se,e as Te,M as $e,f as qe,R as Pe,h as Me,S as Le,i as X,k as Y,l as Re,m as ee,n as te,o as Ae,p as ae}from"./index-CNTaNUkj.js";import{b as d,e as De,L as Be}from"./vendor-DBTT3jXp.js";import{g as ie,f as C,p as S}from"./date-Dwgqy666.js";import{E as Ie}from"./eye-BlDJOCMu.js";import{Z as Fe}from"./zap-QXV06WYA.js";import{C as Ge}from"./calendar-CMjU8s5-.js";/**
|
|
2
|
-
* @license lucide-react v0.468.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const He=$("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
7
|
-
* @license lucide-react v0.468.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const ze=$("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
12
|
-
* @license lucide-react v0.468.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const Qe=$("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
|
|
17
|
-
* @license lucide-react v0.468.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const Ke=$("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);function Oe(){const[o,t]=d.useState([]),[g,l]=d.useState(!1),[c,m]=d.useState(""),[s,h]=d.useState(null),u=d.useCallback(async()=>{try{const n=await pe();t(n.data.map(({tag:x,count:k})=>({tag:x,count:k}))),h(null)}catch(n){h(n instanceof Error?n:new Error("Failed to load monitored tags"))}},[]);d.useEffect(()=>{const n=setTimeout(()=>void u(),0);return()=>clearTimeout(n)},[u]);const b=async()=>{const n=c.trim();if(n)try{await be(n),m(""),l(!1),await u(),j.success(`Keeping entries tagged ${n.toUpperCase()}`)}catch(x){j.error(`Could not monitor that tag: ${x instanceof Error?x.message:String(x)}`)}},q=async n=>{try{await fe(n),await u()}catch(x){j.error(`Could not stop monitoring: ${x instanceof Error?x.message:String(x)}`)}};return e.jsxs("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700","data-testid":"monitored-tags",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx(Ie,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Kept from pruning"})]}),!g&&e.jsx("button",{onClick:()=>l(!0),"aria-label":"Monitor a tag",className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500",children:e.jsx(ze,{className:"h-4 w-4"})})]}),s?e.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400",role:"alert",children:[s.message,". This is not a list of nothing being kept."]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[o.length===0&&!g&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"No tag is monitored: everything is pruned by age."}),o.map(({tag:n,count:x})=>e.jsxs("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-xs font-bold uppercase tracking-wide shadow ${ie(n)}`,children:[n,e.jsx("span",{className:"ml-1 font-normal opacity-80",children:x}),e.jsx("button",{onClick:()=>void q(n),"aria-label":`Stop monitoring ${n}`,className:"ml-1 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-primary-500 rounded",children:e.jsx(he,{className:"h-3 w-3"})})]},n)),g&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("input",{type:"text",value:c,onChange:n=>m(n.target.value),onKeyDown:n=>{n.key==="Enter"&&b(),n.key==="Escape"&&l(!1)},placeholder:"Tag to keep...","aria-label":"Tag to monitor",autoFocus:!0,className:"px-2 py-0.5 text-xs border rounded dark:bg-gray-700 dark:border-gray-600 w-28 focus:outline-none focus:ring-2 focus:ring-primary-500"}),e.jsx("button",{onClick:()=>void b(),"aria-label":"Save monitored tag",className:"text-xs text-primary-600 dark:text-primary-400 focus:outline-none focus:ring-2 focus:ring-primary-500 rounded",children:"✓"}),e.jsx("button",{onClick:()=>l(!1),"aria-label":"Cancel monitoring a tag",className:"text-xs text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 rounded",children:"×"})]})]})]})}const le=[{name:"Core",types:[{key:"request",name:"Requests",icon:G,color:"blue",route:"/requests"},{key:"query",name:"Queries",icon:oe,color:"purple",route:"/queries"},{key:"graphql",name:"GraphQL",icon:ve,color:"fuchsia",route:"/graphql"},{key:"exception",name:"Exceptions",icon:v,color:"red",route:"/exceptions"},{key:"log",name:"Logs",icon:je,color:"green",route:"/logs"}]},{name:"Background",types:[{key:"job",name:"Jobs",icon:Ne,color:"yellow",route:"/jobs"},{key:"schedule",name:"Schedule",icon:Ge,color:"gray",route:"/schedule"},{key:"batch",name:"Batches",icon:we,color:"lime",route:"/batches"},{key:"command",name:"Commands",icon:Ee,color:"slate",route:"/commands"}]},{name:"Data",types:[{key:"cache",name:"Cache",icon:H,color:"cyan",route:"/cache"},{key:"redis",name:"Redis",icon:Ce,color:"rose",route:"/redis"},{key:"model",name:"Models",icon:Se,color:"violet",route:"/models"}]},{name:"Communication",types:[{key:"http-client",name:"HTTP Client",icon:Te,color:"indigo",route:"/http-client"},{key:"mail",name:"Mail",icon:$e,color:"pink",route:"/mail"},{key:"notification",name:"Notifications",icon:qe,color:"orange",route:"/notifications"},{key:"event",name:"Events",icon:Pe,color:"emerald",route:"/events"}]},{name:"System",types:[{key:"view",name:"Views",icon:Me,color:"teal",route:"/views"},{key:"gate",name:"Gates",icon:Le,color:"amber",route:"/gates"},{key:"dump",name:"Dumps",icon:H,color:"stone",route:"/dumps"}]}],re=le.flatMap(o=>o.types),se={request:"text-blue-500",query:"text-purple-500",graphql:"text-fuchsia-500",exception:"text-red-500",log:"text-green-500",event:"text-emerald-500",job:"text-yellow-500",cache:"text-cyan-500",mail:"text-pink-500",schedule:"text-gray-500","http-client":"text-indigo-500",redis:"text-rose-500",model:"text-violet-500",notification:"text-orange-500",view:"text-teal-500",command:"text-slate-500",gate:"text-amber-500",batch:"text-lime-500",dump:"text-stone-500"},Ue={request:"bg-blue-50 dark:bg-blue-900/20",query:"bg-purple-50 dark:bg-purple-900/20",graphql:"bg-fuchsia-50 dark:bg-fuchsia-900/20",exception:"bg-red-50 dark:bg-red-900/20",log:"bg-green-50 dark:bg-green-900/20",event:"bg-emerald-50 dark:bg-emerald-900/20",job:"bg-yellow-50 dark:bg-yellow-900/20",cache:"bg-cyan-50 dark:bg-cyan-900/20",mail:"bg-pink-50 dark:bg-pink-900/20",schedule:"bg-gray-50 dark:bg-gray-700/30","http-client":"bg-indigo-50 dark:bg-indigo-900/20",redis:"bg-rose-50 dark:bg-rose-900/20",model:"bg-violet-50 dark:bg-violet-900/20",notification:"bg-orange-50 dark:bg-orange-900/20",view:"bg-teal-50 dark:bg-teal-900/20",command:"bg-slate-50 dark:bg-slate-700/30",gate:"bg-amber-50 dark:bg-amber-900/20",batch:"bg-lime-50 dark:bg-lime-900/20",dump:"bg-stone-50 dark:bg-stone-700/30"};function Ze(o){if(o===0)return"0 B";const t=1024,g=["B","KB","MB","GB"],l=Math.floor(Math.log(o)/Math.log(t));return`${parseFloat((o/Math.pow(t,l)).toFixed(1))} ${g[l]}`}function ne(o){return o<1e3?`${Math.round(o)}ms`:`${(o/1e3).toFixed(2)}s`}function Je(o){const t=o.payload;switch(o.type){case"request":return`${t.method||"GET"} ${t.path||"/"}`;case"query":const g=t.query||"";return g.length>50?g.substring(0,50)+"...":g;case"exception":return t.name||"Exception";case"log":const l=t.message||"";return l.length>50?l.substring(0,50)+"...":l;case"event":return t.name||"Event";case"job":return t.name||"Job";case"cache":return`${(t.operation||"get").toUpperCase()} ${t.key||""}`;case"mail":return t.subject||"Mail";case"schedule":return t.name||"Task";default:return"Entry"}}function Ve(o){const t=o.payload;switch(o.type){case"request":const g=t.statusCode,l=t.duration;return g?`${g} · ${l?ne(l):""}`:null;case"query":const c=t.duration,m=t.slow;return`${c?ne(c):""} ${m?"· SLOW":""}`;case"exception":const s=t.message||"";return s.length>60?s.substring(0,60)+"...":s;case"log":return t.context||null;case"job":return t.queue||null;default:return null}}const F=5;function T({label:o,value:t,subtext:g,icon:l,trend:c,status:m="neutral",onClick:s}){const h={good:"text-emerald-500",warning:"text-amber-500",danger:"text-red-500",neutral:"text-gray-400 dark:text-gray-500"},u={good:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700",warning:"bg-amber-100 dark:bg-amber-900/30 border-amber-300 dark:border-amber-700/50",danger:"bg-red-100 dark:bg-red-900/30 border-red-300 dark:border-red-700/50",neutral:"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700"},b=s?"button":"div";return e.jsx(b,{onClick:s,className:`${u[m]} rounded-lg border p-4 ${s?"cursor-pointer hover:shadow-sm transition-all text-left w-full":""}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:o}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("p",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:typeof t=="number"?t.toLocaleString():t}),c&&e.jsx("span",{className:`flex items-center ${c==="up"?"text-emerald-500":"text-red-500"}`,children:c==="up"?e.jsx(Ke,{className:"h-3 w-3"}):e.jsx(Qe,{className:"h-3 w-3"})})]}),g&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:g})]}),e.jsx("div",{className:"p-2 rounded-lg bg-gray-100 dark:bg-gray-700/50",children:e.jsx(l,{className:`h-5 w-5 ${h[m]}`})})]})})}function at(){const o=De(),{stats:t,error:g,refreshStats:l}=ke(),[c,m]=d.useState(null),[s,h]=d.useState(null),[u,b]=d.useState(!1),[q,n]=d.useState(!0);d.useEffect(()=>{l()},[l]);const[x,k]=d.useState([]),[y,z]=d.useState(!1),[Q,P]=d.useState(1),[K,O]=d.useState(null),[U,ce]=d.useState(0),[Z,M]=d.useState(!1),[L,R]=d.useState(null),[N,A]=d.useState([]);d.useEffect(()=>{const a=async()=>{try{const[i,p]=await Promise.all([ee(),te()]);m(i.data),h(p.data)}catch(i){console.error("Failed to fetch storage/pruning data:",i)}};a();const r=setInterval(a,3e4);return()=>clearInterval(r)},[]);const de=async()=>{var a;b(!0);try{const r=await Ae(),[i,p]=await Promise.all([ee(),te()]);m(i.data),h(p.data),l();const f=((a=r.data)==null?void 0:a.deleted)??0;j.success(f===0?"Nothing was old enough to prune":`Pruned ${f.toLocaleString()} ${f===1?"entry":"entries"}`)}catch(r){j.error(`Could not prune: ${r instanceof Error?r.message:String(r)}`)}finally{b(!1)}};d.useEffect(()=>{let a=!0;return(async()=>{n(!0);try{const i=await ae({limit:F});if(!a)return;k(i.data),ce(i.meta.total),M(i.meta.hasMore),R(i.meta.oldestSequence),P(1),A([]),O(null)}catch(i){if(!a)return;O(i instanceof Error?i:new Error("Failed to load activity"))}finally{a&&n(!1)}})(),()=>{a=!1}},[]);const ge=async()=>{if(!(!Z||!L||y)){z(!0);try{A(r=>[...r,{entries:x,oldestSeq:L}]);const a=await ae({limit:F,beforeSequence:L});k(a.data),M(a.meta.hasMore),R(a.meta.oldestSequence),P(r=>r+1)}catch(a){console.error("Failed to load next page:",a)}finally{z(!1)}}},xe=()=>{if(N.length===0)return;const a=N[N.length-1];A(r=>r.slice(0,-1)),k(a.entries),R(a.oldestSeq),M(!0),P(r=>r-1)},J=N.length>0,V=Z,D=Math.ceil(U/F);if(q)return e.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});if(!t&&g)return e.jsxs("div",{className:"card flex flex-col items-center justify-center py-16 px-4",role:"alert","data-testid":"stats-error",children:[e.jsx("div",{className:"p-3 rounded-full bg-red-50 dark:bg-red-900/20 mb-4",children:e.jsx(v,{className:"h-8 w-8 text-red-500 dark:text-red-400"})}),e.jsx("p",{className:"text-base font-medium text-gray-900 dark:text-white",children:"Could not reach NestLens"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400 text-center max-w-md",children:[g.message,". Nothing on this page is known — it is not a report of an idle application."]}),e.jsx("button",{onClick:()=>void l(),className:"mt-5 px-3 py-1.5 rounded-lg text-sm font-medium bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors",children:"Try again"})]});const w=(t==null?void 0:t.byType.request)??0,B=(t==null?void 0:t.byType.exception)??0,W=(t==null?void 0:t.unresolvedExceptions)??B,E=(t==null?void 0:t.avgResponseTime)??0,_=(t==null?void 0:t.slowQueries)??0,me=E<200,ue=a=>{const r=re.find(i=>i.key===a);return(r==null?void 0:r.icon)??G},ye=a=>{const r=re.find(i=>i.key===a);return(r==null?void 0:r.route)||"/"};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[e.jsx(T,{label:"Entries",value:(t==null?void 0:t.total)??0,subtext:"total recorded",icon:oe,status:"neutral"}),e.jsx(T,{label:"Errors",value:W,subtext:"unresolved exceptions",icon:v,status:W===0?"good":"danger",onClick:()=>o("/exceptions?resolved=false")}),e.jsx(T,{label:"Latency",value:E?`${Math.round(E)}ms`:"N/A",subtext:"avg response time",icon:I,status:E===0?"neutral":me?"good":"warning"}),e.jsx(T,{label:"Slow Queries",value:_,subtext:"exceeding threshold",icon:Fe,status:_===0?"good":"warning",onClick:()=>o("/queries?slow=true")})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:le.map(a=>e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2.5 border-b border-gray-100 dark:border-gray-700/50 bg-gray-50/50 dark:bg-gray-800/50",children:e.jsx("h3",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:a.name})}),e.jsx("div",{className:"p-2.5",children:a.types.map(r=>{const i=r.key==="exception"?(t==null?void 0:t.unresolvedExceptions)??0:(t==null?void 0:t.byType[r.key])??0,p=r.icon,f=i>0;return e.jsxs(Be,{to:r.route,className:`group flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all ${f?"hover:bg-gray-50 dark:hover:bg-gray-700/50":"opacity-50 hover:opacity-75"}`,children:[e.jsx("div",{className:`p-2 rounded-lg ${Ue[r.key]||"bg-gray-100 dark:bg-gray-700/50"} group-hover:scale-105 transition-transform`,children:e.jsx(p,{className:`h-3.5 w-3.5 ${se[r.key]||"text-gray-500"}`})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.name})}),e.jsx("span",{className:`text-sm font-semibold tabular-nums ${f?"text-gray-900 dark:text-white":"text-gray-400 dark:text-gray-500"}`,children:i.toLocaleString()})]},r.key)})})]},a.name))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5",children:[e.jsxs("div",{className:"lg:col-span-2 bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"Recent Activity"}),y&&e.jsx("div",{className:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary-600",role:"status","aria-label":"Loading"})]}),U>0&&e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[Q," / ",D]})]}),e.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-gray-700/50 flex-1 relative",style:{minHeight:"340px"},children:[y&&x.length>0&&e.jsx("div",{className:"absolute inset-0 bg-white/50 dark:bg-gray-800/50 z-10 pointer-events-none"}),x.length===0&&K?e.jsxs("div",{className:"p-8 text-center text-gray-500 dark:text-gray-400",role:"alert","data-testid":"activity-error",children:[e.jsx(v,{className:"h-7 w-7 mx-auto mb-2 text-red-500 dark:text-red-400"}),e.jsx("p",{className:"text-sm",children:"Could not load recent activity"}),e.jsxs("p",{className:"mt-1 text-xs",children:[K.message,". This is not a report of an idle application."]})]}):x.length===0&&!y?e.jsxs("div",{className:"p-8 text-center text-gray-500 dark:text-gray-400",children:[e.jsx(G,{className:"h-7 w-7 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No entries recorded yet"})]}):x.length===0&&y?e.jsx("div",{className:"p-8 flex items-center justify-center",role:"status","aria-label":"Loading...",children:e.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary-600"})}):x.map(a=>{const r=ue(a.type),i=Je(a),p=Ve(a);return e.jsxs("div",{onClick:()=>o(`${ye(a.type)}/${a.id}`),className:"px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700/30 cursor-pointer flex items-center gap-3 transition-colors",children:[e.jsx("div",{className:"flex-shrink-0 p-2 rounded-lg bg-gray-100 dark:bg-gray-700/50",children:e.jsx(r,{className:`h-4 w-4 ${se[a.type]||"text-gray-500"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`inline-flex px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${ie(a.type)}`,children:a.type}),e.jsx("span",{className:"text-sm text-gray-900 dark:text-white truncate font-mono",children:i})]}),p&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate mt-0.5",children:p})]}),e.jsx("div",{className:"flex-shrink-0 text-xs text-gray-400 dark:text-gray-500 whitespace-nowrap",children:C(S(a.createdAt),{addSuffix:!0})}),e.jsx(X,{className:"h-4 w-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},a.id)})]}),D>1&&e.jsxs("div",{className:"px-4 py-2.5 border-t border-gray-200 dark:border-gray-700 flex items-center justify-between bg-gray-50 dark:bg-gray-800/50",children:[e.jsxs("button",{onClick:xe,disabled:!J||y,className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${J&&!y?"text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700":"text-gray-300 dark:text-gray-600 cursor-not-allowed"}`,children:[e.jsx(He,{className:"h-4 w-4"}),e.jsx("span",{children:"Previous"})]}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Page ",Q," of ",D]}),e.jsxs("button",{onClick:ge,disabled:!V||y,className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${V&&!y?"text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700":"text-gray-300 dark:text-gray-600 cursor-not-allowed"}`,children:[e.jsx("span",{children:"Next"}),e.jsx(X,{className:"h-4 w-4"})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:"System Overview"})}),e.jsxs("div",{className:"p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx(H,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Database Size"})]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:c!=null&&c.databaseSize?Ze(c.databaseSize):"N/A"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx(v,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Error Rate"})]}),e.jsxs("span",{className:`text-sm font-semibold ${w>0&&B/w*100<5?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"}`,children:[w>0?(B/w*100).toFixed(2):"0.00","%"]})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx(I,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Retention"})]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:(s==null?void 0:s.maxAge)!==void 0?`${s.maxAge}h`:"N/A"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-gray-100 dark:border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx(Y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Last Prune"})]}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:s!=null&&s.lastRun?C(S(s.lastRun),{addSuffix:!0}):"Never"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-600 dark:text-gray-400",children:[e.jsx(I,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Next Prune"})]}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:s!=null&&s.nextRun?C(S(s.nextRun),{addSuffix:!0}):"N/A"})]})]}),e.jsx(Oe,{}),e.jsx("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("button",{onClick:de,disabled:u||!(s!=null&&s.enabled),className:"w-full flex items-center justify-center gap-2 px-3 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 disabled:opacity-50 disabled:cursor-not-allowed",children:[u?e.jsx(Re,{className:"h-4 w-4 animate-spin"}):e.jsx(Y,{className:"h-4 w-4"}),e.jsx("span",{children:u?"Pruning...":"Prune Now"})]})}),(c==null?void 0:c.oldestEntry)&&(c==null?void 0:c.newestEntry)&&e.jsx("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Recording for ",C(S(c.oldestEntry))]})})]})]})]})]})}export{at as default};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RequestDetailView-D0pFJlIF.js","./index-CNTaNUkj.js","./vendor-DBTT3jXp.js","./index-ReuerEhs.css","./date-Dwgqy666.js","./DetailRow-C35E-Fg7.js","./types-DqF5HlZi.js","./UserCard-CEq6mQ5k.js","./search-CcMiea1V.js","./QueryDetailView-BkUuf3JM.js","./ExceptionDetailView-BD375JkM.js","./LogDetailView--AEX1d6S.js","./EventDetailView-i_T5zzxK.js","./CopyButton-DpZHVixQ.js","./zap-QXV06WYA.js","./users-D9yOg5Si.js","./JobDetailView-4qAPrQWH.js","./circle-alert-DQGZE3D0.js","./circle-check-big-Br_lvQdJ.js","./CacheDetailView-CcGupoLQ.js","./circle-x-DFyAuyMN.js","./timer-CDc7JIAB.js","./MailDetailView-BPFRJcUh.js","./ScheduleDetailView-BPjjgHxu.js","./format-BlNP-apw.js","./calendar-CMjU8s5-.js","./HttpClientDetailView-yb-3URIg.js","./RedisDetailView-EHqxefP1.js","./ModelDetailView-BDzUh_Kg.js","./NotificationDetailView-D-wwNBBg.js","./send-CSgocT8I.js","./ViewDetailView-DzuPi6K1.js","./eye-BlDJOCMu.js","./CommandDetailView-CVZrIKo6.js","./GateDetailView-DjS0BcxS.js","./BatchDetailView-MwxKpCBw.js","./DumpDetailView-C3AszicE.js","./GraphQLDetailView-BubeJCJT.js","./DataTable-CCXj8zzB.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{c as O,j as e,I as fe,z as $,J as je,X as B,x as be,i as ke,K as ae,N as we,_ as b}from"./index-CNTaNUkj.js";import{b as i,h as Ne,L as J}from"./vendor-DBTT3jXp.js";import{g as Ee,f as ve,p as Te}from"./date-Dwgqy666.js";import{t as Ce,C as h,i as X,a as Y,b as Z,c as K,d as re,e as le,f as ie,g as ne,h as oe,j as ee,k as ce,l as de,m as xe,n as pe,o as me,p as he,q as ge,r as ue,s as te}from"./types-DqF5HlZi.js";import{S as L}from"./search-CcMiea1V.js";/**
|
|
3
|
-
* @license lucide-react v0.468.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/const _e=O("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
8
|
-
* @license lucide-react v0.468.0 - ISC
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the ISC license.
|
|
11
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/const W=O("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
13
|
-
* @license lucide-react v0.468.0 - ISC
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the ISC license.
|
|
16
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const I=O("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
18
|
-
* @license lucide-react v0.468.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/const H=O("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
23
|
-
* @license lucide-react v0.468.0 - ISC
|
|
24
|
-
*
|
|
25
|
-
* This source code is licensed under the ISC license.
|
|
26
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/const G=O("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);function se(t,a){if(!t||typeof window>"u")return a;const l=window.location.hash.slice(1);if(!l)return a;try{return new URLSearchParams(l).get(t)||a}catch{return a}}function Se({tabs:t,defaultTab:a,hashKey:l,headerRight:o,onTabChange:y}){var g,w;const s=a||((g=t[0])==null?void 0:g.id),[x,j]=i.useState(()=>se(l,s));i.useEffect(()=>{if(!l)return;const r=()=>{const d=se(l,s);j(d)};return window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[l,s]);const N=i.useCallback(r=>{if(j(r),y==null||y(r),!l)return;const d=window.location.hash.slice(1),p=new URLSearchParams(d);r===s?p.delete(l):p.set(l,r);const T=p.toString(),A=T?`#${T}`:window.location.pathname+window.location.search;window.history.replaceState(null,"",A)},[l,s,y]),f=(w=t.find(r=>r.id===x))==null?void 0:w.content,c=i.useRef(new Map),n=i.useCallback((r,d)=>{var T;let p=null;switch(r.key){case"ArrowLeft":r.preventDefault(),p=d===0?t.length-1:d-1;break;case"ArrowRight":r.preventDefault(),p=d===t.length-1?0:d+1;break;case"Home":r.preventDefault(),p=0;break;case"End":r.preventDefault(),p=t.length-1;break}if(p!==null){const A=t[p];N(A.id),(T=c.current.get(A.id))==null||T.focus()}},[t,N]);return e.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"flex items-center border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:[e.jsx("div",{className:"flex flex-1",role:"tablist","aria-label":"Content tabs",children:t.map((r,d)=>e.jsxs("button",{ref:p=>{p&&c.current.set(r.id,p)},role:"tab","aria-selected":x===r.id,"aria-controls":`tabpanel-${r.id}`,id:`tab-${r.id}`,tabIndex:x===r.id?0:-1,onClick:()=>N(r.id),onKeyDown:p=>n(p,d),className:`px-4 py-2.5 text-sm font-medium transition-colors relative ${x===r.id?"text-indigo-600 dark:text-indigo-400 bg-white dark:bg-gray-900":"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[e.jsxs("span",{className:"flex items-center gap-2",children:[r.label,r.badge!==void 0&&r.badge>0&&e.jsx("span",{className:"inline-flex items-center justify-center px-1.5 py-0.5 text-xs font-medium bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-300 rounded",children:r.badge})]}),x===r.id&&e.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-indigo-600 dark:bg-indigo-400","aria-hidden":"true"})]},r.id))}),o&&e.jsx("div",{className:"px-3 flex items-center",children:o})]}),e.jsx("div",{role:"tabpanel",id:`tabpanel-${x}`,"aria-labelledby":`tab-${x}`,tabIndex:0,className:"bg-white dark:bg-gray-900",children:f})]})}function Ae({entryId:t,tags:a,onTagsChange:l,editable:o=!1,size:y="sm"}){const[s,x]=i.useState(!1),[j,N]=i.useState(""),[f,c]=i.useState(a),n=y==="sm"?"px-1.5 py-0.5 text-xs":"px-2 py-1 text-sm",g=async()=>{if(j.trim())try{const r=await je(t,[j.trim()]);c(r.data),l==null||l(r.data),N(""),x(!1)}catch(r){console.error("Failed to add tag:",r),$.error(`Could not add the tag: ${r.message}`)}},w=async r=>{try{const d=await fe(t,[r]);c(d.data),l==null||l(d.data)}catch(d){console.error("Failed to remove tag:",d),$.error(`Could not remove the tag: ${d.message}`)}};return f.length===0&&!o?null:e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[f.map(r=>e.jsxs("span",{className:`inline-flex items-center rounded font-bold uppercase tracking-wide shadow ${n} ${Ee(r)}`,children:[r.toUpperCase(),o&&e.jsx("button",{onClick:d=>{d.stopPropagation(),w(r)},"aria-label":`Remove tag ${r}`,className:"ml-1 hover:text-red-600 dark:hover:text-red-400",children:"×"})]},r)),o&&e.jsx(e.Fragment,{children:s?e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"text",value:j,onChange:r=>N(r.target.value),onKeyDown:r=>{r.key==="Enter"&&g(),r.key==="Escape"&&x(!1)},placeholder:"New tag...","aria-label":"New tag",className:"px-2 py-0.5 text-xs border rounded dark:bg-gray-700 dark:border-gray-600 w-24",autoFocus:!0}),e.jsx("button",{onClick:g,"aria-label":"Save tag",className:"text-green-600 hover:text-green-700 text-xs",children:"+"}),e.jsx("button",{onClick:()=>x(!1),"aria-label":"Cancel adding a tag",className:"text-gray-400 hover:text-gray-600 text-xs",children:"×"})]}):e.jsx("button",{onClick:r=>{r.stopPropagation(),x(!0)},"aria-label":"Add a tag",className:`inline-flex items-center rounded-lg font-medium ${n} bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600`,children:"+ Tag"})})]})}function De(t){return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t}function $e(t,a){return a==="array"?t.length:a==="object"?Object.keys(t).length:0}function Le(t,a,l){if(!a)return!1;const o=a.toLowerCase();return t===null?"null".includes(o):typeof t=="string"?t.toLowerCase().includes(o):typeof t=="number"||typeof t=="boolean"?String(t).includes(o):!1}function Q(t,a){if(!a)return!1;const l=a.toLowerCase();return t===null?"null".includes(l):typeof t=="string"?t.toLowerCase().includes(l):typeof t=="number"||typeof t=="boolean"?String(t).includes(l):Array.isArray(t)?t.some(o=>Q(o,a)):typeof t=="object"&&t!==null?Object.entries(t).some(([o,y])=>o.toLowerCase().includes(l)||Q(y,a)):!1}const Ve=i.memo(function t({keyName:a,value:l,depth:o,expandedPaths:y,onToggle:s,searchTerm:x,path:j,isArrayItem:N=!1}){const f=De(l),c=f==="object"||f==="array",n=y.has(j),g=$e(l,f),w=g===0,r=!!x&&((a==null?void 0:a.toLowerCase().includes(x.toLowerCase()))??!1),d=Le(l,x),p=r||d,T=i.useCallback(()=>{s(j)},[s,j]),A=i.useCallback(v=>{v.stopPropagation();const k=typeof l=="string"?l:JSON.stringify(l,null,2);navigator.clipboard.writeText(k),$.success("Copied!")},[l]),V=()=>{const v=d?"bg-yellow-400/30 rounded px-0.5":"";switch(f){case"null":return e.jsx("span",{className:`text-orange-600 dark:text-orange-400 italic ${v}`,children:"null"});case"undefined":return e.jsx("span",{className:`text-gray-500 italic ${v}`,children:"undefined"});case"boolean":return e.jsx("span",{className:`text-purple-600 dark:text-purple-400 ${v}`,children:String(l)});case"number":return e.jsx("span",{className:`text-cyan-600 dark:text-cyan-400 ${v}`,children:String(l)});case"string":{const k=l,D=300,R=k.length>D,P=R?k.slice(0,D):k,M=/^https?:\/\//.test(k),U=/^\d{4}-\d{2}-\d{2}/.test(k),u=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(k);return e.jsxs("span",{className:`text-green-600 dark:text-green-400 ${v}`,children:['"',P,R&&e.jsxs("span",{className:"text-gray-500",children:["... (",k.length-D," more)"]}),'"',M&&e.jsx("span",{className:"ml-1 text-blue-600 dark:text-blue-400 text-xs",children:"(URL)"}),U&&e.jsx("span",{className:"ml-1 text-amber-600 dark:text-yellow-400 text-xs",children:"(Date)"}),u&&e.jsx("span",{className:"ml-1 text-pink-600 dark:text-pink-400 text-xs",children:"(Email)"})]})}case"array":return n?e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"["}):e.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["[",w?"":e.jsxs("span",{className:"text-gray-500 text-xs ml-1",children:[g," items"]}),"]"]});case"object":return n?e.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"{"}):e.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:["{",w?"":e.jsxs("span",{className:"text-gray-500 text-xs ml-1",children:[g," keys"]}),"}"]});default:return e.jsx("span",{className:"text-gray-700 dark:text-gray-300",children:String(l)})}},F=()=>{if(!c||!n)return null;const v=f==="array"?l.map((k,D)=>[String(D),k]):Object.entries(l);return e.jsxs(e.Fragment,{children:[v.map(([k,D])=>e.jsx(t,{keyName:k,value:D,depth:o+1,expandedPaths:y,onToggle:s,searchTerm:x,path:`${j}.${k}`,isArrayItem:f==="array"},`${j}.${k}`)),e.jsxs("div",{className:"flex items-start",children:[e.jsx("span",{className:"w-6 flex-shrink-0"}),e.jsx("div",{style:{paddingLeft:o*16+16},className:"text-gray-600 dark:text-gray-400",children:f==="array"?"]":"}"})]})]})},z=o*16;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`group flex items-start py-[1px] hover:bg-gray-100 dark:hover:bg-white/5 rounded cursor-pointer transition-colors ${p?"bg-yellow-500/10":""}`,onClick:c?T:void 0,children:[e.jsx("span",{className:"w-6 h-6 flex items-center justify-center flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx("button",{onClick:A,className:"p-1 hover:bg-gray-200 dark:hover:bg-gray-700 rounded text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",title:"Copy value",children:e.jsx(I,{className:"w-4 h-4"})})}),e.jsxs("div",{className:"flex items-start flex-1",style:{paddingLeft:z},children:[e.jsx("span",{className:"w-4 h-5 flex items-center justify-center flex-shrink-0",children:c&&!w&&(n?e.jsx(be,{className:"w-3.5 h-3.5 text-gray-400 dark:text-gray-500"}):e.jsx(ke,{className:"w-3.5 h-3.5 text-gray-400 dark:text-gray-500"}))}),a!==null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`${N?"text-gray-500":"text-blue-700 dark:text-blue-300"} ${r?"bg-yellow-400/30 rounded px-0.5":""}`,children:N?a:`"${a}"`}),e.jsx("span",{className:"text-gray-500 mx-1",children:":"})]}),e.jsx("span",{className:"flex-1",children:V()})]})]}),F()]})});function ye({data:t,title:a,initialExpanded:l=!0,maxInitialDepth:o=2,searchable:y=!0,maxHeight:s=500,inline:x=!1,showToolbar:j=!1,externalSearchTerm:N}){const[f,c]=i.useState(!1),[n,g]=i.useState(""),[w,r]=i.useState(!1),d=N??n,p=g,[T,A]=i.useState(()=>{const u=new Set;if(l){const E=(m,C,_)=>{_>=o||(u.add(C),Array.isArray(m)?m.forEach((S,q)=>E(S,`${C}.${q}`,_+1)):typeof m=="object"&&m!==null&&Object.entries(m).forEach(([S,q])=>E(q,`${C}.${S}`,_+1)))};E(t,"root",0)}return u}),V=i.useMemo(()=>{const u=new Set;if(!d)return u;const E=(m,C)=>{Q(m,d)&&u.add(C),Array.isArray(m)?m.forEach((_,S)=>E(_,`${C}.${S}`)):typeof m=="object"&&m!==null&&Object.entries(m).forEach(([_,S])=>E(S,`${C}.${_}`))};return E(t,"root"),u},[d,t]),F=i.useMemo(()=>V.size===0?T:new Set([...T,...V]),[T,V]),z=i.useCallback(u=>{A(E=>{const m=new Set(E);return m.has(u)?m.delete(u):m.add(u),m})},[]),v=i.useCallback(()=>{const u=new Set,E=(m,C)=>{u.add(C),Array.isArray(m)?m.forEach((_,S)=>E(_,`${C}.${S}`)):typeof m=="object"&&m!==null&&Object.entries(m).forEach(([_,S])=>E(S,`${C}.${_}`))};E(t,"root"),A(u)},[t]),k=i.useCallback(()=>{A(new Set)},[]),D=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(t,null,2)),c(!0),$.success("JSON copied!"),setTimeout(()=>c(!1),2e3)}catch{$.error("Failed to copy")}},R=()=>{r(u=>!u),w&&p("")},P=e.jsx("div",{className:`p-3 overflow-auto font-mono text-sm ${x?"":"bg-white dark:bg-gray-800"}`,style:{maxHeight:typeof s=="number"?`${s}px`:s},children:e.jsx(Ve,{keyName:null,value:t,depth:0,expandedPaths:F,onToggle:z,searchTerm:d,path:"root"})}),M=e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a&&e.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:a}),e.jsxs("div",{className:`flex items-center space-x-1 ${a?"":"ml-auto"}`,children:[e.jsx("button",{onClick:v,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Expand all",children:e.jsx(H,{className:"h-3.5 w-3.5 text-gray-500"})}),e.jsx("button",{onClick:k,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Collapse all",children:e.jsx(G,{className:"h-3.5 w-3.5 text-gray-500"})}),e.jsx("div",{className:"w-px h-4 bg-gray-300 dark:bg-gray-600 mx-1"}),y&&e.jsx("button",{onClick:R,className:`p-1.5 rounded transition-colors ${w?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400":"hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-500"}`,title:"Search",children:e.jsx(L,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:D,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Copy JSON",children:f?e.jsx(W,{className:"h-3.5 w-3.5 text-green-500"}):e.jsx(I,{className:"h-3.5 w-3.5 text-gray-500"})})]})]}),U=w&&e.jsx("div",{className:"mb-2",children:e.jsxs("div",{className:"relative",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),e.jsx("input",{type:"text",value:d,onChange:u=>p(u.target.value),placeholder:"Search keys and values...",className:"w-full pl-8 pr-8 py-1.5 text-sm bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-primary-500 focus:border-transparent",autoFocus:!0}),d&&e.jsx("button",{onClick:()=>p(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:e.jsx(B,{className:"h-3.5 w-3.5"})})]})});return x?j?e.jsxs("div",{children:[M,U,P]}):P:e.jsxs("div",{className:"card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-2.5 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between bg-gray-50 dark:bg-gray-800/50",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[a&&e.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:a}),e.jsx("span",{className:"text-xs text-gray-500",children:Array.isArray(t)?`${t.length} items`:typeof t=="object"&&t!==null?`${Object.keys(t).length} keys`:""})]}),e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx("button",{onClick:v,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Expand all",children:e.jsx(H,{className:"h-3.5 w-3.5 text-gray-500"})}),e.jsx("button",{onClick:k,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Collapse all",children:e.jsx(G,{className:"h-3.5 w-3.5 text-gray-500"})}),e.jsx("div",{className:"w-px h-4 bg-gray-300 dark:bg-gray-600 mx-1"}),y&&e.jsx("button",{onClick:R,className:`p-1.5 rounded transition-colors ${w?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400":"hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-500"}`,title:"Search (Ctrl+F)",children:e.jsx(L,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:D,className:"flex items-center gap-1.5 px-2 py-1 text-xs font-medium text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Copy JSON",children:f?e.jsxs(e.Fragment,{children:[e.jsx(W,{className:"h-3.5 w-3.5 text-green-500"}),e.jsx("span",{className:"text-green-500",children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:"Copy"})]})})]})]}),w&&e.jsx("div",{className:"px-3 py-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/30",children:e.jsxs("div",{className:"relative",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),e.jsx("input",{type:"text",value:d,onChange:u=>p(u.target.value),placeholder:"Search keys and values...",className:"w-full pl-8 pr-8 py-1.5 text-sm bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-primary-500 focus:border-transparent",autoFocus:!0}),d&&e.jsx("button",{onClick:()=>p(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:e.jsx(B,{className:"h-3.5 w-3.5"})})]})}),P]})}function Re({data:t,toolbarState:a,maxHeight:l=400,searchBar:o}){const y=`${a.expandAllTrigger}-${a.collapseAllTrigger}`,s=a.expandAllTrigger>a.collapseAllTrigger,x=s?100:a.collapseAllTrigger>0?0:2;return e.jsxs("div",{children:[o,e.jsx(ye,{data:t,inline:!0,maxHeight:l,initialExpanded:s||a.expandAllTrigger===0,maxInitialDepth:x,searchable:!1,showToolbar:!1,externalSearchTerm:a.searchTerm},y)]})}function Pe(){const[t,a]=i.useState({expandAllTrigger:0,collapseAllTrigger:0,showSearch:!1,searchTerm:""}),[l,o]=i.useState(!1),y=i.useCallback(()=>{a(n=>({...n,expandAllTrigger:n.expandAllTrigger+1}))},[]),s=i.useCallback(()=>{a(n=>({...n,collapseAllTrigger:n.collapseAllTrigger+1}))},[]),x=i.useCallback(()=>{a(n=>({...n,showSearch:!n.showSearch,searchTerm:n.showSearch?"":n.searchTerm}))},[]),j=i.useCallback(n=>{a(g=>({...g,searchTerm:n}))},[]),N=i.useCallback(async n=>{try{await navigator.clipboard.writeText(JSON.stringify(n,null,2)),o(!0),$.success("Copied!"),setTimeout(()=>o(!1),2e3)}catch{$.error("Failed to copy")}},[]),f=({data:n})=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx("button",{onClick:y,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Expand all",children:e.jsx(H,{className:"h-3.5 w-3.5 text-gray-500"})}),e.jsx("button",{onClick:s,className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Collapse all",children:e.jsx(G,{className:"h-3.5 w-3.5 text-gray-500"})}),e.jsx("div",{className:"w-px h-4 bg-gray-300 dark:bg-gray-600 mx-1"}),e.jsx("button",{onClick:x,className:`p-1.5 rounded transition-colors ${t.showSearch?"bg-primary-100 dark:bg-primary-900/30 text-primary-600 dark:text-primary-400":"hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-500"}`,title:"Search",children:e.jsx(L,{className:"h-3.5 w-3.5"})}),n&&e.jsx("button",{onClick:()=>N(n),className:"p-1.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded transition-colors",title:"Copy JSON",children:l?e.jsx(W,{className:"h-3.5 w-3.5 text-green-500"}):e.jsx(I,{className:"h-3.5 w-3.5 text-gray-500"})})]}),c=t.showSearch?e.jsx("div",{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"relative",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-gray-400"}),e.jsx("input",{type:"text",value:t.searchTerm,onChange:n=>j(n.target.value),placeholder:"Search keys and values...",className:"w-full pl-8 pr-8 py-1.5 text-sm bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded focus:ring-2 focus:ring-primary-500 focus:border-transparent",autoFocus:!0}),t.searchTerm&&e.jsx("button",{onClick:()=>j(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:e.jsx(B,{className:"h-3.5 w-3.5"})})]})}):null;return{state:t,Toolbar:f,SearchBar:c}}function Oe({entry:t}){return e.jsx("div",{className:"flex items-center space-x-3",children:X(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"requests",children:nt(t.payload.path,t.payload.method)}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.path})]}):Y(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"queries",filterType:"types",children:ot(t.payload.query)}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.query.length>100?t.payload.query.substring(0,100)+"...":t.payload.query})]}):Z(t)?(()=>{var l;const a=t.payload.name&&t.payload.name.toLowerCase()!=="error"?t.payload.name:t.payload.code?String(t.payload.code):"Exception";return e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"exceptions",filterType:"names",children:a}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:((l=t.payload.request)==null?void 0:l.url)||t.payload.message})]})})():K(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"logs",filterType:"levels",children:t.payload.level.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.message.length>100?t.payload.message.substring(0,100)+"...":t.payload.message})]}):re(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"events",filterType:"names",children:t.payload.name}),e.jsxs("h1",{className:"text-sm text-gray-600 dark:text-gray-300",children:[t.payload.listeners.length," listener",t.payload.listeners.length!==1?"s":""," · ",t.payload.duration,"ms"]})]}):le(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"jobs",filterType:"statuses",filterValue:t.payload.status,children:t.payload.status.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.name}),e.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[t.payload.queue," · ",t.payload.duration?`${t.payload.duration}ms`:"-"]})]}):ie(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"cache",filterType:"operations",filterValue:t.payload.operation,children:t.payload.operation.toUpperCase()}),t.payload.operation==="get"&&e.jsx(h,{listType:"cache",children:t.payload.hit?"HIT":"MISS"}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.key.length>60?t.payload.key.substring(0,60)+"...":t.payload.key})]}):ne(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"mail",filterType:"statuses",filterValue:t.payload.status,children:t.payload.status.toUpperCase()}),e.jsx("h1",{className:"text-sm text-gray-900 dark:text-white truncate",children:t.payload.subject.length>60?t.payload.subject.substring(0,60)+"...":t.payload.subject})]}):oe(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"schedule",filterType:"statuses",filterValue:t.payload.status,children:t.payload.status.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.name}),t.payload.cron&&e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 font-mono",children:t.payload.cron})]}):ee(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"http-client",filterType:"methods",filterValue:t.payload.method,children:t.payload.method}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.hostname||t.payload.url})]}):ce(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"redis",filterType:"commands",filterValue:t.payload.command,children:t.payload.command}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.keyPattern||"Redis Command"})]}):de(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"models",filterType:"actions",filterValue:t.payload.action,children:t.payload.action.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.entity})]}):xe(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"notifications",filterType:"types",filterValue:t.payload.type,children:t.payload.type}),e.jsx("h1",{className:"text-sm text-gray-900 dark:text-white truncate",children:t.payload.title||t.payload.recipient})]}):pe(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"views",filterType:"statuses",filterValue:t.payload.status,children:t.payload.status.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.template})]}):me(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"commands",filterType:"statuses",filterValue:t.payload.status,children:t.payload.status.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.name})]}):he(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"gates",filterType:"results",filterValue:t.payload.allowed?"ALLOWED":"DENIED",children:t.payload.allowed?"ALLOWED":"DENIED"}),e.jsx("h1",{className:"text-sm text-gray-900 dark:text-white truncate",children:t.payload.gate})]}):ge(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"batches",filterType:"statuses",filterValue:t.payload.status,children:t.payload.status.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.name})]}):ue(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"dumps",filterType:"operations",filterValue:t.payload.operation,children:t.payload.operation.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.format})]}):te(t)?e.jsxs(e.Fragment,{children:[e.jsx(h,{listType:"graphql",filterType:"operationTypes",filterValue:t.payload.operationType,children:t.payload.operationType.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.payload.operationName||"(anonymous)"}),t.payload.hasErrors&&e.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 text-xs font-medium rounded bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",children:"Error"})]}):(()=>{const a=t;return e.jsxs(e.Fragment,{children:[e.jsx(h,{clickable:!1,children:a.type.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:a.requestId||`#${a.id}`})]})})()})}function Ie({entry:t}){const[a,l]=i.useState(t.tags??[]);return e.jsx("div",{className:"card","data-testid":"entry-tags",children:e.jsxs("div",{className:"p-4 flex items-center gap-3 flex-wrap",children:[e.jsx("span",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Tags"}),e.jsx(Ae,{entryId:t.id,tags:a,editable:!0,onTagsChange:l})]})})}function Fe({entry:t}){return e.jsxs("div",{className:"flex items-center space-x-3","data-testid":"plain-heading",children:[e.jsx(h,{clickable:!1,children:t.type.toUpperCase()}),e.jsx("h1",{className:"text-sm font-mono text-gray-900 dark:text-white truncate",children:t.requestId||`#${t.id}`})]})}function ze({entry:t}){return e.jsxs("div",{className:"card","data-testid":"raw-payload",children:[e.jsxs("div",{className:"p-4 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:"Entry payload"}),e.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:["This entry does not have the shape the ",t.type," view expects, so it is shown as it was recorded."]})]}),e.jsx("div",{className:"p-4",children:e.jsx(ye,{data:t.payload??{},inline:!0})})]})}function Me(){return e.jsxs("div",{className:"animate-pulse space-y-3","aria-hidden":"true",children:[e.jsx("div",{className:"h-8 rounded bg-gray-100 dark:bg-gray-800"}),e.jsx("div",{className:"h-40 rounded bg-gray-100 dark:bg-gray-800"})]})}const Ue=i.lazy(()=>b(()=>import("./RequestDetailView-D0pFJlIF.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url)),qe=i.lazy(()=>b(()=>import("./QueryDetailView-BkUuf3JM.js"),__vite__mapDeps([9,1,2,3,4,5,6,8]),import.meta.url)),Je=i.lazy(()=>b(()=>import("./ExceptionDetailView-BD375JkM.js"),__vite__mapDeps([10,1,2,3,4,5,6,8]),import.meta.url)),Be=i.lazy(()=>b(()=>import("./LogDetailView--AEX1d6S.js"),__vite__mapDeps([11,1,2,3,4,5,6,8]),import.meta.url)),We=i.lazy(()=>b(()=>import("./EventDetailView-i_T5zzxK.js"),__vite__mapDeps([12,1,2,3,13,6,4,14,15,8]),import.meta.url)),He=i.lazy(()=>b(()=>import("./JobDetailView-4qAPrQWH.js"),__vite__mapDeps([16,1,2,3,4,5,6,13,17,18,8]),import.meta.url)),Ge=i.lazy(()=>b(()=>import("./CacheDetailView-CcGupoLQ.js"),__vite__mapDeps([19,1,2,3,4,5,6,13,18,20,21,8]),import.meta.url)),Qe=i.lazy(()=>b(()=>import("./MailDetailView-BPFRJcUh.js"),__vite__mapDeps([22,1,2,3,6,4,5,13,20,18,15,17,8]),import.meta.url)),Xe=i.lazy(()=>b(()=>import("./ScheduleDetailView-BPjjgHxu.js"),__vite__mapDeps([23,1,2,3,24,6,4,5,20,18,21,25]),import.meta.url)),Ye=i.lazy(()=>b(()=>import("./HttpClientDetailView-yb-3URIg.js"),__vite__mapDeps([26,1,2,3,4,5,6,8]),import.meta.url)),Ze=i.lazy(()=>b(()=>import("./RedisDetailView-EHqxefP1.js"),__vite__mapDeps([27,1,2,3,4,5,6,13,18,20,8]),import.meta.url)),Ke=i.lazy(()=>b(()=>import("./ModelDetailView-BDzUh_Kg.js"),__vite__mapDeps([28,1,2,3,4,5,6,13,20,8]),import.meta.url)),et=i.lazy(()=>b(()=>import("./NotificationDetailView-D-wwNBBg.js"),__vite__mapDeps([29,1,2,3,4,5,6,13,18,20,30,8]),import.meta.url)),tt=i.lazy(()=>b(()=>import("./ViewDetailView-DzuPi6K1.js"),__vite__mapDeps([31,1,2,3,4,5,6,13,32,18,20,8]),import.meta.url)),at=i.lazy(()=>b(()=>import("./CommandDetailView-CVZrIKo6.js"),__vite__mapDeps([33,1,2,3,4,5,6,13,18,20,8]),import.meta.url)),st=i.lazy(()=>b(()=>import("./GateDetailView-DjS0BcxS.js"),__vite__mapDeps([34,1,2,3,4,5,6,13,18,20,8]),import.meta.url)),rt=i.lazy(()=>b(()=>import("./BatchDetailView-MwxKpCBw.js"),__vite__mapDeps([35,1,2,3,4,5,6,13,20,17,18,8]),import.meta.url)),lt=i.lazy(()=>b(()=>import("./DumpDetailView-C3AszicE.js"),__vite__mapDeps([36,1,2,3,4,5,6,13,18,20,8]),import.meta.url)),it=i.lazy(()=>b(()=>import("./GraphQLDetailView-BubeJCJT.js"),__vite__mapDeps([37,1,2,3,4,5,6,38,7,8,14,30]),import.meta.url));function nt(t,a){return t!=null&&t.toLowerCase().includes("/graphql")?"GRAPHQL":a.toUpperCase()}function ot(t){const a=t.trim().toUpperCase();return a.startsWith("SELECT")?"SELECT":a.startsWith("INSERT")?"INSERT":a.startsWith("UPDATE")?"UPDATE":a.startsWith("DELETE")?"DELETE":a.startsWith("CREATE")?"CREATE":a.startsWith("ALTER")?"ALTER":a.startsWith("DROP")?"DROP":a.startsWith("TRUNCATE")?"TRUNCATE":a.startsWith("BEGIN")||a.startsWith("START")?"TRANSACTION":a.startsWith("COMMIT")?"COMMIT":a.startsWith("ROLLBACK")?"ROLLBACK":"QUERY"}function ct(){var f;const{id:t}=Ne(),[a,l]=i.useState({entry:null,related:[]}),o=Pe(),y=a.id!==t,s=a.entry,x=a.related;if(i.useEffect(()=>{let c=!0;return(async()=>{if(t)try{const g=await we(parseInt(t,10));c&&l({id:t,entry:g.data,related:g.related??[]})}catch(g){console.error("Failed to fetch entry:",g);const w=g instanceof Error?g:new Error("Failed to load this entry"),r=/\b404\b/.test(w.message);c&&l({id:t,entry:null,related:[],failure:r?void 0:w})}})(),()=>{c=!1}},[t]),y)return e.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});if(!s){const c=a.failure;return e.jsxs("div",{className:"text-center py-12",role:c?"alert":void 0,children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900 dark:text-white","data-testid":c?"entry-error":"entry-missing",children:c?"Could not load this entry":"Entry not found"}),c&&e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:c.message}),e.jsx(J,{to:"/",className:"text-primary-600 hover:text-primary-700 mt-4 inline-block",children:"Go back to dashboard"})]})}const j=()=>{if(X(s))return e.jsx(Ue,{entry:s,related:x});if(Y(s))return e.jsx(qe,{entry:s});if(Z(s))return e.jsx(Je,{entry:s});if(K(s))return e.jsx(Be,{entry:s});if(re(s))return e.jsx(We,{entry:s});if(le(s))return e.jsx(He,{entry:s});if(ie(s))return e.jsx(Ge,{entry:s});if(ne(s))return e.jsx(Qe,{entry:s});if(oe(s))return e.jsx(Xe,{entry:s});if(ee(s))return e.jsx(Ye,{entry:s});if(ce(s))return e.jsx(Ze,{entry:s});if(de(s))return e.jsx(Ke,{entry:s});if(xe(s))return e.jsx(et,{entry:s});if(pe(s))return e.jsx(tt,{entry:s});if(me(s))return e.jsx(at,{entry:s});if(he(s))return e.jsx(st,{entry:s});if(ge(s))return e.jsx(rt,{entry:s});if(ue(s))return e.jsx(lt,{entry:s});if(te(s))return e.jsx(it,{entry:s});const n=s.payload,g=[{id:"payload",label:"Payload",content:e.jsx(Re,{data:n,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})}];return e.jsx(Se,{tabs:g,defaultTab:"payload",headerRight:e.jsx(o.Toolbar,{data:n})})},N=`/${((f=Ce(s.type))==null?void 0:f.route)??"requests"}`;return e.jsxs("div",{children:[e.jsx("div",{className:"fixed top-0 left-0 right-0 lg:left-64 z-30 h-16 bg-gray-50 dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center space-x-4 px-4 lg:px-6 h-full",children:[e.jsx(J,{to:N,"aria-label":`Back to ${N.slice(1)}`,className:"p-2 hover:bg-gray-200 dark:hover:bg-gray-800 rounded-lg transition-colors",children:e.jsx(_e,{className:"h-5 w-5 text-gray-500"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(ae,{fallback:e.jsx(Fe,{entry:s}),children:e.jsx(Oe,{entry:s})},`heading-${s.id}`)})]})}),e.jsxs("div",{className:"pt-16 space-y-6",children:[e.jsx(Ie,{entry:s}),e.jsx(ae,{fallback:e.jsx(ze,{entry:s}),children:e.jsx(i.Suspense,{fallback:e.jsx(Me,{}),children:j()})},s.id),x.length>0&&e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:["Related Entries (",x.length,")"]})}),e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-gray-700",children:x.map(c=>e.jsx(J,{to:dt(c),className:"p-4 block hover:bg-gray-50 dark:hover:bg-gray-700/50 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(h,{clickable:!1,children:c.type.toUpperCase()}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:xt(c)})]}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:ve(Te(c.createdAt),{addSuffix:!0})})]})},c.id))})]})]})]})}function dt(t){return`/${{request:"requests",query:"queries",exception:"exceptions",log:"logs",event:"events",job:"jobs",cache:"cache",mail:"mail",schedule:"schedule","http-client":"http-client",redis:"redis",model:"models",notification:"notifications",view:"views",command:"commands",gate:"gates",batch:"batches",dump:"dumps",graphql:"graphql"}[t.type]||"entries"}/${t.id}`}function xt(t){if(Y(t)){const a=t.payload.query;return a.length>50?a.substring(0,50)+"...":a}if(Z(t))return`${t.payload.name}: ${t.payload.message}`;if(K(t)){const a=t.payload.message;return a.length>50?a.substring(0,50)+"...":a}return X(t)?`${t.payload.method} ${t.payload.path}`:ee(t)?`${t.payload.method} ${t.payload.hostname||t.payload.url}`:te(t)?`${t.payload.operationType} ${t.payload.operationName||"(anonymous)"}`:`Entry #${t.id}`}const yt=Object.freeze(Object.defineProperty({__proto__:null,default:ct},Symbol.toStringTag,{value:"Module"}));export{Re as C,yt as E,H as M,Se as T,W as a,I as b,G as c,Pe as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,X as p}from"./index-CNTaNUkj.js";import{f as g,b as o}from"./vendor-DBTT3jXp.js";import{S as x}from"./search-CcMiea1V.js";function S({placeholder:n="Search..."}){const[u,l]=g(),r=u.get("search")??"",[e,s]=o.useState(r),[h,i]=o.useState(r);return r!==h&&(i(r),s(r)),o.useEffect(()=>{const c=setTimeout(()=>{l(m=>{const a=new URLSearchParams(m);return(a.get("search")||"")===e||(e?a.set("search",e):a.delete("search")),a},{replace:!0})},350);return()=>clearTimeout(c)},[e,l]),t.jsxs("div",{className:"relative",children:[t.jsx(x,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400 pointer-events-none"}),t.jsx("input",{type:"text",value:e,onChange:c=>s(c.target.value),placeholder:n,"aria-label":n,className:"w-full pl-9 pr-9 py-2 text-sm rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),e&&t.jsx("button",{onClick:()=>s(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":"Clear search",children:t.jsx(p,{className:"h-4 w-4"})})]})}export{S as E};
|