nestlens 0.19.0 → 0.20.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.
Files changed (127) hide show
  1. package/README.md +21 -4
  2. package/dist/api/api.controller.js +4 -1
  3. package/dist/api/dashboard-server.d.ts +10 -1
  4. package/dist/api/dashboard-server.js +20 -2
  5. package/dist/api/index.d.ts +1 -0
  6. package/dist/api/index.js +1 -0
  7. package/dist/api/spa-wildcard.js +2 -2
  8. package/dist/api/watcher-status.controller.d.ts +12 -0
  9. package/dist/api/watcher-status.controller.js +54 -0
  10. package/dist/core/nest-metadata-keys.d.ts +16 -0
  11. package/dist/core/nest-metadata-keys.js +19 -0
  12. package/dist/dashboard/public/assets/{BatchDetailView-BfNZfpm_.js → BatchDetailView-BBWr4W04.js} +1 -1
  13. package/dist/dashboard/public/assets/{BatchesPage-BZHbl0Nm.js → BatchesPage-C-KQEmp4.js} +1 -1
  14. package/dist/dashboard/public/assets/{CacheDetailView-BvkeOKgE.js → CacheDetailView-DdG4e_go.js} +1 -1
  15. package/dist/dashboard/public/assets/{CachePage-BkUGvWEZ.js → CachePage-C0cLGRx1.js} +1 -1
  16. package/dist/dashboard/public/assets/{CommandDetailView-CVbt9JyP.js → CommandDetailView-BDuo8F9v.js} +1 -1
  17. package/dist/dashboard/public/assets/{CommandsPage-C6XHUgrA.js → CommandsPage-B7SnQNr7.js} +1 -1
  18. package/dist/dashboard/public/assets/{CopyButton-XYdI3-sW.js → CopyButton-CLJDLZpF.js} +1 -1
  19. package/dist/dashboard/public/assets/{DashboardPage--iglBlz3.js → DashboardPage-BCDSCg7B.js} +1 -1
  20. package/dist/dashboard/public/assets/DataTable-DXp-7bHh.js +68 -0
  21. package/dist/dashboard/public/assets/{DetailRow-B0S3c_eE.js → DetailRow-8MgXx8DK.js} +1 -1
  22. package/dist/dashboard/public/assets/{DumpDetailView-Da-47VLM.js → DumpDetailView-KbumlBos.js} +1 -1
  23. package/dist/dashboard/public/assets/{DumpsPage-CsNW6qr3.js → DumpsPage-BtuFC_VC.js} +1 -1
  24. package/dist/dashboard/public/assets/{EntryDetailPage-D_OaKS4_.js → EntryDetailPage-HykUOnNH.js} +3 -3
  25. package/dist/dashboard/public/assets/{EntrySearchInput-9QSG15Ph.js → EntrySearchInput-CuQ4LdWy.js} +1 -1
  26. package/dist/dashboard/public/assets/{EventDetailView-BgmXCQ6t.js → EventDetailView-zhbmW-hn.js} +1 -1
  27. package/dist/dashboard/public/assets/{EventsPage-CqVw-u8H.js → EventsPage-CyH3D7jC.js} +1 -1
  28. package/dist/dashboard/public/assets/{ExceptionDetailView-CsLEb3Zl.js → ExceptionDetailView-o7M33_ij.js} +1 -1
  29. package/dist/dashboard/public/assets/{ExceptionsPage-T0wlOFSt.js → ExceptionsPage-CH3bwPKa.js} +2 -2
  30. package/dist/dashboard/public/assets/{GateDetailView-CaxZBQOa.js → GateDetailView-DllUcXFS.js} +1 -1
  31. package/dist/dashboard/public/assets/{GatesPage-Chd15G_e.js → GatesPage-DmaLHvcn.js} +1 -1
  32. package/dist/dashboard/public/assets/{GraphQLDetailView-Du2b9rrV.js → GraphQLDetailView-D2PGtFBT.js} +1 -1
  33. package/dist/dashboard/public/assets/{GraphQLPage-BHLuBaJe.js → GraphQLPage-C9vpbdH6.js} +2 -2
  34. package/dist/dashboard/public/assets/{HttpClientDetailView-BidIN8T6.js → HttpClientDetailView-MF_QMfeV.js} +1 -1
  35. package/dist/dashboard/public/assets/{HttpClientPage-CJK_r82g.js → HttpClientPage-DTI0P6Cr.js} +1 -1
  36. package/dist/dashboard/public/assets/{JobDetailView-B_hBS0H6.js → JobDetailView-OpMwViVl.js} +1 -1
  37. package/dist/dashboard/public/assets/{JobsPage-DYplYu68.js → JobsPage-CMmHdxT2.js} +1 -1
  38. package/dist/dashboard/public/assets/{LogDetailView-CnQ5dEkg.js → LogDetailView-DWFZhpkp.js} +1 -1
  39. package/dist/dashboard/public/assets/{LogsPage-D_j4e2ms.js → LogsPage-BR6UekMh.js} +1 -1
  40. package/dist/dashboard/public/assets/{MailDetailView-BR5Iv4i2.js → MailDetailView-C0MrGurU.js} +1 -1
  41. package/dist/dashboard/public/assets/{MailPage-C-Gz1aq0.js → MailPage-ChltUgHi.js} +1 -1
  42. package/dist/dashboard/public/assets/{ModelDetailView-BwHWLQyS.js → ModelDetailView-DWa2dZYT.js} +1 -1
  43. package/dist/dashboard/public/assets/{ModelsPage-C9UNHFoO.js → ModelsPage-DkjCQhyB.js} +1 -1
  44. package/dist/dashboard/public/assets/{NotificationDetailView-C1SGLmvR.js → NotificationDetailView-CKa4tpI6.js} +1 -1
  45. package/dist/dashboard/public/assets/{NotificationsPage-BBnuLMwb.js → NotificationsPage-CkHRVfMp.js} +1 -1
  46. package/dist/dashboard/public/assets/{PageHeader-Bi85xmzF.js → PageHeader-C3xvY2Ig.js} +1 -1
  47. package/dist/dashboard/public/assets/{QueriesPage-DBhfQ1NO.js → QueriesPage-BS1qr6PD.js} +1 -1
  48. package/dist/dashboard/public/assets/{QueryDetailView-xawOoEVO.js → QueryDetailView-oGlkJiXP.js} +1 -1
  49. package/dist/dashboard/public/assets/{RedisDetailView-BmE_L9g1.js → RedisDetailView-CqG6vCHq.js} +1 -1
  50. package/dist/dashboard/public/assets/{RedisPage-B4qORWJh.js → RedisPage-Dzf1nPXQ.js} +1 -1
  51. package/dist/dashboard/public/assets/{RequestDetailView-mFqH5MaS.js → RequestDetailView-DIxihCyo.js} +1 -1
  52. package/dist/dashboard/public/assets/{RequestsPage-Dcr0E2Lm.js → RequestsPage-D-Qkv8_m.js} +1 -1
  53. package/dist/dashboard/public/assets/{ScheduleDetailView-B41y0uev.js → ScheduleDetailView-CsVweTzt.js} +1 -1
  54. package/dist/dashboard/public/assets/{SchedulePage-BNAftAAQ.js → SchedulePage-DOYjiFkr.js} +1 -1
  55. package/dist/dashboard/public/assets/{UserCard-Dmx7j2Ir.js → UserCard-Czdl3BwE.js} +1 -1
  56. package/dist/dashboard/public/assets/{ViewDetailView-DzBFVrXH.js → ViewDetailView-BRtVIr5a.js} +1 -1
  57. package/dist/dashboard/public/assets/{ViewsPage-BXMF23JP.js → ViewsPage-CJYaQD3m.js} +1 -1
  58. package/dist/dashboard/public/assets/{calendar-Ppb5e_1B.js → calendar-bOGpQhaX.js} +1 -1
  59. package/dist/dashboard/public/assets/{circle-alert-DVIWjKkL.js → circle-alert-BAv3_SCD.js} +1 -1
  60. package/dist/dashboard/public/assets/{circle-check-big-DgeP_jno.js → circle-check-big-Bd3maByp.js} +1 -1
  61. package/dist/dashboard/public/assets/{circle-x-CSvWnKSC.js → circle-x-DuIWQOMZ.js} +1 -1
  62. package/dist/dashboard/public/assets/{eye-Barcwmeq.js → eye-B9n6gdoj.js} +1 -1
  63. package/dist/dashboard/public/assets/index-DvT5dtlP.css +1 -0
  64. package/dist/dashboard/public/assets/{index-Oh_UboeF.js → index-ZBhBsEE-.js} +55 -55
  65. package/dist/dashboard/public/assets/{search-C3TNb54L.js → search-DEpjS1hS.js} +1 -1
  66. package/dist/dashboard/public/assets/{send-CeQr2ikp.js → send-CUGirmLQ.js} +1 -1
  67. package/dist/dashboard/public/assets/{timer-DIZVbXrL.js → timer-chx4YN2F.js} +1 -1
  68. package/dist/dashboard/public/assets/{types-Be5ENIEY.js → types-DqgiyrZ3.js} +1 -1
  69. package/dist/dashboard/public/assets/{users-Bt96KxXr.js → users-BG41jdoO.js} +1 -1
  70. package/dist/dashboard/public/assets/{zap-FCdKJjm5.js → zap-CP3Qh2HO.js} +1 -1
  71. package/dist/dashboard/public/index.html +2 -2
  72. package/dist/nestlens.module.js +18 -4
  73. package/dist/startup-summary.d.ts +11 -0
  74. package/dist/startup-summary.js +23 -1
  75. package/dist/watchers/batch.watcher.d.ts +6 -1
  76. package/dist/watchers/batch.watcher.js +24 -0
  77. package/dist/watchers/cache.watcher.d.ts +4 -1
  78. package/dist/watchers/cache.watcher.js +19 -0
  79. package/dist/watchers/command.watcher.d.ts +4 -1
  80. package/dist/watchers/command.watcher.js +18 -0
  81. package/dist/watchers/dump.watcher.d.ts +6 -1
  82. package/dist/watchers/dump.watcher.js +24 -0
  83. package/dist/watchers/event.watcher.d.ts +4 -1
  84. package/dist/watchers/event.watcher.js +20 -2
  85. package/dist/watchers/exception.watcher.d.ts +26 -26
  86. package/dist/watchers/exception.watcher.js +71 -26
  87. package/dist/watchers/gate.watcher.d.ts +6 -1
  88. package/dist/watchers/gate.watcher.js +24 -0
  89. package/dist/watchers/graphql/adapters/apollo-plugin.provider.d.ts +20 -3
  90. package/dist/watchers/graphql/adapters/apollo-plugin.provider.js +36 -16
  91. package/dist/watchers/graphql/adapters/mercurius-registrar.service.d.ts +5 -1
  92. package/dist/watchers/graphql/adapters/mercurius-registrar.service.js +16 -4
  93. package/dist/watchers/graphql/graphql.watcher.d.ts +28 -7
  94. package/dist/watchers/graphql/graphql.watcher.js +73 -19
  95. package/dist/watchers/http-client.watcher.d.ts +4 -1
  96. package/dist/watchers/http-client.watcher.js +18 -0
  97. package/dist/watchers/job.watcher.d.ts +5 -1
  98. package/dist/watchers/job.watcher.js +27 -0
  99. package/dist/watchers/log.watcher.d.ts +5 -1
  100. package/dist/watchers/log.watcher.js +35 -0
  101. package/dist/watchers/mail.watcher.d.ts +4 -1
  102. package/dist/watchers/mail.watcher.js +20 -0
  103. package/dist/watchers/model.watcher.d.ts +6 -1
  104. package/dist/watchers/model.watcher.js +24 -0
  105. package/dist/watchers/notification.watcher.d.ts +4 -1
  106. package/dist/watchers/notification.watcher.js +19 -0
  107. package/dist/watchers/query/query.watcher.d.ts +44 -3
  108. package/dist/watchers/query/query.watcher.js +277 -37
  109. package/dist/watchers/redis.watcher.d.ts +4 -1
  110. package/dist/watchers/redis.watcher.js +19 -0
  111. package/dist/watchers/request.watcher.d.ts +3 -1
  112. package/dist/watchers/request.watcher.js +10 -0
  113. package/dist/watchers/schedule.watcher.d.ts +8 -2
  114. package/dist/watchers/schedule.watcher.js +31 -2
  115. package/dist/watchers/view.watcher.d.ts +4 -1
  116. package/dist/watchers/view.watcher.js +18 -0
  117. package/dist/watchers/watcher-status.d.ts +54 -0
  118. package/dist/watchers/watcher-status.js +43 -0
  119. package/dist/watchers/watcher-status.registry.d.ts +7 -0
  120. package/dist/watchers/watcher-status.registry.js +56 -0
  121. package/dist/watchers/watcher-status.service.d.ts +64 -0
  122. package/dist/watchers/watcher-status.service.js +112 -0
  123. package/dist/watchers/wrap-method.d.ts +2 -0
  124. package/dist/watchers/wrap-method.js +4 -0
  125. package/package.json +1 -1
  126. package/dist/dashboard/public/assets/DataTable-B_TIjhVT.js +0 -53
  127. package/dist/dashboard/public/assets/index-CMvt7uFU.css +0 -1
package/README.md CHANGED
@@ -19,6 +19,7 @@
19
19
  <a href="https://www.npmjs.com/package/nestlens"><img src="https://img.shields.io/npm/dm/nestlens.svg?style=flat-square&color=8b5cf6" alt="npm downloads" /></a>
20
20
  <a href="https://github.com/mogretici/nestlens/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-10b981.svg?style=flat-square" alt="license" /></a>
21
21
  <a href="https://github.com/mogretici/nestlens"><img src="https://img.shields.io/github/stars/mogretici/nestlens?style=flat-square&color=f59e0b" alt="stars" /></a>
22
+ <a href="https://glama.ai/mcp/servers/mogretici/nestlens"><img src="https://glama.ai/mcp/servers/mogretici/nestlens/badges/score.svg" alt="mogretici/nestlens MCP server" /></a>
22
23
  </p>
23
24
 
24
25
  <p align="center">
@@ -29,9 +30,8 @@
29
30
  </p>
30
31
 
31
32
  <p align="center">
32
- <a href="https://lutfuogretici.medium.com/nestlens-laravel-telescope-finally-comes-to-nestjs-93f5a2c1f521">
33
- <img src="https://img.shields.io/badge/Read_the_Story_on_Medium-000000?style=for-the-badge&logo=medium" alt="Medium Article" />
34
- </a>
33
+ <a href="https://lutfuogretici.medium.com/nestlens-laravel-telescope-finally-comes-to-nestjs-93f5a2c1f521"><img src="https://img.shields.io/badge/Read_the_Story_on_Medium-000000?style=for-the-badge&logo=medium" alt="Medium Article" /></a>
34
+ <a href="https://dev.to/mogretici/nestlens-laravel-telescope-finally-comes-to-nestjs-3f3o"><img src="https://img.shields.io/badge/Read_on_DEV-0A0A0A?style=for-the-badge&logo=devdotto&logoColor=white" alt="Read on DEV" /></a>
35
35
  </p>
36
36
 
37
37
  <p align="center">
@@ -110,10 +110,27 @@ Visit **http://localhost:3000/nestlens** and start debugging.
110
110
  `nestlens-mcp` is an [MCP](https://modelcontextprotocol.io) server over a running NestLens, published as its own package with the MCP SDK included. It is a hub of two tools — one lists everything NestLens can do, the other runs it — read from your application each time, so a new endpoint is available to an agent without a new release. It is read-only unless you pass `--allow-write`.
111
111
 
112
112
  ```bash
113
+ # Claude Code
113
114
  claude mcp add nestlens -- npx -y nestlens-mcp --url http://localhost:3000/nestlens
115
+
116
+ # Codex
117
+ codex mcp add nestlens -- npx -y nestlens-mcp --url http://localhost:3000/nestlens
114
118
  ```
115
119
 
116
- For a NestLens on a development or production server, run `nestlens-mcp --http` next to it and give the agent a URL. Setup for Claude Code, Cursor, VS Code and Claude Desktop is in the [MCP guide](https://nestlens-docs.vercel.app/docs/integrations/mcp).
120
+ <p>
121
+ <a href="https://vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522nestlens%2522%252C%2522type%2522%253A%2522stdio%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522nestlens-mcp%2522%252C%2522--url%2522%252C%2522http%253A%252F%252Flocalhost%253A3000%252Fnestlens%2522%255D%257D"><img src="https://img.shields.io/badge/Install_in_VS_Code-0098FF?style=for-the-badge&logo=visualstudiocode&logoColor=white" alt="Install in VS Code" /></a>
122
+ </p>
123
+
124
+ In Claude Code, the plugin adds the server and a debugging skill:
125
+
126
+ ```text
127
+ /plugin marketplace add mogretici/nestlens
128
+ /plugin install nestlens@nestlens
129
+ ```
130
+
131
+ It is listed in the [official MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.mogretici/nestlens`, so clients that browse the registry can install it from there.
132
+
133
+ For a NestLens on a development or production server, run `nestlens-mcp --http` next to it and give the agent a URL. Setup for Claude Code, Codex, VS Code, Cursor and Claude Desktop is in the [MCP guide](https://nestlens-docs.vercel.app/docs/integrations/mcp).
117
134
 
118
135
  <br/>
119
136
 
@@ -27,6 +27,7 @@ const interceptors_1 = require("../api/interceptors");
27
27
  const exceptions_1 = require("../api/exceptions");
28
28
  const tools_1 = require("./tools");
29
29
  const tag_controller_1 = require("./tag.controller");
30
+ const watcher_status_controller_1 = require("./watcher-status.controller");
30
31
  /**
31
32
  * Every handler here takes an unused `@Res() _res` parameter. It is not a
32
33
  * mistake and the value is never touched: its presence is how a handler tells
@@ -53,7 +54,9 @@ let NestLensApiController = NestLensApiController_1 = class NestLensApiControlle
53
54
  * the manifest describes the API, and an agent that has this has no use for it.
54
55
  */
55
56
  async getTools(_res) {
56
- return { data: (0, tools_1.buildToolManifest)([NestLensApiController_1, tag_controller_1.TagController]) };
57
+ return {
58
+ data: (0, tools_1.buildToolManifest)([NestLensApiController_1, tag_controller_1.TagController, watcher_status_controller_1.WatcherStatusController]),
59
+ };
57
60
  }
58
61
  async getEntries(query, _res) {
59
62
  return this.filteredPage(query.type, query);
@@ -2,6 +2,7 @@ import { DynamicModule, OnModuleDestroy, OnApplicationBootstrap, Provider } from
2
2
  import { HttpAdapterHost, ModuleRef } from '@nestjs/core';
3
3
  import type { AddressInfo } from 'net';
4
4
  import { DashboardServerConfig, NestLensConfig } from '../nestlens.config';
5
+ import { WatcherStatusService } from '../watchers/watcher-status.service';
5
6
  /** The resolved `server` block, provided only when one was configured. */
6
7
  export declare const NESTLENS_SERVER_CONFIG: unique symbol;
7
8
  /**
@@ -29,7 +30,14 @@ export declare class NestLensDashboardServer implements OnApplicationBootstrap,
29
30
  private readonly logger;
30
31
  private application?;
31
32
  private bound?;
32
- constructor(server: DashboardServerConfig, config: NestLensConfig, moduleRef: ModuleRef, adapterHost?: HttpAdapterHost | undefined);
33
+ /**
34
+ * The application's logger is switched off while the listener starts.
35
+ * Inside that window the startup report would print nowhere and read the
36
+ * logger as replaced, so it waits for this hook whatever order Nest runs
37
+ * the hooks in.
38
+ */
39
+ private readonly releaseStartupReport;
40
+ constructor(server: DashboardServerConfig, config: NestLensConfig, moduleRef: ModuleRef, adapterHost?: HttpAdapterHost | undefined, statusService?: WatcherStatusService);
33
41
  /**
34
42
  * Where the listener actually ended up, once it is listening.
35
43
  *
@@ -43,6 +51,7 @@ export declare class NestLensDashboardServer implements OnApplicationBootstrap,
43
51
  * reachable before the thing it reports on is ready.
44
52
  */
45
53
  onApplicationBootstrap(): Promise<void>;
54
+ private listen;
46
55
  onModuleDestroy(): Promise<void>;
47
56
  private hostAdapterType;
48
57
  /**
@@ -25,6 +25,8 @@ const api_controller_1 = require("./api.controller");
25
25
  const dashboard_controller_1 = require("./dashboard.controller");
26
26
  const stream_controller_1 = require("./stream.controller");
27
27
  const tag_controller_1 = require("./tag.controller");
28
+ const watcher_status_controller_1 = require("./watcher-status.controller");
29
+ const watcher_status_service_1 = require("../watchers/watcher-status.service");
28
30
  const api_guard_1 = require("./api.guard");
29
31
  const spa_wildcard_1 = require("./spa-wildcard");
30
32
  const route_path_1 = require("./route-path");
@@ -125,6 +127,7 @@ let NestLensDashboardModule = NestLensDashboardModule_1 = class NestLensDashboar
125
127
  controllers: [
126
128
  api_controller_1.NestLensApiController,
127
129
  tag_controller_1.TagController,
130
+ watcher_status_controller_1.WatcherStatusController,
128
131
  stream_controller_1.NestLensStreamController,
129
132
  dashboard_controller_1.DashboardController,
130
133
  ],
@@ -178,12 +181,13 @@ function createAdapter(preferredType) {
178
181
  * exactly as they always were.
179
182
  */
180
183
  let NestLensDashboardServer = class NestLensDashboardServer {
181
- constructor(server, config, moduleRef, adapterHost) {
184
+ constructor(server, config, moduleRef, adapterHost, statusService) {
182
185
  this.server = server;
183
186
  this.config = config;
184
187
  this.moduleRef = moduleRef;
185
188
  this.adapterHost = adapterHost;
186
189
  this.logger = new common_1.Logger('NestLens');
190
+ this.releaseStartupReport = statusService?.holdStartupReport() ?? (() => undefined);
187
191
  }
188
192
  /**
189
193
  * Where the listener actually ended up, once it is listening.
@@ -200,6 +204,14 @@ let NestLensDashboardServer = class NestLensDashboardServer {
200
204
  * reachable before the thing it reports on is ready.
201
205
  */
202
206
  async onApplicationBootstrap() {
207
+ try {
208
+ await this.listen();
209
+ }
210
+ finally {
211
+ this.releaseStartupReport();
212
+ }
213
+ }
214
+ async listen() {
203
215
  // Its own bootstrap log — route mappings for controllers the application
204
216
  // already described — would read as a second application starting up. The
205
217
  // silence is scoped to that: whatever the host was logging with is taken
@@ -291,6 +303,10 @@ let NestLensDashboardServer = class NestLensDashboardServer {
291
303
  provide: tag_service_1.TagService,
292
304
  useValue: borrow(this.moduleRef.get(tag_service_1.TagService, { strict: false })),
293
305
  },
306
+ {
307
+ provide: watcher_status_service_1.WatcherStatusService,
308
+ useValue: borrow(this.moduleRef.get(watcher_status_service_1.WatcherStatusService, { strict: false })),
309
+ },
294
310
  ];
295
311
  }
296
312
  };
@@ -300,6 +316,8 @@ exports.NestLensDashboardServer = NestLensDashboardServer = __decorate([
300
316
  __param(0, (0, common_1.Inject)(exports.NESTLENS_SERVER_CONFIG)),
301
317
  __param(1, (0, common_1.Inject)(nestlens_config_1.NESTLENS_CONFIG)),
302
318
  __param(3, (0, common_1.Optional)()),
319
+ __param(4, (0, common_1.Optional)()),
303
320
  __metadata("design:paramtypes", [Object, Object, core_1.ModuleRef,
304
- core_1.HttpAdapterHost])
321
+ core_1.HttpAdapterHost,
322
+ watcher_status_service_1.WatcherStatusService])
305
323
  ], NestLensDashboardServer);
@@ -3,5 +3,6 @@ export * from './api.guard';
3
3
  export * from './dashboard.controller';
4
4
  export * from './stream.controller';
5
5
  export * from './tag.controller';
6
+ export * from './watcher-status.controller';
6
7
  export * from './spa-wildcard';
7
8
  export * from './dashboard-server';
package/dist/api/index.js CHANGED
@@ -19,5 +19,6 @@ __exportStar(require("./api.guard"), exports);
19
19
  __exportStar(require("./dashboard.controller"), exports);
20
20
  __exportStar(require("./stream.controller"), exports);
21
21
  __exportStar(require("./tag.controller"), exports);
22
+ __exportStar(require("./watcher-status.controller"), exports);
22
23
  __exportStar(require("./spa-wildcard"), exports);
23
24
  __exportStar(require("./dashboard-server"), exports);
@@ -14,7 +14,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.SpaRouteRegistrar = exports.readExpressMajor = exports.toSpaWildcard = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
- const constants_1 = require("@nestjs/common/constants");
17
+ const nest_metadata_keys_1 = require("../core/nest-metadata-keys");
18
18
  const core_1 = require("@nestjs/core");
19
19
  const path_1 = require("path");
20
20
  const dashboard_controller_1 = require("./dashboard.controller");
@@ -125,7 +125,7 @@ let SpaRouteRegistrar = class SpaRouteRegistrar {
125
125
  if (!handler) {
126
126
  return;
127
127
  }
128
- Reflect.defineMetadata(constants_1.PATH_METADATA, (0, exports.toSpaWildcard)(adapterType, adapterType === 'express' ? (0, exports.readExpressMajor)() : undefined), handler);
128
+ Reflect.defineMetadata(nest_metadata_keys_1.PATH_METADATA_KEY, (0, exports.toSpaWildcard)(adapterType, adapterType === 'express' ? (0, exports.readExpressMajor)() : undefined), handler);
129
129
  }
130
130
  };
131
131
  exports.SpaRouteRegistrar = SpaRouteRegistrar;
@@ -0,0 +1,12 @@
1
+ import { WatcherStatusReport, WatcherStatusService } from '../watchers/watcher-status.service';
2
+ /**
3
+ * Whether each watcher can record anything. The unused `@Res() _res` is
4
+ * explained on `NestLensApiController`.
5
+ */
6
+ export declare class WatcherStatusController {
7
+ private readonly statusService;
8
+ constructor(statusService: WatcherStatusService);
9
+ getWatcherStatus(_res?: unknown): Promise<{
10
+ data: WatcherStatusReport[];
11
+ }>;
12
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.WatcherStatusController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const nestlens_config_1 = require("../nestlens.config");
18
+ const watcher_status_service_1 = require("../watchers/watcher-status.service");
19
+ const api_guard_1 = require("./api.guard");
20
+ const api_exception_filter_1 = require("./filters/api-exception.filter");
21
+ const api_response_interceptor_1 = require("./interceptors/api-response.interceptor");
22
+ const tools_1 = require("./tools");
23
+ const pipes_1 = require("./pipes");
24
+ /**
25
+ * Whether each watcher can record anything. The unused `@Res() _res` is
26
+ * explained on `NestLensApiController`.
27
+ */
28
+ let WatcherStatusController = class WatcherStatusController {
29
+ constructor(statusService) {
30
+ this.statusService = statusService;
31
+ }
32
+ async getWatcherStatus(_res) {
33
+ return { data: this.statusService.statuses() };
34
+ }
35
+ };
36
+ exports.WatcherStatusController = WatcherStatusController;
37
+ __decorate([
38
+ (0, tools_1.NestLensTool)({
39
+ description: 'Every watcher and whether it can record anything: `off` (switched off in the configuration), `recording` (attached and recording), `waiting` (switched on, with nothing attached to observe, so it records nothing) or `manual` (records only what the application code hands its manual API). Each comes with a one-line reason and the documentation page with the fix. Call this when a type has no entries, to tell an idle system from a watcher that cannot see anything — "why is the Redis tab empty?"',
40
+ }),
41
+ (0, common_1.Get)(),
42
+ __param(0, (0, common_1.Res)()),
43
+ __metadata("design:type", Function),
44
+ __metadata("design:paramtypes", [Object]),
45
+ __metadata("design:returntype", Promise)
46
+ ], WatcherStatusController.prototype, "getWatcherStatus", null);
47
+ exports.WatcherStatusController = WatcherStatusController = __decorate([
48
+ (0, common_1.Controller)(`${nestlens_config_1.NESTLENS_API_PREFIX}/api/watchers`),
49
+ (0, common_1.UsePipes)(new pipes_1.NestLensValidationPipe()),
50
+ (0, common_1.UseGuards)(api_guard_1.NestLensGuard),
51
+ (0, common_1.UseFilters)(api_exception_filter_1.NestLensApiExceptionFilter),
52
+ (0, common_1.UseInterceptors)(api_response_interceptor_1.NestLensApiResponseInterceptor),
53
+ __metadata("design:paramtypes", [watcher_status_service_1.WatcherStatusService])
54
+ ], WatcherStatusController);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The keys Nest writes its decorator metadata under, for the ones NestLens
3
+ * reads or writes itself.
4
+ *
5
+ * Inlined rather than imported from `@nestjs/common/constants`, which is not
6
+ * part of the package's public API (the same reasoning as `HTTP_CODE_METADATA`
7
+ * in the response interceptor and the keys in the tool manifest). Identical in
8
+ * NestJS 9, 10, 11 and 12; `nest-metadata-keys.spec.ts` asserts each still
9
+ * matches, so a rename fails a test rather than a mount point or a status.
10
+ */
11
+ /** A controller's route prefix, written by `@Controller()`. */
12
+ export declare const PATH_METADATA_KEY = "path";
13
+ /** A controller's version, written by `@Controller({ version })` and `@Version()`. */
14
+ export declare const VERSION_METADATA_KEY = "__version__";
15
+ /** The exception types a filter handles, written by `@Catch()`. */
16
+ export declare const FILTER_CATCH_EXCEPTIONS_KEY = "__filterCatchExceptions__";
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * The keys Nest writes its decorator metadata under, for the ones NestLens
4
+ * reads or writes itself.
5
+ *
6
+ * Inlined rather than imported from `@nestjs/common/constants`, which is not
7
+ * part of the package's public API (the same reasoning as `HTTP_CODE_METADATA`
8
+ * in the response interceptor and the keys in the tool manifest). Identical in
9
+ * NestJS 9, 10, 11 and 12; `nest-metadata-keys.spec.ts` asserts each still
10
+ * matches, so a rename fails a test rather than a mount point or a status.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.FILTER_CATCH_EXCEPTIONS_KEY = exports.VERSION_METADATA_KEY = exports.PATH_METADATA_KEY = void 0;
14
+ /** A controller's route prefix, written by `@Controller()`. */
15
+ exports.PATH_METADATA_KEY = 'path';
16
+ /** A controller's version, written by `@Controller({ version })` and `@Version()`. */
17
+ exports.VERSION_METADATA_KEY = '__version__';
18
+ /** The exception types a filter handles, written by `@Catch()`. */
19
+ exports.FILTER_CATCH_EXCEPTIONS_KEY = '__filterCatchExceptions__';
@@ -1 +1 @@
1
- import{j as e,L as o,A as y,C as u}from"./index-Oh_UboeF.js";import{p as n,f as v}from"./date-Dwgqy666.js";import{D as r,f as k}from"./DetailRow-B0S3c_eE.js";import{C as m}from"./types-Be5ENIEY.js";import{C as w}from"./CopyButton-XYdI3-sW.js";import{C as g}from"./circle-x-CSvWnKSC.js";import{C as j}from"./circle-alert-DVIWjKkL.js";import{C}from"./circle-check-big-DgeP_jno.js";import"./vendor-DBTT3jXp.js";import"./EntryDetailPage-D_OaKS4_.js";import"./search-C3TNb54L.js";const p={completed:{icon:C,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},partial:{icon:j,color:"text-yellow-500",bg:"bg-yellow-100 dark:bg-yellow-900/30"},failed:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"}};function h(a){return a?a<1024?`${a}B`:a<1024*1024?`${(a/1024).toFixed(1)}KB`:a<1024*1024*1024?`${(a/(1024*1024)).toFixed(1)}MB`:`${(a/(1024*1024*1024)).toFixed(1)}GB`:"-"}function E({entry:a}){const{payload:s,createdAt:c}=a,t=p[s.status]||p.completed,f=t.icon,{processedItems:x,totalItems:d,failedItems:l}=s,i=d>0?Math.round(x/d*100):0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(o,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Batch Operation"})]})]}),e.jsx(w,{text:s.name,label:"Copy batch name"})]})}),e.jsxs("div",{className:`grid ${s.memory!==void 0?"grid-cols-2 md:grid-cols-5":"grid-cols-2 md:grid-cols-4"} divide-x divide-gray-200 dark:divide-gray-700`,children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:s.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Progress"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[i,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"%"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),l>0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Failed"})]}),e.jsx("p",{className:"text-lg font-bold text-red-600 dark:text-red-400",children:l})]}),s.memory!==void 0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Memory"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:h(s.memory)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"*:not-first:border-y-0",children:[e.jsx(r,{label:"Time",value:e.jsxs("span",{children:[k(n(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(n(c),{addSuffix:!0}),")"]})]})}),e.jsx(r,{label:"Name",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.name})}),s.operation&&e.jsx(r,{label:"Operation",value:e.jsx(m,{listType:"batches",filterType:"operations",filterValue:s.operation,children:s.operation})}),e.jsx(r,{label:"Status",value:e.jsx(m,{listType:"batches",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(r,{label:"Progress",value:e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-mono",children:[x," / ",d," (",i,"%)"]}),e.jsx("div",{className:"mt-2 w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx("div",{className:"bg-blue-600 dark:bg-blue-500 h-2 rounded-full transition-all",style:{width:`${i}%`}})})]})}),l>0&&e.jsx(r,{label:"Failed Items",value:e.jsx("span",{className:"text-red-600 dark:text-red-400 font-mono",children:l})}),e.jsx(r,{label:"Duration",value:`${s.duration}ms`}),s.batchSize&&e.jsx(r,{label:"Batch Size",value:s.batchSize}),s.memory!==void 0&&e.jsx(r,{label:"Memory",value:h(s.memory)})]})})]}),s.errors&&s.errors.length>0&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{className:"h-5 w-5 text-red-500"}),e.jsxs("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:["Errors (",s.errors.length,")"]})]})}),e.jsx("div",{className:"divide-y divide-red-200 dark:divide-red-800",children:s.errors.map((b,N)=>e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:b})},N))})]})]})}export{E as default};
1
+ import{j as e,L as o,A as y,C as u}from"./index-ZBhBsEE-.js";import{p as n,f as v}from"./date-Dwgqy666.js";import{D as r,f as k}from"./DetailRow-8MgXx8DK.js";import{C as m}from"./types-DqgiyrZ3.js";import{C as w}from"./CopyButton-CLJDLZpF.js";import{C as g}from"./circle-x-DuIWQOMZ.js";import{C as j}from"./circle-alert-BAv3_SCD.js";import{C}from"./circle-check-big-Bd3maByp.js";import"./vendor-DBTT3jXp.js";import"./EntryDetailPage-HykUOnNH.js";import"./search-DEpjS1hS.js";const p={completed:{icon:C,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},partial:{icon:j,color:"text-yellow-500",bg:"bg-yellow-100 dark:bg-yellow-900/30"},failed:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"}};function h(a){return a?a<1024?`${a}B`:a<1024*1024?`${(a/1024).toFixed(1)}KB`:a<1024*1024*1024?`${(a/(1024*1024)).toFixed(1)}MB`:`${(a/(1024*1024*1024)).toFixed(1)}GB`:"-"}function E({entry:a}){const{payload:s,createdAt:c}=a,t=p[s.status]||p.completed,f=t.icon,{processedItems:x,totalItems:d,failedItems:l}=s,i=d>0?Math.round(x/d*100):0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${t.bg} rounded-lg`,children:e.jsx(o,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:s.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Batch Operation"})]})]}),e.jsx(w,{text:s.name,label:"Copy batch name"})]})}),e.jsxs("div",{className:`grid ${s.memory!==void 0?"grid-cols-2 md:grid-cols-5":"grid-cols-2 md:grid-cols-4"} divide-x divide-gray-200 dark:divide-gray-700`,children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(f,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children:s.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Progress"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[i,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"%"})]})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(u,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[s.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]}),l>0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Failed"})]}),e.jsx("p",{className:"text-lg font-bold text-red-600 dark:text-red-400",children:l})]}),s.memory!==void 0&&e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(o,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Memory"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:h(s.memory)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"*:not-first:border-y-0",children:[e.jsx(r,{label:"Time",value:e.jsxs("span",{children:[k(n(c),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(n(c),{addSuffix:!0}),")"]})]})}),e.jsx(r,{label:"Name",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:s.name})}),s.operation&&e.jsx(r,{label:"Operation",value:e.jsx(m,{listType:"batches",filterType:"operations",filterValue:s.operation,children:s.operation})}),e.jsx(r,{label:"Status",value:e.jsx(m,{listType:"batches",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),e.jsx(r,{label:"Progress",value:e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-mono",children:[x," / ",d," (",i,"%)"]}),e.jsx("div",{className:"mt-2 w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:e.jsx("div",{className:"bg-blue-600 dark:bg-blue-500 h-2 rounded-full transition-all",style:{width:`${i}%`}})})]})}),l>0&&e.jsx(r,{label:"Failed Items",value:e.jsx("span",{className:"text-red-600 dark:text-red-400 font-mono",children:l})}),e.jsx(r,{label:"Duration",value:`${s.duration}ms`}),s.batchSize&&e.jsx(r,{label:"Batch Size",value:s.batchSize}),s.memory!==void 0&&e.jsx(r,{label:"Memory",value:h(s.memory)})]})})]}),s.errors&&s.errors.length>0&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(j,{className:"h-5 w-5 text-red-500"}),e.jsxs("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:["Errors (",s.errors.length,")"]})]})}),e.jsx("div",{className:"divide-y divide-red-200 dark:divide-red-800",children:s.errors.map((b,N)=>e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:b})},N))})]})]})}export{E as default};
@@ -1 +1 @@
1
- import{j as t,L as c}from"./index-Oh_UboeF.js";import{e as B,b as D}from"./vendor-DBTT3jXp.js";import{f as T,p as A}from"./date-Dwgqy666.js";import{u as L,a as I,P as $,R as H,N as S,L as W}from"./PageHeader-Bi85xmzF.js";import{u as q,q as O,C as h}from"./types-Be5ENIEY.js";import{T as s,D as U,b as z}from"./DataTable-B_TIjhVT.js";import"./timer-DIZVbXrL.js";function Z(){const u=B(),{addFilter:o,clearAll:p,serverFilters:x,headerFilters:m}=q("batches"),{rangeFilters:g,windowMinutes:y}=L(),{entries:f,loading:j,refreshing:i,error:b,refresh:d,newEntriesCount:C,hasMore:k,loadMore:w,loadNew:N,autoRefreshEnabled:E,live:v,setAutoRefresh:R,meta:n,isHighlighted:F}=I({type:"batch",limit:50,filters:{...x,...g},windowMinutes:y}),l=f.filter(e=>O(e)),M=D.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>t.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>{const a=e.payload.operation;return a?t.jsx(h,{onClick:r=>{r.stopPropagation(),o("operations",a)},children:a}):t.jsx(s,{secondary:!0,children:"-"})}},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:a,totalItems:r}=e.payload,P=r>0?Math.round(a/r*100):0;return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(s,{children:`${a}/${r}`}),t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",P,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>t.jsx(h,{onClick:a=>{a.stopPropagation(),o("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(U,{ms:e.payload.duration}):t.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[o]);return j&&l.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx($,{title:"Batches",icon:c,iconColor:"text-blue-600 dark:text-blue-400",count:l.length,totalCount:n==null?void 0:n.total,clearable:{type:"batch",label:"batches",onCleared:d},refreshing:i,autoRefreshEnabled:E,live:v,onAutoRefreshToggle:R,filters:m,filterControls:t.jsx(H,{route:"batches"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(S,{count:C,onClick:N,loading:i}),t.jsx(z,{columns:M,data:l,keyExtractor:e=>e.id,onRowClick:e=>u(`/batches/${e.id}`),rowClassName:e=>F(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",error:b,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:k,onClick:w,loading:i})]})]})}export{Z as default};
1
+ import{j as t,L as c}from"./index-ZBhBsEE-.js";import{e as B,b as D}from"./vendor-DBTT3jXp.js";import{f as T,p as A}from"./date-Dwgqy666.js";import{u as L,a as I,P as $,R as H,N as S,L as W}from"./PageHeader-C3xvY2Ig.js";import{u as q,q as O,C as h}from"./types-DqgiyrZ3.js";import{T as s,D as U,b as z}from"./DataTable-DXp-7bHh.js";import"./timer-chx4YN2F.js";function Z(){const u=B(),{addFilter:o,clearAll:p,serverFilters:x,headerFilters:m}=q("batches"),{rangeFilters:g,windowMinutes:y}=L(),{entries:f,loading:j,refreshing:i,error:b,refresh:d,newEntriesCount:C,hasMore:w,loadMore:k,loadNew:N,autoRefreshEnabled:E,live:v,setAutoRefresh:R,meta:n,isHighlighted:F}=I({type:"batch",limit:50,filters:{...x,...g},windowMinutes:y}),l=f.filter(e=>O(e)),M=D.useMemo(()=>[{key:"name",header:"Name",minWidth:"200px",render:e=>t.jsx(s,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.name})},{key:"operation",header:"Operation",width:"150px",render:e=>{const a=e.payload.operation;return a?t.jsx(h,{onClick:r=>{r.stopPropagation(),o("operations",a)},children:a}):t.jsx(s,{secondary:!0,children:"-"})}},{key:"progress",header:"Progress",width:"150px",render:e=>{const{processedItems:a,totalItems:r}=e.payload,P=r>0?Math.round(a/r*100):0;return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(s,{children:`${a}/${r}`}),t.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",P,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>t.jsx(h,{onClick:a=>{a.stopPropagation(),o("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>e.payload.duration?t.jsx(U,{ms:e.payload.duration}):t.jsx(s,{secondary:!0,children:"-"})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>t.jsx(s,{secondary:!0,className:"text-xs",children:T(A(e.createdAt),{addSuffix:!0})})}],[o]);return j&&l.length===0?t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):t.jsxs("div",{children:[t.jsx($,{title:"Batches",icon:c,iconColor:"text-blue-600 dark:text-blue-400",count:l.length,totalCount:n==null?void 0:n.total,clearable:{type:"batch",label:"batches",onCleared:d},refreshing:i,autoRefreshEnabled:E,live:v,onAutoRefreshToggle:R,filters:m,filterControls:t.jsx(H,{route:"batches"}),onClearAllFilters:p}),t.jsxs("div",{className:"space-y-4",children:[t.jsx(S,{count:C,onClick:N,loading:i}),t.jsx(z,{columns:M,data:l,keyExtractor:e=>e.id,onRowClick:e=>u(`/batches/${e.id}`),rowClassName:e=>F(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",watcher:"batch",error:b,onRetry:d,emptyIcon:t.jsx(c,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx(W,{hasMore:w,onClick:k,loading:i})]})]})}export{Z as default};
@@ -1,4 +1,4 @@
1
- import{c as h,j as e,D as d,C as g}from"./index-Oh_UboeF.js";import{p as o,f as p}from"./date-Dwgqy666.js";import{D as t,f as b}from"./DetailRow-B0S3c_eE.js";import{C as x}from"./types-Be5ENIEY.js";import{u as j,C as y,T as f}from"./EntryDetailPage-D_OaKS4_.js";import{C as u}from"./CopyButton-XYdI3-sW.js";import{C as N}from"./circle-check-big-DgeP_jno.js";import{C as v}from"./circle-x-CSvWnKSC.js";import{T as k}from"./timer-DIZVbXrL.js";import"./vendor-DBTT3jXp.js";import"./search-C3TNb54L.js";/**
1
+ import{c as h,j as e,D as d,C as g}from"./index-ZBhBsEE-.js";import{p as o,f as p}from"./date-Dwgqy666.js";import{D as t,f as b}from"./DetailRow-8MgXx8DK.js";import{C as x}from"./types-DqgiyrZ3.js";import{u as j,C as y,T as f}from"./EntryDetailPage-HykUOnNH.js";import{C as u}from"./CopyButton-CLJDLZpF.js";import{C as N}from"./circle-check-big-Bd3maByp.js";import{C as v}from"./circle-x-DuIWQOMZ.js";import{T as k}from"./timer-chx4YN2F.js";import"./vendor-DBTT3jXp.js";import"./search-DEpjS1hS.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as a,H as l}from"./index-Oh_UboeF.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{f as D,p as F}from"./date-Dwgqy666.js";import{u as M,a as A,P as H,R as P,N as B,L as I}from"./PageHeader-Bi85xmzF.js";import{u as L,f as S,C as n}from"./types-Be5ENIEY.js";import{T as i,D as W,b as K}from"./DataTable-B_TIjhVT.js";import"./timer-DIZVbXrL.js";function Q(){const d=R(),{clearAll:c,serverFilters:h,headerFilters:u}=L("cache"),{rangeFilters:p,windowMinutes:x}=M(),{entries:m,loading:y,refreshing:t,error:g,refresh:o,newEntriesCount:f,hasMore:j,loadMore:C,loadNew:k,autoRefreshEnabled:w,live:b,setAutoRefresh:N,meta:r,isHighlighted:T}=A({type:"cache",limit:50,filters:{...h,...p},windowMinutes:x}),s=m.filter(e=>S(e)),E=v.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(n,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(n,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[]);return y&&s.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Cache",icon:l,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,clearable:{type:"cache",label:"cache",onCleared:o},refreshing:t,autoRefreshEnabled:w,live:b,onAutoRefreshToggle:N,filters:u,filterControls:a.jsx(P,{route:"cache"}),onClearAllFilters:c}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(B,{count:f,onClick:k,loading:t}),a.jsx(K,{columns:E,data:s,keyExtractor:e=>e.id,onRowClick:e=>d(`/cache/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",error:g,onRetry:o,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:C,loading:t})]})]})}export{Q as default};
1
+ import{j as a,H as l}from"./index-ZBhBsEE-.js";import{e as R,b as v}from"./vendor-DBTT3jXp.js";import{f as D,p as F}from"./date-Dwgqy666.js";import{u as M,a as A,P as H,R as P,N as B,L as I}from"./PageHeader-C3xvY2Ig.js";import{u as L,f as S,C as n}from"./types-DqgiyrZ3.js";import{T as i,D as W,b as K}from"./DataTable-DXp-7bHh.js";import"./timer-chx4YN2F.js";function Q(){const d=R(),{clearAll:c,serverFilters:h,headerFilters:u}=L("cache"),{rangeFilters:p,windowMinutes:x}=M(),{entries:m,loading:y,refreshing:t,error:g,refresh:o,newEntriesCount:f,hasMore:j,loadMore:C,loadNew:k,autoRefreshEnabled:w,live:b,setAutoRefresh:N,meta:r,isHighlighted:T}=A({type:"cache",limit:50,filters:{...h,...p},windowMinutes:x}),s=m.filter(e=>S(e)),E=v.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(n,{listType:"cache",filterType:"operations",children:e.payload.operation})},{key:"key",header:"Key",minWidth:"200px",render:e=>a.jsx(i,{mono:!0,truncate:!0,maxWidth:"400px",children:e.payload.key.length>50?e.payload.key.substring(0,50)+"...":e.payload.key})},{key:"result",header:"Result",width:"80px",align:"center",render:e=>e.payload.operation==="get"?a.jsx(n,{listType:"cache",filterType:"tags",filterValue:e.payload.hit?"hit":"miss",children:e.payload.hit?"HIT":"MISS"}):a.jsx(i,{secondary:!0,children:"—"})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(W,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:D(F(e.createdAt),{addSuffix:!0})})}],[]);return y&&s.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Cache",icon:l,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,clearable:{type:"cache",label:"cache",onCleared:o},refreshing:t,autoRefreshEnabled:w,live:b,onAutoRefreshToggle:N,filters:u,filterControls:a.jsx(P,{route:"cache"}),onClearAllFilters:c}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(B,{count:f,onClick:k,loading:t}),a.jsx(K,{columns:E,data:s,keyExtractor:e=>e.id,onRowClick:e=>d(`/cache/${e.id}`),rowClassName:e=>T(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",watcher:"cache",error:g,onRetry:o,emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(I,{hasMore:j,onClick:C,loading:t})]})]})}export{Q as default};
@@ -1 +1 @@
1
- import{j as e,b as m,C as p}from"./index-Oh_UboeF.js";import{b as N}from"./vendor-DBTT3jXp.js";import{p as h,f as v}from"./date-Dwgqy666.js";import{D as t,f as k}from"./DetailRow-B0S3c_eE.js";import{C as b}from"./types-Be5ENIEY.js";import{u as c,C as n,T as C}from"./EntryDetailPage-D_OaKS4_.js";import{C as T}from"./CopyButton-XYdI3-sW.js";import{C as w}from"./circle-check-big-DgeP_jno.js";import{C as g}from"./circle-x-CSvWnKSC.js";import"./search-C3TNb54L.js";function I({entry:u}){const{payload:a,createdAt:x}=u,d=c(),l=c(),o=c(),[i,j]=N.useState("payload"),r=a.status==="completed"?{icon:w,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:a.status==="executing"?{icon:p,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},y=r.icon,s=[];a.payload!==void 0&&s.push({id:"payload",label:"Payload",content:e.jsx(n,{data:a.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),a.result!==void 0&&s.push({id:"result",label:"Result",content:e.jsx(n,{data:a.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})}),a.metadata!==void 0&&s.push({id:"metadata",label:"Metadata",content:e.jsx(n,{data:a.metadata,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})});const f=()=>{if(i==="payload"&&a.payload!==void 0)return e.jsx(d.Toolbar,{data:a.payload});if(i==="result"&&a.result!==void 0)return e.jsx(l.Toolbar,{data:a.result});if(i==="metadata"&&a.metadata!==void 0)return e.jsx(o.Toolbar,{data:a.metadata})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(m,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Command Execution"})]})]}),e.jsx(T,{text:a.name,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.name,children:a.name})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"*:not-first:border-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[k(h(x),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(h(x),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Command",value:e.jsx(b,{listType:"commands",filterType:"names",filterValue:a.name,children:a.name})}),a.handler&&e.jsx(t,{label:"Handler",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:a.handler})}),e.jsx(t,{label:"Status",value:e.jsx(b,{listType:"commands",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(t,{label:"Duration",value:a.duration!==void 0?`${a.duration}ms`:"-"})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),s.length>0&&e.jsx(C,{tabs:s,defaultTab:"payload",hashKey:"command",headerRight:f(),onTabChange:j})]})}export{I as default};
1
+ import{j as e,b as m,C as p}from"./index-ZBhBsEE-.js";import{b as N}from"./vendor-DBTT3jXp.js";import{p as h,f as v}from"./date-Dwgqy666.js";import{D as t,f as k}from"./DetailRow-8MgXx8DK.js";import{C as b}from"./types-DqgiyrZ3.js";import{u as c,C as n,T as C}from"./EntryDetailPage-HykUOnNH.js";import{C as T}from"./CopyButton-CLJDLZpF.js";import{C as w}from"./circle-check-big-Bd3maByp.js";import{C as g}from"./circle-x-DuIWQOMZ.js";import"./search-DEpjS1hS.js";function I({entry:u}){const{payload:a,createdAt:x}=u,d=c(),l=c(),o=c(),[i,j]=N.useState("payload"),r=a.status==="completed"?{icon:w,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:a.status==="executing"?{icon:p,color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"}:{icon:g,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},y=r.icon,s=[];a.payload!==void 0&&s.push({id:"payload",label:"Payload",content:e.jsx(n,{data:a.payload,toolbarState:d.state,searchBar:d.SearchBar,maxHeight:400})}),a.result!==void 0&&s.push({id:"result",label:"Result",content:e.jsx(n,{data:a.result,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})}),a.metadata!==void 0&&s.push({id:"metadata",label:"Metadata",content:e.jsx(n,{data:a.metadata,toolbarState:o.state,searchBar:o.SearchBar,maxHeight:400})});const f=()=>{if(i==="payload"&&a.payload!==void 0)return e.jsx(d.Toolbar,{data:a.payload});if(i==="result"&&a.result!==void 0)return e.jsx(l.Toolbar,{data:a.result});if(i==="metadata"&&a.metadata!==void 0)return e.jsx(o.Toolbar,{data:a.metadata})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`p-2 ${r.bg} rounded-lg`,children:e.jsx(m,{className:`h-5 w-5 ${r.color}`})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white font-mono",children:a.name}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Command Execution"})]})]}),e.jsx(T,{text:a.name,label:"Copy command"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 divide-x divide-gray-200 dark:divide-gray-700",children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Command"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white font-mono truncate",title:a.name,children:a.name})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:a.status.toUpperCase()})]}),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center space-x-2 text-gray-500 dark:text-gray-400 mb-1",children:[e.jsx(p,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Duration"})]}),e.jsxs("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:[a.duration,e.jsx("span",{className:"text-sm font-normal text-gray-500 dark:text-gray-400",children:"ms"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"*:not-first:border-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[k(h(x),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",v(h(x),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Command",value:e.jsx(b,{listType:"commands",filterType:"names",filterValue:a.name,children:a.name})}),a.handler&&e.jsx(t,{label:"Handler",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white",children:a.handler})}),e.jsx(t,{label:"Status",value:e.jsx(b,{listType:"commands",filterType:"statuses",filterValue:a.status,children:a.status.toUpperCase()})}),e.jsx(t,{label:"Duration",value:a.duration!==void 0?`${a.duration}ms`:"-"})]})})]}),a.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(g,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:a.error})})]}),s.length>0&&e.jsx(C,{tabs:s,defaultTab:"payload",hashKey:"command",headerRight:f(),onTabChange:j})]})}export{I as default};
@@ -1 +1 @@
1
- import{j as a,b as d}from"./index-Oh_UboeF.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as H,R as L,N as W,L as S}from"./PageHeader-Bi85xmzF.js";import{u as I,o as U,C as m}from"./types-Be5ENIEY.js";import{T as i,D as $,b as q}from"./DataTable-B_TIjhVT.js";import"./timer-DIZVbXrL.js";function X(){const c=T(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("commands"),{rangeFilters:x,windowMinutes:g}=A(),{entries:f,loading:y,refreshing:r,error:C,refresh:l,newEntriesCount:j,hasMore:k,loadMore:w,loadNew:b,autoRefreshEnabled:N,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"command",limit:50,filters:{...h,...x},windowMinutes:g}),o=f.filter(e=>U(e)),F=D.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"handler",header:"Handler",minWidth:"200px",render:e=>e.payload.handler?a.jsx(i,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.handler}):a.jsx(i,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx($,{ms:e.payload.duration??0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[t]);return y&&o.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Commands",icon:d,iconColor:"text-green-600 dark:text-green-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"command",label:"commands",onCleared:l},refreshing:r,autoRefreshEnabled:N,live:E,onAutoRefreshToggle:R,filters:p,filterControls:a.jsx(L,{route:"commands"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(W,{count:j,onClick:b,loading:r}),a.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/commands/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",error:C,onRetry:l,emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(S,{hasMore:k,onClick:w,loading:r})]})]})}export{X as default};
1
+ import{j as a,b as d}from"./index-ZBhBsEE-.js";import{e as T,b as D}from"./vendor-DBTT3jXp.js";import{f as M,p as P}from"./date-Dwgqy666.js";import{u as A,a as B,P as H,R as L,N as W,L as S}from"./PageHeader-C3xvY2Ig.js";import{u as I,o as U,C as m}from"./types-DqgiyrZ3.js";import{T as i,D as $,b as q}from"./DataTable-DXp-7bHh.js";import"./timer-chx4YN2F.js";function X(){const c=T(),{addFilter:t,clearAll:u,serverFilters:h,headerFilters:p}=I("commands"),{rangeFilters:x,windowMinutes:g}=A(),{entries:f,loading:y,refreshing:r,error:C,refresh:l,newEntriesCount:j,hasMore:w,loadMore:k,loadNew:b,autoRefreshEnabled:N,live:E,setAutoRefresh:R,meta:s,isHighlighted:v}=B({type:"command",limit:50,filters:{...h,...x},windowMinutes:g}),o=f.filter(e=>U(e)),F=D.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("names",e.payload.name)},className:"font-mono",children:e.payload.name})},{key:"handler",header:"Handler",minWidth:"200px",render:e=>e.payload.handler?a.jsx(i,{mono:!0,truncate:!0,maxWidth:"250px",children:e.payload.handler}):a.jsx(i,{secondary:!0,children:"-"})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(m,{onClick:n=>{n.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx($,{ms:e.payload.duration??0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:M(P(e.createdAt),{addSuffix:!0})})}],[t]);return y&&o.length===0?a.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})}):a.jsxs("div",{children:[a.jsx(H,{title:"Commands",icon:d,iconColor:"text-green-600 dark:text-green-400",count:o.length,totalCount:s==null?void 0:s.total,clearable:{type:"command",label:"commands",onCleared:l},refreshing:r,autoRefreshEnabled:N,live:E,onAutoRefreshToggle:R,filters:p,filterControls:a.jsx(L,{route:"commands"}),onClearAllFilters:u}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(W,{count:j,onClick:b,loading:r}),a.jsx(q,{columns:F,data:o,keyExtractor:e=>e.id,onRowClick:e=>c(`/commands/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",watcher:"command",error:C,onRetry:l,emptyIcon:a.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(S,{hasMore:w,onClick:k,loading:r})]})]})}export{X as default};
@@ -1,3 +1,3 @@
1
- import{j as e,z as n}from"./index-Oh_UboeF.js";import{b as p}from"./vendor-DBTT3jXp.js";import{a as i,b as c}from"./EntryDetailPage-D_OaKS4_.js";function y({text:l,label:r="Copy",successMessage:x="Copied to clipboard!",className:t="",iconOnly:d=!1}){const[s,a]=p.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(l),a(!0),n.success(x),setTimeout(()=>a(!1),2e3)}catch{n.error("Failed to copy")}};return d?e.jsx("button",{onClick:o,className:`p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${t}`,title:r,children:s?e.jsx(i,{className:"h-4 w-4 text-green-500"}):e.jsx(c,{className:"h-4 w-4 text-gray-500"})}):e.jsx("button",{onClick:o,className:`inline-flex items-center space-x-2 px-3 py-1.5 text-sm font-medium rounded-lg
1
+ import{j as e,z as n}from"./index-ZBhBsEE-.js";import{b as p}from"./vendor-DBTT3jXp.js";import{a as i,b as c}from"./EntryDetailPage-HykUOnNH.js";function y({text:l,label:r="Copy",successMessage:x="Copied to clipboard!",className:t="",iconOnly:d=!1}){const[s,a]=p.useState(!1),o=async()=>{try{await navigator.clipboard.writeText(l),a(!0),n.success(x),setTimeout(()=>a(!1),2e3)}catch{n.error("Failed to copy")}};return d?e.jsx("button",{onClick:o,className:`p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors ${t}`,title:r,children:s?e.jsx(i,{className:"h-4 w-4 text-green-500"}):e.jsx(c,{className:"h-4 w-4 text-gray-500"})}):e.jsx("button",{onClick:o,className:`inline-flex items-center space-x-2 px-3 py-1.5 text-sm font-medium rounded-lg
2
2
  bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600
3
3
  text-gray-700 dark:text-gray-300 transition-colors ${t}`,children:s?e.jsxs(e.Fragment,{children:[e.jsx(i,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{children:"Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"h-4 w-4"}),e.jsx("span",{children:r})]})})}export{y as C};
@@ -1,4 +1,4 @@
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-Oh_UboeF.js";import{b as c,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-Barcwmeq.js";import{Z as Fe}from"./zap-FCdKJjm5.js";import{C as Ge}from"./calendar-Ppb5e_1B.js";/**
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-ZBhBsEE-.js";import{b as c,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-B9n6gdoj.js";import{Z as Fe}from"./zap-CP3Qh2HO.js";import{C as Ge}from"./calendar-bOGpQhaX.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,68 @@
1
+ import{c as y,j as e,Q as O,U,V as L,i as W,T as F}from"./index-ZBhBsEE-.js";import{b as c}from"./vendor-DBTT3jXp.js";import{g as b}from"./date-Dwgqy666.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 H=y("Hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);/**
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 P=y("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
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 R=y("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
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 V=y("Unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]),D="px-3 py-1.5 rounded-lg text-sm font-medium bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500",q={waiting:{title:"This watcher is on, and has nothing to record",link:"How to fix this",icon:V,iconClass:"text-amber-500 dark:text-amber-400",ringClass:"bg-amber-50 dark:bg-amber-900/20"},off:{title:"This watcher is switched off",link:"How to switch it on",icon:R,iconClass:"text-gray-400 dark:text-gray-500",ringClass:"bg-gray-100 dark:bg-gray-800"},manual:{title:"This watcher records what your code hands it",link:"How to use it",icon:H,iconClass:"text-gray-400 dark:text-gray-500",ringClass:"bg-gray-100 dark:bg-gray-800"}};function B({status:t}){const r=q[t.state],n=r.icon;return e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4",role:"status","data-testid":"watcher-empty-state","data-state":t.state,children:[e.jsx("div",{className:`p-3 rounded-full mb-4 ${r.ringClass}`,children:e.jsx(n,{className:`h-8 w-8 ${r.iconClass}`,"aria-hidden":"true"})}),e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white text-center",children:r.title}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400 text-center max-w-md",children:t.reason}),e.jsxs("a",{href:t.docs,target:"_blank",rel:"noopener noreferrer",className:`mt-4 inline-flex items-center gap-1.5 ${D}`,children:[r.link,e.jsx(O,{className:"h-3.5 w-3.5","aria-hidden":"true"})]}),e.jsx("code",{className:"mt-3 text-xs text-gray-400 dark:text-gray-500",children:t.option})]})}function _({columns:t,rows:r=5}){return e.jsx(e.Fragment,{children:Array.from({length:r}).map((n,a)=>e.jsx("tr",{className:"animate-pulse",children:Array.from({length:t}).map((l,d)=>e.jsx("td",{className:"px-4 py-3",children:e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded-sm w-3/4"})},d))},a))})}function G({error:t,onRetry:r}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4",role:"alert","data-testid":"table-error",children:[e.jsx("div",{className:"p-3 rounded-full bg-red-50 dark:bg-red-900/20 mb-4",children:e.jsx(F,{className:"h-8 w-8 text-red-500 dark:text-red-400"})}),e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-white text-center",children:"Could not load these entries"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400 text-center max-w-sm",children:t.message}),r&&e.jsx("button",{onClick:r,className:`mt-4 ${D}`,children:"Try again"})]})}function K({message:t,icon:r}){return e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4",children:[e.jsx("div",{className:"p-3 rounded-full bg-gray-100 dark:bg-gray-800 mb-4",children:r||e.jsx(P,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 text-center max-w-sm",children:t})]})}function J({columns:t,data:r,keyExtractor:n,onRowClick:a,loading:l=!1,emptyMessage:d="No data available",emptyIcon:h,watcher:A,error:k,onRetry:I,showChevron:p=!0,compact:j=!1,stickyHeader:M=!0,maxHeight:m,zebraStripes:T=!1,rowClassName:v}){const w=j?"px-3 py-2":"px-4 py-3",N=j?"px-3 py-2":"px-4 py-3",[u,x]=c.useState(-1),[$,z]=c.useState(-1),f=c.useRef(null),E=U(A),g=t.length+(p&&a?1:0),S=s=>{switch(s){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}},C=c.useCallback((s,o,i)=>{if(a)switch(s.key){case"Enter":case" ":s.preventDefault(),a(o),z(i);break;case"ArrowDown":s.preventDefault(),i<r.length-1&&x(i+1);break;case"ArrowUp":s.preventDefault(),i>0&&x(i-1);break;case"Home":s.preventDefault(),x(0);break;case"End":s.preventDefault(),x(r.length-1);break}},[a,r.length]);return c.useEffect(()=>{if(u>=0&&f.current){const o=f.current.querySelectorAll("tbody tr[tabindex]")[u];o&&o.focus()}},[u]),e.jsx("div",{className:"card overflow-hidden",children:e.jsx("div",{className:`overflow-x-auto ${m?"overflow-y-auto":""}`,style:m?{maxHeight:m}:void 0,children:e.jsxs("table",{ref:f,className:"w-full border-collapse",role:"grid","aria-rowcount":r.length,"aria-colcount":g,children:[e.jsx("thead",{className:`bg-gray-50 dark:bg-gray-800/50 ${M?"sticky top-0 z-10":""}`,children:e.jsxs("tr",{role:"row",children:[t.map(s=>e.jsx("th",{scope:"col",role:"columnheader","aria-sort":s.sortable?"none":void 0,className:`
22
+ ${N}
23
+ ${S(s.headerAlign||s.align)}
24
+ text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider
25
+ border-b border-gray-200 dark:border-gray-700
26
+ bg-gray-50 dark:bg-gray-800/50
27
+ whitespace-nowrap
28
+ ${s.sticky?"sticky left-0 z-20":""}
29
+ `,style:{width:s.width,minWidth:s.minWidth},children:s.header},s.key)),p&&a&&e.jsx("th",{scope:"col",role:"columnheader",className:`
30
+ ${N}
31
+ w-12
32
+ border-b border-gray-200 dark:border-gray-700
33
+ bg-gray-50 dark:bg-gray-800/50
34
+ `,"aria-label":"Expand row"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:l?e.jsx(_,{columns:g,rows:5}):k&&r.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:g,children:e.jsx(G,{error:k,onRetry:I})})}):r.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:g,children:L(E)?e.jsx(B,{status:E}):e.jsx(K,{message:d,icon:h})})}):r.map((s,o)=>e.jsxs("tr",{role:"row","aria-rowindex":o+1,"aria-selected":a&&$===o?!0:void 0,onClick:a?()=>a(s):void 0,onKeyDown:a?i=>C(i,s,o):void 0,tabIndex:a?0:void 0,className:`
35
+ group
36
+ transition-colors duration-150
37
+ ${a?"cursor-pointer":""}
38
+ ${T&&o%2===1?"bg-gray-50/50 dark:bg-gray-800/25":"bg-white dark:bg-gray-900"}
39
+ hover:bg-primary-50/50 dark:hover:bg-primary-900/10
40
+ focus:outline-hidden focus:ring-2 focus:ring-primary-500 focus:ring-inset
41
+ ${$===o?"bg-primary-50 dark:bg-primary-900/20":""}
42
+ ${v?v(s):""}
43
+ `,children:[t.map(i=>e.jsx("td",{role:"gridcell",className:`
44
+ ${w}
45
+ ${S(i.align)}
46
+ ${i.sticky?"sticky left-0 z-10 bg-inherit":""}
47
+ `,style:{width:i.width,minWidth:i.minWidth},children:i.render(s,o)},i.key)),p&&a&&e.jsx("td",{className:`${w} w-12 text-right`,role:"gridcell",children:e.jsx(W,{className:"h-4 w-4 text-gray-300 dark:text-gray-600 group-hover:text-gray-500 dark:group-hover:text-gray-400 transition-colors inline-block","aria-hidden":"true"})})]},n(s)))})]})})})}function X({children:t,mono:r=!1,truncate:n=!1,maxWidth:a,secondary:l=!1,className:d=""}){return e.jsx("span",{className:`
48
+ text-sm
49
+ ${r?"font-mono":""}
50
+ ${l?"text-gray-500 dark:text-gray-400":"text-gray-900 dark:text-white"}
51
+ ${n?"block truncate":""}
52
+ ${d}
53
+ `,style:a?{maxWidth:a,display:"block"}:void 0,title:n&&typeof t=="string"?t:void 0,children:t})}function ee({tags:t,max:r=3,onTagClick:n}){const a=t.slice(0,r),l=t.length-r;return t.length===0?e.jsx("span",{className:"text-sm text-gray-400 dark:text-gray-500",children:"—"}):e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[a.map(d=>e.jsx("button",{onClick:n?h=>n(d,h):void 0,role:n?"button":void 0,tabIndex:n?0:void 0,"aria-label":n?`Click to filter by ${d.toUpperCase()}`:void 0,className:`
54
+ inline-flex items-center px-2 py-0.5 rounded-sm text-xs font-bold uppercase tracking-wide shadow-sm
55
+ ${b(d)}
56
+ ${n?"cursor-pointer hover:scale-105":""}
57
+ transition-transform
58
+ `,children:d.toUpperCase()},d)),l>0&&e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:["+",l]})]})}function te({ms:t,slowThreshold:r=1e3,verySlowThreshold:n=5e3}){let a,l;return t>=n?a="text-red-600 dark:text-red-400":t>=r?a="text-yellow-600 dark:text-yellow-400":a="text-gray-600 dark:text-gray-300",t>=1e3?l=`${(t/1e3).toFixed(2)}s`:l=`${Number.isInteger(t)?t:t.toFixed(2)}ms`,e.jsx("span",{className:`text-sm font-mono tabular-nums ${a}`,children:l})}function re({onClick:t}){const r=b("ERROR");return e.jsx("button",{onClick:t,className:`
59
+ inline-flex items-center px-2 py-0.5 rounded-sm text-xs font-bold uppercase tracking-wide shadow-sm
60
+ ${r}
61
+ ${t?"cursor-pointer hover:scale-105":""}
62
+ transition-transform
63
+ `,children:"ERROR"})}function ae({count:t,onClick:r}){if(t===0)return null;const n=b("N+1");return e.jsx("button",{onClick:r,title:`${t} potential N+1 ${t===1?"query":"queries"} detected`,className:`
64
+ inline-flex items-center gap-1 px-2 py-0.5 rounded-sm text-xs font-bold uppercase tracking-wide shadow-sm
65
+ ${n}
66
+ ${r?"cursor-pointer hover:scale-105":""}
67
+ transition-transform
68
+ `,children:"N+1"})}export{te as D,re as G,ae as N,X as T,ee as a,J as b};