nestlens 0.8.13 → 0.9.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 (106) hide show
  1. package/dist/api/content-encoding.d.ts +20 -0
  2. package/dist/api/content-encoding.js +92 -0
  3. package/dist/api/dashboard.controller.d.ts +37 -5
  4. package/dist/api/dashboard.controller.js +114 -28
  5. package/dist/api/route-path.js +19 -1
  6. package/dist/core/collector.service.js +6 -0
  7. package/dist/core/pruning.service.js +4 -1
  8. package/dist/core/storage/index.js +4 -3
  9. package/dist/core/storage/memory.storage.d.ts +2 -2
  10. package/dist/core/storage/memory.storage.js +5 -3
  11. package/dist/core/storage/redis.storage.d.ts +2 -2
  12. package/dist/core/storage/redis.storage.js +5 -3
  13. package/dist/core/storage/sqlite.storage.d.ts +23 -2
  14. package/dist/core/storage/sqlite.storage.js +59 -7
  15. package/dist/core/storage/storage.factory.js +26 -0
  16. package/dist/core/storage/tag-normalization.d.ts +10 -0
  17. package/dist/core/storage/tag-normalization.js +14 -0
  18. package/dist/core/tag.service.js +5 -2
  19. package/dist/dashboard/public/assets/BatchDetailView-D8PKMRJK.js +1 -0
  20. package/dist/dashboard/public/assets/BatchesPage-DT5Mywoo.js +1 -0
  21. package/dist/dashboard/public/assets/CacheDetailView-BKg5s6do.js +6 -0
  22. package/dist/dashboard/public/assets/CachePage-Dv0sIWfb.js +1 -0
  23. package/dist/dashboard/public/assets/CommandDetailView-34Fp3Zse.js +1 -0
  24. package/dist/dashboard/public/assets/CommandsPage-DfJBmcAu.js +1 -0
  25. package/dist/dashboard/public/assets/CopyButton-CVTvd0EZ.js +3 -0
  26. package/dist/dashboard/public/assets/{DashboardPage-BxTgQDmh.js → DashboardPage-Bl0QYNJ5.js} +2 -2
  27. package/dist/dashboard/public/assets/DataTable-DNJpoFzh.js +53 -0
  28. package/dist/dashboard/public/assets/DetailRow-CouZ8riB.js +1 -0
  29. package/dist/dashboard/public/assets/DumpDetailView-B6-Nre38.js +11 -0
  30. package/dist/dashboard/public/assets/DumpsPage-Cd0B4s9o.js +1 -0
  31. package/dist/dashboard/public/assets/EntryDetailPage-QTrST2MQ.js +27 -0
  32. package/dist/dashboard/public/assets/EntrySearchInput-DqIRbpja.js +1 -0
  33. package/dist/dashboard/public/assets/EventDetailView-2SmuXgrJ.js +1 -0
  34. package/dist/dashboard/public/assets/EventsPage-DCpLnIob.js +1 -0
  35. package/dist/dashboard/public/assets/ExceptionDetailView-DxGim-Jg.js +8 -0
  36. package/dist/dashboard/public/assets/ExceptionsPage-Qa60iwA4.js +6 -0
  37. package/dist/dashboard/public/assets/GateDetailView-DFVtRPBk.js +6 -0
  38. package/dist/dashboard/public/assets/GatesPage-DHGIZzbG.js +1 -0
  39. package/dist/dashboard/public/assets/GraphQLDetailView-DvHekddm.js +6 -0
  40. package/dist/dashboard/public/assets/GraphQLPage-Cft-KFpI.js +6 -0
  41. package/dist/dashboard/public/assets/HttpClientDetailView-qU0JPxsC.js +1 -0
  42. package/dist/dashboard/public/assets/HttpClientPage-Kxa5nm75.js +1 -0
  43. package/dist/dashboard/public/assets/JobDetailView-BfAICIc4.js +6 -0
  44. package/dist/dashboard/public/assets/JobsPage-BpBk0bYd.js +1 -0
  45. package/dist/dashboard/public/assets/LogDetailView-CdSLEf4Q.js +1 -0
  46. package/dist/dashboard/public/assets/LogsPage-CaCtKQZ0.js +1 -0
  47. package/dist/dashboard/public/assets/MailDetailView-BiBUkOXW.js +9 -0
  48. package/dist/dashboard/public/assets/MailPage-DAkydOVp.js +1 -0
  49. package/dist/dashboard/public/assets/ModelDetailView-CXCgDnpy.js +1 -0
  50. package/dist/dashboard/public/assets/ModelsPage-BwK3r0-I.js +1 -0
  51. package/dist/dashboard/public/assets/NotificationDetailView-Bljgzgiz.js +1 -0
  52. package/dist/dashboard/public/assets/NotificationsPage-DMGpuTU-.js +1 -0
  53. package/dist/dashboard/public/assets/PageHeader-BAc6Jvef.js +1 -0
  54. package/dist/dashboard/public/assets/QueriesPage-DPls44cD.js +1 -0
  55. package/dist/dashboard/public/assets/QueryDetailView-BEwgxDtv.js +29 -0
  56. package/dist/dashboard/public/assets/RedisDetailView-Ds3Hzc8m.js +1 -0
  57. package/dist/dashboard/public/assets/RedisPage-DhAhXwAd.js +1 -0
  58. package/dist/dashboard/public/assets/RequestDetailView-BwTcMKOH.js +1 -0
  59. package/dist/dashboard/public/assets/RequestsPage-CIHqEF5P.js +1 -0
  60. package/dist/dashboard/public/assets/ScheduleDetailView-2RmRtcvM.js +1 -0
  61. package/dist/dashboard/public/assets/SchedulePage-D3MuXtV1.js +1 -0
  62. package/dist/dashboard/public/assets/UserCard-Cbu0ICp6.js +1 -0
  63. package/dist/dashboard/public/assets/ViewDetailView-rCONPvjG.js +1 -0
  64. package/dist/dashboard/public/assets/ViewsPage-CW5aN_D5.js +1 -0
  65. package/dist/dashboard/public/assets/badgeColors-DQ_P_DOX.js +1 -0
  66. package/dist/dashboard/public/assets/{calendar-DfnYRiPH.js → calendar-DcK1CETU.js} +1 -1
  67. package/dist/dashboard/public/assets/circle-alert-CgZfn5uS.js +6 -0
  68. package/dist/dashboard/public/assets/{circle-check-big-CdzBeD3-.js → circle-check-big-1S8vooWx.js} +1 -1
  69. package/dist/dashboard/public/assets/circle-x-BOe5goDy.js +6 -0
  70. package/dist/dashboard/public/assets/{eye-BwC2X41m.js → eye-PnSIQ7GH.js} +1 -1
  71. package/dist/dashboard/public/assets/index-B9BCPNKv.css +1 -0
  72. package/dist/dashboard/public/assets/index-DyvNu-oR.js +361 -0
  73. package/dist/dashboard/public/assets/{search-CyCRC3Aj.js → search-D9V4itpU.js} +1 -1
  74. package/dist/dashboard/public/assets/send-DOt7lNQl.js +6 -0
  75. package/dist/dashboard/public/assets/timer-CZxO8Y_Q.js +6 -0
  76. package/dist/dashboard/public/assets/types-DZUckfsW.js +1 -0
  77. package/dist/dashboard/public/assets/users-9cJRsfQV.js +6 -0
  78. package/dist/dashboard/public/assets/{zap-yEefbKzX.js → zap-B0E2zzJ8.js} +1 -1
  79. package/dist/dashboard/public/index.html +2 -2
  80. package/package.json +51 -10
  81. package/dist/dashboard/public/assets/BatchesPage-DEz38KR5.js +0 -1
  82. package/dist/dashboard/public/assets/CachePage-CZxLvTJq.js +0 -1
  83. package/dist/dashboard/public/assets/ClickableBadge-DVTcykCM.js +0 -1
  84. package/dist/dashboard/public/assets/CommandsPage-DnUHcHF_.js +0 -1
  85. package/dist/dashboard/public/assets/DumpsPage-DNXepzfv.js +0 -1
  86. package/dist/dashboard/public/assets/EntryDetailPage-0WBhBUsh.js +0 -126
  87. package/dist/dashboard/public/assets/EntrySearchInput-BKjIppvt.js +0 -1
  88. package/dist/dashboard/public/assets/EventsPage-xPiqDte_.js +0 -1
  89. package/dist/dashboard/public/assets/ExceptionsPage-ZJNqTX3Q.js +0 -6
  90. package/dist/dashboard/public/assets/GatesPage-CdvK6bSz.js +0 -1
  91. package/dist/dashboard/public/assets/GraphQLPage-DaLLpAf8.js +0 -6
  92. package/dist/dashboard/public/assets/HttpClientPage-e8BqONkc.js +0 -1
  93. package/dist/dashboard/public/assets/JobsPage-CjHsAC5o.js +0 -1
  94. package/dist/dashboard/public/assets/LogsPage-ny3e-b51.js +0 -1
  95. package/dist/dashboard/public/assets/MailPage-dpbs1DH3.js +0 -1
  96. package/dist/dashboard/public/assets/ModelsPage-DZaU9bdR.js +0 -1
  97. package/dist/dashboard/public/assets/NotificationsPage-xKjgSJyj.js +0 -1
  98. package/dist/dashboard/public/assets/PageHeader-yPvqJXYA.js +0 -1
  99. package/dist/dashboard/public/assets/QueriesPage-DsMLeBtH.js +0 -1
  100. package/dist/dashboard/public/assets/RedisPage-Daw6beWw.js +0 -1
  101. package/dist/dashboard/public/assets/RequestsPage-CDMXEx7M.js +0 -1
  102. package/dist/dashboard/public/assets/SchedulePage-CkbyutFW.js +0 -1
  103. package/dist/dashboard/public/assets/ViewsPage-B7fHFzy2.js +0 -1
  104. package/dist/dashboard/public/assets/index-DDZJvSAq.css +0 -1
  105. package/dist/dashboard/public/assets/index-jX7JpX7L.js +0 -361
  106. package/dist/dashboard/public/assets/types-C1scQJYx.js +0 -53
@@ -51,6 +51,18 @@ const common_1 = require("@nestjs/common");
51
51
  const better_sqlite3_1 = __importDefault(require("better-sqlite3"));
52
52
  const fs = __importStar(require("fs"));
53
53
  const path = __importStar(require("path"));
54
+ const tag_normalization_1 = require("./tag-normalization");
55
+ /**
56
+ * The on-disk schema this version writes, recorded in `PRAGMA user_version`.
57
+ *
58
+ * 1 the original table: id, type, request_id, payload, created_at
59
+ * 2 adds family_hash and resolved_at
60
+ *
61
+ * Bump it whenever the schema changes, alongside the migration that performs
62
+ * the change. Files written before versioning read as 0 and are migrated the
63
+ * same way — the column probing below has always been idempotent.
64
+ */
65
+ const SCHEMA_VERSION = 2;
54
66
  let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
55
67
  constructor(filename = '.cache/nestlens.db') {
56
68
  this.filename = filename;
@@ -68,7 +80,27 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
68
80
  onModuleInit() {
69
81
  // Already initialized in constructor
70
82
  }
83
+ /**
84
+ * Reads the schema version, and says so when the file is from the future.
85
+ *
86
+ * A SQLite file outlives the package that wrote it: it sits on disk across
87
+ * upgrades, and across downgrades. Migrating forward is handled by probing
88
+ * for missing columns, which is idempotent and needs no version — but that
89
+ * only ever adds. Nothing could tell that a file had been written by a newer
90
+ * NestLens, where a column this version has never heard of may be carrying
91
+ * meaning, and the entries would simply read back short.
92
+ */
93
+ readSchemaVersion() {
94
+ const version = this.db.pragma('user_version', { simple: true });
95
+ const parsed = typeof version === 'number' ? version : Number(version);
96
+ if (parsed > SCHEMA_VERSION) {
97
+ this.logger.warn(`${this.filename} was written by a newer NestLens (schema ${parsed}, this version reads ${SCHEMA_VERSION}). ` +
98
+ 'It will be read as far as this version understands it; upgrade NestLens, or point `storage.sqlite.filename` at a new file.');
99
+ }
100
+ return parsed;
101
+ }
71
102
  initializeDatabase() {
103
+ const version = this.readSchemaVersion();
72
104
  // Create main entries table (base schema without new columns)
73
105
  this.db.exec(`
74
106
  CREATE TABLE IF NOT EXISTS nestlens_entries (
@@ -106,6 +138,11 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
106
138
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
107
139
  );
108
140
  `);
141
+ // Stamped last, so a run that dies midway through leaves the file marked
142
+ // with the version it still is rather than the one it was becoming.
143
+ if (version < SCHEMA_VERSION) {
144
+ this.db.pragma(`user_version = ${SCHEMA_VERSION}`);
145
+ }
109
146
  this.logger.log(`Database initialized: ${this.filename}`);
110
147
  }
111
148
  migrateDatabase() {
@@ -173,12 +210,16 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
173
210
  sql += ' AND request_id = ?';
174
211
  params.push(filter.requestId);
175
212
  }
213
+ // `datetime()` on both sides: SQLite writes CURRENT_TIMESTAMP as
214
+ // "2026-08-12 21:55:45" and a Date arrives as "2026-08-12T21:25:45.292Z",
215
+ // so comparing them as text compares a space against a "T" — every row
216
+ // from today or earlier reads as older than any cutoff today. See prune().
176
217
  if (filter.from) {
177
- sql += ' AND created_at >= ?';
218
+ sql += ' AND datetime(created_at) >= datetime(?)';
178
219
  params.push(filter.from.toISOString());
179
220
  }
180
221
  if (filter.to) {
181
- sql += ' AND created_at <= ?';
222
+ sql += ' AND datetime(created_at) <= datetime(?)';
182
223
  params.push(filter.to.toISOString());
183
224
  }
184
225
  // id breaks ties so rows written in the same millisecond page consistently.
@@ -314,13 +355,23 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
314
355
  unresolvedExceptions: aggregateRow.unresolved_exceptions,
315
356
  };
316
357
  }
358
+ /**
359
+ * Both sides go through `datetime()` before they are compared.
360
+ *
361
+ * SQLite stores `CURRENT_TIMESTAMP` as `2026-08-12 21:55:45` and a JavaScript
362
+ * Date arrives as `2026-08-12T21:25:45.292Z`. Compared as text — which is
363
+ * what `created_at < ?` does — the eleventh character decides: a space sorts
364
+ * before a "T", so every row whose date is the cutoff's date or earlier reads
365
+ * as older than the cutoff whatever its time. Pruning anything therefore
366
+ * pruned everything recorded that day, including entries seconds old.
367
+ */
317
368
  async prune(before) {
318
- const stmt = this.db.prepare('DELETE FROM nestlens_entries WHERE created_at < ?');
369
+ const stmt = this.db.prepare('DELETE FROM nestlens_entries WHERE datetime(created_at) < datetime(?)');
319
370
  const result = stmt.run(before.toISOString());
320
371
  return result.changes;
321
372
  }
322
373
  async pruneByType(type, before) {
323
- const stmt = this.db.prepare('DELETE FROM nestlens_entries WHERE type = ? AND created_at < ?');
374
+ const stmt = this.db.prepare('DELETE FROM nestlens_entries WHERE type = ? AND datetime(created_at) < datetime(?)');
324
375
  const result = stmt.run(type, before.toISOString());
325
376
  return result.changes;
326
377
  }
@@ -903,7 +954,8 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
903
954
  return rows.map((row) => this.rowToEntry(row));
904
955
  }
905
956
  // ==================== Monitored Tags ====================
906
- async addMonitoredTag(tag) {
957
+ async addMonitoredTag(rawTag) {
958
+ const tag = (0, tag_normalization_1.normalizeTag)(rawTag);
907
959
  const stmt = this.db.prepare(`
908
960
  INSERT OR IGNORE INTO nestlens_monitored_tags (tag)
909
961
  VALUES (?)
@@ -919,11 +971,11 @@ let SqliteStorage = SqliteStorage_1 = class SqliteStorage {
919
971
  createdAt: row.created_at,
920
972
  };
921
973
  }
922
- async removeMonitoredTag(tag) {
974
+ async removeMonitoredTag(rawTag) {
923
975
  const stmt = this.db.prepare(`
924
976
  DELETE FROM nestlens_monitored_tags WHERE tag = ?
925
977
  `);
926
- stmt.run(tag);
978
+ stmt.run((0, tag_normalization_1.normalizeTag)(rawTag));
927
979
  }
928
980
  async getMonitoredTags() {
929
981
  const stmt = this.db.prepare(`
@@ -56,8 +56,34 @@ async function createMemoryStorage(config) {
56
56
  const storage = new MemoryStorage(config.memory);
57
57
  await storage.initialize();
58
58
  logger.log('Using in-memory storage');
59
+ warnIfClustered();
59
60
  return storage;
60
61
  }
62
+ /**
63
+ * Says so when in-memory storage is running in one of several processes.
64
+ *
65
+ * The default storage lives in the process that recorded the entry, and a
66
+ * clustered application answers each request from whichever worker was free.
67
+ * The dashboard then shows one worker's entries, a refresh shows another's, and
68
+ * entries appear to come and go at random — a confusing thing to debug with a
69
+ * debugging tool. Nothing is broken; the driver simply cannot see across
70
+ * processes.
71
+ *
72
+ * Only same-host clustering is detectable from inside the process. Several
73
+ * replicas of a container have exactly the same problem and no way to know it,
74
+ * which is why the documentation covers the topology rather than this warning.
75
+ *
76
+ * Read from the environment rather than from `node:cluster`: `isWorker` is
77
+ * defined as `NODE_UNIQUE_ID !== undefined`, and loading the cluster module to
78
+ * ask leaves a handle open that outlives the process's work. `NODE_APP_INSTANCE`
79
+ * covers PM2, which sets it in fork mode as well as in cluster mode.
80
+ */
81
+ function warnIfClustered() {
82
+ if (!process.env.NODE_UNIQUE_ID && !process.env.NODE_APP_INSTANCE)
83
+ return;
84
+ logger.warn('In-memory storage in a clustered process: each worker keeps its own entries, so the dashboard ' +
85
+ 'shows only the worker that answered the request. Use the sqlite or redis driver for one shared view.');
86
+ }
61
87
  /**
62
88
  * Creates a SQLite storage instance.
63
89
  * Requires better-sqlite3 to be installed.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * One spelling for a tag, whichever way it was typed.
3
+ *
4
+ * Entry tags have always been stored upper-cased, so that `slow` and `SLOW`
5
+ * count as one tag rather than two. Monitored tags were stored verbatim, and
6
+ * the two are compared: `getMonitoredTagsWithCounts` looks a monitored tag up
7
+ * in the counts keyed by entry tag. Monitoring `checkout` therefore reported
8
+ * zero entries no matter how many carried it, on every backend.
9
+ */
10
+ export declare const normalizeTag: (tag: string) => string;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeTag = void 0;
4
+ /**
5
+ * One spelling for a tag, whichever way it was typed.
6
+ *
7
+ * Entry tags have always been stored upper-cased, so that `slow` and `SLOW`
8
+ * count as one tag rather than two. Monitored tags were stored verbatim, and
9
+ * the two are compared: `getMonitoredTagsWithCounts` looks a monitored tag up
10
+ * in the counts keyed by entry tag. Monitoring `checkout` therefore reported
11
+ * zero entries no matter how many carried it, on every backend.
12
+ */
13
+ const normalizeTag = (tag) => tag.toUpperCase();
14
+ exports.normalizeTag = normalizeTag;
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.TagService = void 0;
17
17
  const common_1 = require("@nestjs/common");
18
18
  const storage_interface_1 = require("./storage/storage.interface");
19
+ const tag_normalization_1 = require("./storage/tag-normalization");
19
20
  /**
20
21
  * Service for managing tags and auto-tagging entries
21
22
  */
@@ -591,10 +592,12 @@ let TagService = TagService_1 = class TagService {
591
592
  async getMonitoredTagsWithCounts() {
592
593
  const monitoredTags = await this.storage.getMonitoredTags();
593
594
  const allTags = await this.storage.getAllTags();
594
- const tagCountMap = new Map(allTags.map((t) => [t.tag, t.count]));
595
+ // Both sides are normalised here as well as on the way in, so a tag stored
596
+ // before monitored tags were normalised still finds its count.
597
+ const tagCountMap = new Map(allTags.map((t) => [(0, tag_normalization_1.normalizeTag)(t.tag), t.count]));
595
598
  return monitoredTags.map((tag) => ({
596
599
  ...tag,
597
- count: tagCountMap.get(tag.tag) ?? 0,
600
+ count: tagCountMap.get((0, tag_normalization_1.normalizeTag)(tag.tag)) ?? 0,
598
601
  }));
599
602
  }
600
603
  };
@@ -0,0 +1 @@
1
+ import{j as e,L as o,A as y,C as u}from"./index-DyvNu-oR.js";import{p as n,f as v}from"./badgeColors-DQ_P_DOX.js";import{D as r,f as k}from"./DetailRow-CouZ8riB.js";import{C as m}from"./types-DZUckfsW.js";import{C as w}from"./CopyButton-CVTvd0EZ.js";import{C as g}from"./circle-x-BOe5goDy.js";import{C as j}from"./circle-alert-CgZfn5uS.js";import{C}from"./circle-check-big-1S8vooWx.js";import"./vendor-DBTT3jXp.js";import"./EntryDetailPage-QTrST2MQ.js";import"./search-D9V4itpU.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:"divide-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((N,b)=>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:N})},b))})]})]})}export{E as default};
@@ -0,0 +1 @@
1
+ import{j as t,L as d}from"./index-DyvNu-oR.js";import{e as D,b as F}from"./vendor-DBTT3jXp.js";import{f as M,p as T}from"./badgeColors-DQ_P_DOX.js";import{u as A,P as L,N as R,L as $}from"./PageHeader-BAc6Jvef.js";import{u as I,q as H,C as c}from"./types-DZUckfsW.js";import{T as s,D as S,b as W}from"./DataTable-DNJpoFzh.js";function K(){const h=D(),{addFilter:o,clearAll:p,serverFilters:u,headerFilters:x,hasFilters:m}=I("batches"),{entries:g,loading:y,refreshing:i,newEntriesCount:f,hasMore:j,loadMore:b,loadNew:k,autoRefreshEnabled:C,live:N,setAutoRefresh:w,meta:n,isHighlighted:E}=A({type:"batch",limit:50,filters:u}),l=g.filter(e=>H(e)),v=F.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(c,{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,B=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:["(",B,"%)"]})]})}},{key:"status",header:"Status",width:"120px",render:e=>t.jsx(c,{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(S,{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:M(T(e.createdAt),{addSuffix:!0})})}],[o]);if(y&&l.length===0)return t.jsx("div",{className:"flex items-center justify-center h-64",role:"status","aria-label":"Loading...",children:t.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"})});const P=m?"pt-28":"pt-16";return t.jsxs("div",{children:[t.jsx(L,{title:"Batches",icon:d,iconColor:"text-blue-600 dark:text-blue-400",count:l.length,totalCount:n==null?void 0:n.total,refreshing:i,autoRefreshEnabled:C,live:N,onAutoRefreshToggle:w,filters:x,onClearAllFilters:p}),t.jsxs("div",{className:`${P} space-y-4 transition-all duration-200`,children:[t.jsx(R,{count:f,onClick:k,loading:i}),t.jsx(W,{columns:v,data:l,keyExtractor:e=>e.id,onRowClick:e=>h(`/batches/${e.id}`),rowClassName:e=>E(e.id)?"highlight-new":"",emptyMessage:"No batch operations recorded yet",emptyIcon:t.jsx(d,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),t.jsx($,{hasMore:j,onClick:b,loading:i})]})]})}export{K as default};
@@ -0,0 +1,6 @@
1
+ import{c as h,j as e,D as d,C as g}from"./index-DyvNu-oR.js";import{p as o,f as p}from"./badgeColors-DQ_P_DOX.js";import{D as t,f as b}from"./DetailRow-CouZ8riB.js";import{C as x}from"./types-DZUckfsW.js";import{u as j,C as y,T as f}from"./EntryDetailPage-QTrST2MQ.js";import{C as u}from"./CopyButton-CVTvd0EZ.js";import{C as N}from"./circle-check-big-1S8vooWx.js";import{C as v}from"./circle-x-BOe5goDy.js";import{T as k}from"./timer-CZxO8Y_Q.js";import"./vendor-DBTT3jXp.js";import"./search-D9V4itpU.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 T=h("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),n={get:{label:"GET",color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"},set:{label:"SET",color:"text-blue-500",bg:"bg-blue-100 dark:bg-blue-900/30"},del:{label:"DELETE",color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},clear:{label:"CLEAR",color:"text-orange-500",bg:"bg-orange-100 dark:bg-orange-900/30"}};function m(s){return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}function K({entry:s}){const{payload:a,createdAt:i}=s,l=j(),r=n[a.operation]||n.get,c=a.value!==void 0?[{id:"value",label:"Value",content:e.jsx(y,{data:a.value,toolbarState:l.state,searchBar:l.SearchBar,maxHeight:400})}]:[];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(d,{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",children:r.label}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Cache Operation"})]})]}),e.jsx(u,{text:a.key,label:"Copy cache key"})]})}),e.jsxs("div",{className:`grid ${a.operation==="get"?"grid-cols-2 md:grid-cols-4":"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(d,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Operation"})]}),e.jsx("p",{className:`text-lg font-bold ${r.color}`,children:r.label})]}),a.operation==="get"&&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:[a.hit?e.jsx(N,{className:"h-4 w-4"}):e.jsx(v,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Result"})]}),e.jsx("p",{className:`text-lg font-bold ${a.hit?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"}`,children:a.hit?"HIT":"MISS"})]}),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:"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"})]})]}),a.ttl!==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(k,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"TTL"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:m(a.ttl)})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(t,{label:"Time",value:e.jsxs("span",{children:[b(o(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",p(o(i),{addSuffix:!0}),")"]})]})}),e.jsx(t,{label:"Operation",value:e.jsx(x,{listType:"cache",filterType:"operations",filterValue:a.operation,children:a.operation.toUpperCase()})}),e.jsx(t,{label:"Key",value:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(T,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white break-all",children:a.key})]})}),a.operation==="get"&&e.jsx(t,{label:"Result",value:e.jsx(x,{listType:"cache",filterType:"tags",filterValue:a.hit?"hit":"miss",children:a.hit?"HIT":"MISS"})}),e.jsx(t,{label:"Duration",value:`${a.duration}ms`}),a.ttl!==void 0&&e.jsx(t,{label:"TTL",value:`${a.ttl}s (${m(a.ttl)})`})]})})]}),c.length>0&&e.jsx(f,{tabs:c,defaultTab:"value",hashKey:"cache",headerRight:e.jsx(l.Toolbar,{data:a.value})})]})}export{K as default};
@@ -0,0 +1 @@
1
+ import{j as a,H as o}from"./index-DyvNu-oR.js";import{e as T,b as E}from"./vendor-DBTT3jXp.js";import{f as v,p as D}from"./badgeColors-DQ_P_DOX.js";import{u as M,P as R,N as A,L as F}from"./PageHeader-BAc6Jvef.js";import{u as H,f as P,C as l}from"./types-DZUckfsW.js";import{T as i,D as B,b as I}from"./DataTable-DNJpoFzh.js";function V(){const n=T(),{clearAll:d,serverFilters:c,headerFilters:h,hasFilters:p}=H("cache"),{entries:u,loading:x,refreshing:t,newEntriesCount:m,hasMore:y,loadMore:g,loadNew:f,autoRefreshEnabled:j,live:k,setAutoRefresh:C,meta:r,isHighlighted:w}=M({type:"cache",limit:50,filters:c}),s=u.filter(e=>P(e)),N=E.useMemo(()=>[{key:"operation",header:"Operation",width:"100px",render:e=>a.jsx(l,{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(l,{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(B,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(i,{secondary:!0,className:"text-xs",children:v(D(e.createdAt),{addSuffix:!0})})}],[]);if(x&&s.length===0)return 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"})});const b=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(R,{title:"Cache",icon:o,iconColor:"text-cyan-600 dark:text-cyan-400",count:s.length,totalCount:r==null?void 0:r.total,refreshing:t,autoRefreshEnabled:j,live:k,onAutoRefreshToggle:C,filters:h,onClearAllFilters:d}),a.jsxs("div",{className:`${b} space-y-4 transition-all duration-200`,children:[a.jsx(A,{count:m,onClick:f,loading:t}),a.jsx(I,{columns:N,data:s,keyExtractor:e=>e.id,onRowClick:e=>n(`/cache/${e.id}`),rowClassName:e=>w(e.id)?"highlight-new":"",emptyMessage:"No cache operations recorded yet",emptyIcon:a.jsx(o,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(F,{hasMore:y,onClick:g,loading:t})]})]})}export{V as default};
@@ -0,0 +1 @@
1
+ import{j as e,a as m,C as p}from"./index-DyvNu-oR.js";import{b as v}from"./vendor-DBTT3jXp.js";import{p as h,f as N}from"./badgeColors-DQ_P_DOX.js";import{D as t,f as k}from"./DetailRow-CouZ8riB.js";import{C as b}from"./types-DZUckfsW.js";import{u as c,C as n,T as C}from"./EntryDetailPage-QTrST2MQ.js";import{C as T}from"./CopyButton-CVTvd0EZ.js";import{C as w}from"./circle-check-big-1S8vooWx.js";import{C as g}from"./circle-x-BOe5goDy.js";import"./search-D9V4itpU.js";function I({entry:u}){const{payload:a,createdAt:x}=u,d=c(),l=c(),o=c(),[i,j]=v.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:"divide-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:["(",N(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};
@@ -0,0 +1 @@
1
+ import{j as a,a as l}from"./index-DyvNu-oR.js";import{e as P,b as T}from"./vendor-DBTT3jXp.js";import{f as D,p as F}from"./badgeColors-DQ_P_DOX.js";import{u as A,P as M,N as R,L as B}from"./PageHeader-BAc6Jvef.js";import{u as H,o as L,C as d}from"./types-DZUckfsW.js";import{T as i,D as W,b as S}from"./DataTable-DNJpoFzh.js";function J(){const m=P(),{addFilter:t,clearAll:c,serverFilters:u,headerFilters:h,hasFilters:p}=H("commands"),{entries:x,loading:g,refreshing:r,newEntriesCount:f,hasMore:y,loadMore:C,loadNew:j,autoRefreshEnabled:k,live:N,setAutoRefresh:w,meta:s,isHighlighted:b}=A({type:"command",limit:50,filters:u}),o=x.filter(e=>L(e)),E=T.useMemo(()=>[{key:"name",header:"Command",minWidth:"250px",render:e=>a.jsx(d,{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(d,{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(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})})}],[t]);if(g&&o.length===0)return 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"})});const v=p?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(M,{title:"Commands",icon:l,iconColor:"text-green-600 dark:text-green-400",count:o.length,totalCount:s==null?void 0:s.total,refreshing:r,autoRefreshEnabled:k,live:N,onAutoRefreshToggle:w,filters:h,onClearAllFilters:c}),a.jsxs("div",{className:`${v} space-y-4 transition-all duration-200`,children:[a.jsx(R,{count:f,onClick:j,loading:r}),a.jsx(S,{columns:E,data:o,keyExtractor:e=>e.id,onRowClick:e=>m(`/commands/${e.id}`),rowClassName:e=>b(e.id)?"highlight-new":"",emptyMessage:"No commands recorded yet",emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(B,{hasMore:y,onClick:C,loading:r})]})]})}export{J as default};
@@ -0,0 +1,3 @@
1
+ import{j as e,z as n}from"./index-DyvNu-oR.js";import{b as p}from"./vendor-DBTT3jXp.js";import{a as i,b as c}from"./EntryDetailPage-QTrST2MQ.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
+ bg-gray-100 hover:bg-gray-200 dark:bg-gray-700 dark:hover:bg-gray-600
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 D,u as ge,j as e,D as ae,T as A,C as R,A as M,G as xe,F as me,B as ue,P as ye,a as be,H as B,b as he,L as pe,d as ke,M as fe,e as ve,R as je,f as Ne,S as we,g as V,h as W,i as Se,k as _,l as K,r as qe,m as Y}from"./index-jX7JpX7L.js";import{e as Ce,b as c,L as Ee}from"./vendor-DBTT3jXp.js";import{g as Pe,f,p as v}from"./ClickableBadge-DVTcykCM.js";import{Z as Te}from"./zap-yEefbKzX.js";import{C as $e}from"./calendar-DfnYRiPH.js";/**
1
+ import{c as D,u as ge,j as e,D as ae,T as A,C as R,A as M,G as xe,F as me,B as ue,P as ye,a as be,H as B,b as he,L as pe,d as ke,M as fe,e as ve,R as je,f as Ne,S as we,g as V,h as W,i as Se,k as _,l as K,r as qe,m as Y}from"./index-DyvNu-oR.js";import{e as Ce,b as c,L as Ee}from"./vendor-DBTT3jXp.js";import{g as Pe,f,p as v}from"./badgeColors-DQ_P_DOX.js";import{Z as Te}from"./zap-B0E2zzJ8.js";import{C as $e}from"./calendar-DcK1CETU.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -13,4 +13,4 @@ import{c as D,u as ge,j as e,D as ae,T as A,C as R,A as M,G as xe,F as me,B as u
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const Ae=D("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"}]]),re=[{name:"Core",types:[{key:"request",name:"Requests",icon:M,color:"blue",route:"/requests"},{key:"query",name:"Queries",icon:ae,color:"purple",route:"/queries"},{key:"graphql",name:"GraphQL",icon:xe,color:"fuchsia",route:"/graphql"},{key:"exception",name:"Exceptions",icon:A,color:"red",route:"/exceptions"},{key:"log",name:"Logs",icon:me,color:"green",route:"/logs"}]},{name:"Background",types:[{key:"job",name:"Jobs",icon:ue,color:"yellow",route:"/jobs"},{key:"schedule",name:"Schedule",icon:$e,color:"gray",route:"/schedule"},{key:"batch",name:"Batches",icon:ye,color:"lime",route:"/batches"},{key:"command",name:"Commands",icon:be,color:"slate",route:"/commands"}]},{name:"Data",types:[{key:"cache",name:"Cache",icon:B,color:"cyan",route:"/cache"},{key:"redis",name:"Redis",icon:he,color:"rose",route:"/redis"},{key:"model",name:"Models",icon:pe,color:"violet",route:"/models"}]},{name:"Communication",types:[{key:"http-client",name:"HTTP Client",icon:ke,color:"indigo",route:"/http-client"},{key:"mail",name:"Mail",icon:fe,color:"pink",route:"/mail"},{key:"notification",name:"Notifications",icon:ve,color:"orange",route:"/notifications"},{key:"event",name:"Events",icon:je,color:"emerald",route:"/events"}]},{name:"System",types:[{key:"view",name:"Views",icon:Ne,color:"teal",route:"/views"},{key:"gate",name:"Gates",icon:we,color:"amber",route:"/gates"},{key:"dump",name:"Dumps",icon:B,color:"stone",route:"/dumps"}]}],X=re.flatMap(n=>n.types),ee={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"},Me={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 Be(n){if(n===0)return"0 B";const t=1024,i=["B","KB","MB","GB"],s=Math.floor(Math.log(n)/Math.log(t));return`${parseFloat((n/Math.pow(t,s)).toFixed(1))} ${i[s]}`}function te(n){return n<1e3?`${Math.round(n)}ms`:`${(n/1e3).toFixed(2)}s`}function De(n){const t=n.payload;switch(n.type){case"request":return`${t.method||"GET"} ${t.path||"/"}`;case"query":const i=t.query||"";return i.length>50?i.substring(0,50)+"...":i;case"exception":return t.name||"Exception";case"log":const s=t.message||"";return s.length>50?s.substring(0,50)+"...":s;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 Ie(n){const t=n.payload;switch(n.type){case"request":const i=t.statusCode,s=t.duration;return i?`${i} · ${s?te(s):""}`:null;case"query":const g=t.duration,o=t.slow;return`${g?te(g):""} ${o?"· SLOW":""}`;case"exception":const d=t.message||"";return d.length>60?d.substring(0,60)+"...":d;case"log":return t.context||null;case"job":return t.queue||null;default:return null}}const L=5;function j({label:n,value:t,subtext:i,icon:s,trend:g,status:o="neutral",onClick:d}){const u={good:"text-emerald-500",warning:"text-amber-500",danger:"text-red-500",neutral:"text-gray-400 dark:text-gray-500"},b={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"},N=d?"button":"div";return e.jsx(N,{onClick:d,className:`${b[o]} rounded-lg border p-4 ${d?"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:n}),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}),g&&e.jsx("span",{className:`flex items-center ${g==="up"?"text-emerald-500":"text-red-500"}`,children:g==="up"?e.jsx(Ae,{className:"h-3 w-3"}):e.jsx(Le,{className:"h-3 w-3"})})]}),i&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:i})]}),e.jsx("div",{className:"p-2 rounded-lg bg-gray-100 dark:bg-gray-700/50",children:e.jsx(s,{className:`h-5 w-5 ${u[o]}`})})]})})}function Oe(){const n=Ce(),{stats:t,refreshStats:i}=ge(),[s,g]=c.useState(null),[o,d]=c.useState(null),[u,b]=c.useState(!1),[N,I]=c.useState(!0);c.useEffect(()=>{i()},[i]);const[y,w]=c.useState([]),[x,G]=c.useState(!1),[F,S]=c.useState(1),[H,se]=c.useState(0),[z,q]=c.useState(!1),[C,E]=c.useState(null),[h,P]=c.useState([]);c.useEffect(()=>{const r=async()=>{try{const[l,m]=await Promise.all([_(),K()]);g(l.data),d(m.data)}catch(l){console.error("Failed to fetch storage/pruning data:",l)}};r();const a=setInterval(r,3e4);return()=>clearInterval(a)},[]);const ne=async()=>{b(!0);try{if((await qe()).success){const[a,l]=await Promise.all([_(),K()]);g(a.data),d(l.data),i()}}catch(r){console.error("Failed to run pruning:",r)}finally{b(!1)}};c.useEffect(()=>{(async()=>{I(!0);try{const a=await Y({limit:L});w(a.data),se(a.meta.total),q(a.meta.hasMore),E(a.meta.oldestSequence),S(1),P([])}catch(a){console.error("Failed to fetch activities:",a)}finally{I(!1)}})()},[]);const oe=async()=>{if(!(!z||!C||x)){G(!0);try{P(a=>[...a,{entries:y,oldestSeq:C}]);const r=await Y({limit:L,beforeSequence:C});w(r.data),q(r.meta.hasMore),E(r.meta.oldestSequence),S(a=>a+1)}catch(r){console.error("Failed to load next page:",r)}finally{G(!1)}}},ie=()=>{if(h.length===0)return;const r=h[h.length-1];P(a=>a.slice(0,-1)),w(r.entries),E(r.oldestSeq),q(!0),S(a=>a-1)},Q=h.length>0,O=z,T=Math.ceil(H/L);if(N)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"})});const p=(t==null?void 0:t.byType.request)||0,$=(t==null?void 0:t.byType.exception)||0,U=(t==null?void 0:t.unresolvedExceptions)??$,k=(t==null?void 0:t.avgResponseTime)||0,Z=(t==null?void 0:t.slowQueries)||0,le=k<200,ce=r=>{const a=X.find(l=>l.key===r);return(a==null?void 0:a.icon)||M},de=r=>{const a=X.find(l=>l.key===r);return(a==null?void 0:a.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(j,{label:"Entries",value:(t==null?void 0:t.total)||0,subtext:"total recorded",icon:ae,status:"neutral"}),e.jsx(j,{label:"Errors",value:U,subtext:"unresolved exceptions",icon:A,status:U===0?"good":"danger",onClick:()=>n("/exceptions?resolved=false")}),e.jsx(j,{label:"Latency",value:k?`${Math.round(k)}ms`:"N/A",subtext:"avg response time",icon:R,status:k===0?"neutral":le?"good":"warning"}),e.jsx(j,{label:"Slow Queries",value:Z,subtext:"exceeding threshold",icon:Te,status:Z===0?"good":"warning",onClick:()=>n("/queries?slow=true")})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:re.map(r=>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:r.name})}),e.jsx("div",{className:"p-2.5",children:r.types.map(a=>{const l=a.key==="exception"?(t==null?void 0:t.unresolvedExceptions)??0:(t==null?void 0:t.byType[a.key])||0,m=a.icon,J=l>0;return e.jsxs(Ee,{to:a.route,className:`group flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all ${J?"hover:bg-gray-50 dark:hover:bg-gray-700/50":"opacity-50 hover:opacity-75"}`,children:[e.jsx("div",{className:`p-2 rounded-lg ${Me[a.key]||"bg-gray-100 dark:bg-gray-700/50"} group-hover:scale-105 transition-transform`,children:e.jsx(m,{className:`h-3.5 w-3.5 ${ee[a.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:a.name})}),e.jsx("span",{className:`text-sm font-semibold tabular-nums ${J?"text-gray-900 dark:text-white":"text-gray-400 dark:text-gray-500"}`,children:l.toLocaleString()})]},a.key)})})]},r.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"}),x&&e.jsx("div",{className:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary-600",role:"status","aria-label":"Loading"})]}),H>0&&e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[F," / ",T]})]}),e.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-gray-700/50 flex-1 relative",style:{minHeight:"340px"},children:[x&&y.length>0&&e.jsx("div",{className:"absolute inset-0 bg-white/50 dark:bg-gray-800/50 z-10 pointer-events-none"}),y.length===0&&!x?e.jsxs("div",{className:"p-8 text-center text-gray-500 dark:text-gray-400",children:[e.jsx(M,{className:"h-7 w-7 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No entries recorded yet"})]}):y.length===0&&x?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"})}):y.map(r=>{const a=ce(r.type),l=De(r),m=Ie(r);return e.jsxs("div",{onClick:()=>n(`${de(r.type)}/${r.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(a,{className:`h-4 w-4 ${ee[r.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 ${Pe(r.type)}`,children:r.type}),e.jsx("span",{className:"text-sm text-gray-900 dark:text-white truncate font-mono",children:l})]}),m&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate mt-0.5",children:m})]}),e.jsx("div",{className:"flex-shrink-0 text-xs text-gray-400 dark:text-gray-500 whitespace-nowrap",children:f(v(r.createdAt),{addSuffix:!0})}),e.jsx(V,{className:"h-4 w-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},r.id)})]}),T>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:ie,disabled:!Q||x,className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${Q&&!x?"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(Re,{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 ",F," of ",T]}),e.jsxs("button",{onClick:oe,disabled:!O||x,className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${O&&!x?"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(V,{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(B,{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:s!=null&&s.databaseSize?Be(s.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(A,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Error Rate"})]}),e.jsxs("span",{className:`text-sm font-semibold ${p>0&&$/p*100<5?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"}`,children:[p>0?($/p*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(R,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Retention"})]}),e.jsxs("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:[(o==null?void 0:o.maxAge)||24,"h"]})]}),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(W,{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:o!=null&&o.lastRun?f(v(o.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(R,{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:o!=null&&o.nextRun?f(v(o.nextRun),{addSuffix:!0}):"N/A"})]})]}),e.jsx("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("button",{onClick:ne,disabled:u||!(o!=null&&o.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(Se,{className:"h-4 w-4 animate-spin"}):e.jsx(W,{className:"h-4 w-4"}),e.jsx("span",{children:u?"Pruning...":"Prune Now"})]})}),(s==null?void 0:s.oldestEntry)&&(s==null?void 0:s.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 ",f(v(s.oldestEntry))]})})]})]})]})]})}export{Oe as default};
16
+ */const Ae=D("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"}]]),re=[{name:"Core",types:[{key:"request",name:"Requests",icon:M,color:"blue",route:"/requests"},{key:"query",name:"Queries",icon:ae,color:"purple",route:"/queries"},{key:"graphql",name:"GraphQL",icon:xe,color:"fuchsia",route:"/graphql"},{key:"exception",name:"Exceptions",icon:A,color:"red",route:"/exceptions"},{key:"log",name:"Logs",icon:me,color:"green",route:"/logs"}]},{name:"Background",types:[{key:"job",name:"Jobs",icon:ue,color:"yellow",route:"/jobs"},{key:"schedule",name:"Schedule",icon:$e,color:"gray",route:"/schedule"},{key:"batch",name:"Batches",icon:ye,color:"lime",route:"/batches"},{key:"command",name:"Commands",icon:be,color:"slate",route:"/commands"}]},{name:"Data",types:[{key:"cache",name:"Cache",icon:B,color:"cyan",route:"/cache"},{key:"redis",name:"Redis",icon:he,color:"rose",route:"/redis"},{key:"model",name:"Models",icon:pe,color:"violet",route:"/models"}]},{name:"Communication",types:[{key:"http-client",name:"HTTP Client",icon:ke,color:"indigo",route:"/http-client"},{key:"mail",name:"Mail",icon:fe,color:"pink",route:"/mail"},{key:"notification",name:"Notifications",icon:ve,color:"orange",route:"/notifications"},{key:"event",name:"Events",icon:je,color:"emerald",route:"/events"}]},{name:"System",types:[{key:"view",name:"Views",icon:Ne,color:"teal",route:"/views"},{key:"gate",name:"Gates",icon:we,color:"amber",route:"/gates"},{key:"dump",name:"Dumps",icon:B,color:"stone",route:"/dumps"}]}],X=re.flatMap(n=>n.types),ee={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"},Me={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 Be(n){if(n===0)return"0 B";const t=1024,i=["B","KB","MB","GB"],s=Math.floor(Math.log(n)/Math.log(t));return`${parseFloat((n/Math.pow(t,s)).toFixed(1))} ${i[s]}`}function te(n){return n<1e3?`${Math.round(n)}ms`:`${(n/1e3).toFixed(2)}s`}function De(n){const t=n.payload;switch(n.type){case"request":return`${t.method||"GET"} ${t.path||"/"}`;case"query":const i=t.query||"";return i.length>50?i.substring(0,50)+"...":i;case"exception":return t.name||"Exception";case"log":const s=t.message||"";return s.length>50?s.substring(0,50)+"...":s;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 Ie(n){const t=n.payload;switch(n.type){case"request":const i=t.statusCode,s=t.duration;return i?`${i} · ${s?te(s):""}`:null;case"query":const g=t.duration,o=t.slow;return`${g?te(g):""} ${o?"· SLOW":""}`;case"exception":const d=t.message||"";return d.length>60?d.substring(0,60)+"...":d;case"log":return t.context||null;case"job":return t.queue||null;default:return null}}const L=5;function j({label:n,value:t,subtext:i,icon:s,trend:g,status:o="neutral",onClick:d}){const u={good:"text-emerald-500",warning:"text-amber-500",danger:"text-red-500",neutral:"text-gray-400 dark:text-gray-500"},b={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"},N=d?"button":"div";return e.jsx(N,{onClick:d,className:`${b[o]} rounded-lg border p-4 ${d?"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:n}),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}),g&&e.jsx("span",{className:`flex items-center ${g==="up"?"text-emerald-500":"text-red-500"}`,children:g==="up"?e.jsx(Ae,{className:"h-3 w-3"}):e.jsx(Le,{className:"h-3 w-3"})})]}),i&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:i})]}),e.jsx("div",{className:"p-2 rounded-lg bg-gray-100 dark:bg-gray-700/50",children:e.jsx(s,{className:`h-5 w-5 ${u[o]}`})})]})})}function Oe(){const n=Ce(),{stats:t,refreshStats:i}=ge(),[s,g]=c.useState(null),[o,d]=c.useState(null),[u,b]=c.useState(!1),[N,I]=c.useState(!0);c.useEffect(()=>{i()},[i]);const[y,w]=c.useState([]),[x,G]=c.useState(!1),[F,S]=c.useState(1),[H,se]=c.useState(0),[z,q]=c.useState(!1),[C,E]=c.useState(null),[h,P]=c.useState([]);c.useEffect(()=>{const r=async()=>{try{const[l,m]=await Promise.all([_(),K()]);g(l.data),d(m.data)}catch(l){console.error("Failed to fetch storage/pruning data:",l)}};r();const a=setInterval(r,3e4);return()=>clearInterval(a)},[]);const ne=async()=>{b(!0);try{if((await qe()).success){const[a,l]=await Promise.all([_(),K()]);g(a.data),d(l.data),i()}}catch(r){console.error("Failed to run pruning:",r)}finally{b(!1)}};c.useEffect(()=>{(async()=>{I(!0);try{const a=await Y({limit:L});w(a.data),se(a.meta.total),q(a.meta.hasMore),E(a.meta.oldestSequence),S(1),P([])}catch(a){console.error("Failed to fetch activities:",a)}finally{I(!1)}})()},[]);const oe=async()=>{if(!(!z||!C||x)){G(!0);try{P(a=>[...a,{entries:y,oldestSeq:C}]);const r=await Y({limit:L,beforeSequence:C});w(r.data),q(r.meta.hasMore),E(r.meta.oldestSequence),S(a=>a+1)}catch(r){console.error("Failed to load next page:",r)}finally{G(!1)}}},ie=()=>{if(h.length===0)return;const r=h[h.length-1];P(a=>a.slice(0,-1)),w(r.entries),E(r.oldestSeq),q(!0),S(a=>a-1)},Q=h.length>0,O=z,T=Math.ceil(H/L);if(N)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"})});const p=(t==null?void 0:t.byType.request)??0,$=(t==null?void 0:t.byType.exception)??0,U=(t==null?void 0:t.unresolvedExceptions)??$,k=(t==null?void 0:t.avgResponseTime)??0,Z=(t==null?void 0:t.slowQueries)??0,le=k<200,ce=r=>{const a=X.find(l=>l.key===r);return(a==null?void 0:a.icon)??M},de=r=>{const a=X.find(l=>l.key===r);return(a==null?void 0:a.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(j,{label:"Entries",value:(t==null?void 0:t.total)??0,subtext:"total recorded",icon:ae,status:"neutral"}),e.jsx(j,{label:"Errors",value:U,subtext:"unresolved exceptions",icon:A,status:U===0?"good":"danger",onClick:()=>n("/exceptions?resolved=false")}),e.jsx(j,{label:"Latency",value:k?`${Math.round(k)}ms`:"N/A",subtext:"avg response time",icon:R,status:k===0?"neutral":le?"good":"warning"}),e.jsx(j,{label:"Slow Queries",value:Z,subtext:"exceeding threshold",icon:Te,status:Z===0?"good":"warning",onClick:()=>n("/queries?slow=true")})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:re.map(r=>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:r.name})}),e.jsx("div",{className:"p-2.5",children:r.types.map(a=>{const l=a.key==="exception"?(t==null?void 0:t.unresolvedExceptions)??0:(t==null?void 0:t.byType[a.key])??0,m=a.icon,J=l>0;return e.jsxs(Ee,{to:a.route,className:`group flex items-center gap-2.5 px-2.5 py-2 rounded-lg transition-all ${J?"hover:bg-gray-50 dark:hover:bg-gray-700/50":"opacity-50 hover:opacity-75"}`,children:[e.jsx("div",{className:`p-2 rounded-lg ${Me[a.key]||"bg-gray-100 dark:bg-gray-700/50"} group-hover:scale-105 transition-transform`,children:e.jsx(m,{className:`h-3.5 w-3.5 ${ee[a.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:a.name})}),e.jsx("span",{className:`text-sm font-semibold tabular-nums ${J?"text-gray-900 dark:text-white":"text-gray-400 dark:text-gray-500"}`,children:l.toLocaleString()})]},a.key)})})]},r.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"}),x&&e.jsx("div",{className:"animate-spin rounded-full h-3 w-3 border-b-2 border-primary-600",role:"status","aria-label":"Loading"})]}),H>0&&e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[F," / ",T]})]}),e.jsxs("div",{className:"divide-y divide-gray-100 dark:divide-gray-700/50 flex-1 relative",style:{minHeight:"340px"},children:[x&&y.length>0&&e.jsx("div",{className:"absolute inset-0 bg-white/50 dark:bg-gray-800/50 z-10 pointer-events-none"}),y.length===0&&!x?e.jsxs("div",{className:"p-8 text-center text-gray-500 dark:text-gray-400",children:[e.jsx(M,{className:"h-7 w-7 mx-auto mb-2 opacity-50"}),e.jsx("p",{className:"text-sm",children:"No entries recorded yet"})]}):y.length===0&&x?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"})}):y.map(r=>{const a=ce(r.type),l=De(r),m=Ie(r);return e.jsxs("div",{onClick:()=>n(`${de(r.type)}/${r.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(a,{className:`h-4 w-4 ${ee[r.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 ${Pe(r.type)}`,children:r.type}),e.jsx("span",{className:"text-sm text-gray-900 dark:text-white truncate font-mono",children:l})]}),m&&e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate mt-0.5",children:m})]}),e.jsx("div",{className:"flex-shrink-0 text-xs text-gray-400 dark:text-gray-500 whitespace-nowrap",children:f(v(r.createdAt),{addSuffix:!0})}),e.jsx(V,{className:"h-4 w-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},r.id)})]}),T>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:ie,disabled:!Q||x,className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${Q&&!x?"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(Re,{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 ",F," of ",T]}),e.jsxs("button",{onClick:oe,disabled:!O||x,className:`flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${O&&!x?"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(V,{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(B,{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:s!=null&&s.databaseSize?Be(s.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(A,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Error Rate"})]}),e.jsxs("span",{className:`text-sm font-semibold ${p>0&&$/p*100<5?"text-emerald-600 dark:text-emerald-400":"text-red-600 dark:text-red-400"}`,children:[p>0?($/p*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(R,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:"Retention"})]}),e.jsxs("span",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:[(o==null?void 0:o.maxAge)??24,"h"]})]}),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(W,{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:o!=null&&o.lastRun?f(v(o.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(R,{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:o!=null&&o.nextRun?f(v(o.nextRun),{addSuffix:!0}):"N/A"})]})]}),e.jsx("div",{className:"pt-3 border-t border-gray-200 dark:border-gray-700",children:e.jsxs("button",{onClick:ne,disabled:u||!(o!=null&&o.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(Se,{className:"h-4 w-4 animate-spin"}):e.jsx(W,{className:"h-4 w-4"}),e.jsx("span",{children:u?"Pruning...":"Prune Now"})]})}),(s==null?void 0:s.oldestEntry)&&(s==null?void 0:s.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 ",f(v(s.oldestEntry))]})})]})]})]})]})}export{Oe as default};
@@ -0,0 +1,53 @@
1
+ import{c as A,j as e,g as S}from"./index-DyvNu-oR.js";import{b as c}from"./vendor-DBTT3jXp.js";import{g as b}from"./badgeColors-DQ_P_DOX.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 R=A("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"}]]);function z({columns:r,rows:s=5}){return e.jsx(e.Fragment,{children:Array.from({length:s}).map((n,t)=>e.jsx("tr",{className:"animate-pulse",children:Array.from({length:r}).map((i,o)=>e.jsx("td",{className:"px-4 py-3",children:e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-3/4"})},o))},t))})}function F({message:r,icon:s}){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:s||e.jsx(R,{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:r})]})}function L({columns:r,data:s,keyExtractor:n,onRowClick:t,loading:i=!1,emptyMessage:o="No data available",emptyIcon:g,showChevron:p=!0,compact:m=!1,stickyHeader:$=!0,maxHeight:y,zebraStripes:D=!1,rowClassName:v}){const j=m?"px-3 py-2":"px-4 py-3",k=m?"px-3 py-2":"px-4 py-3",[u,x]=c.useState(-1),[N,E]=c.useState(-1),f=c.useRef(null),h=r.length+(p&&t?1:0),w=a=>{switch(a){case"center":return"text-center";case"right":return"text-right";default:return"text-left"}},I=c.useCallback((a,d,l)=>{if(t)switch(a.key){case"Enter":case" ":a.preventDefault(),t(d),E(l);break;case"ArrowDown":a.preventDefault(),l<s.length-1&&x(l+1);break;case"ArrowUp":a.preventDefault(),l>0&&x(l-1);break;case"Home":a.preventDefault(),x(0);break;case"End":a.preventDefault(),x(s.length-1);break}},[t,s.length]);return c.useEffect(()=>{if(u>=0&&f.current){const d=f.current.querySelectorAll("tbody tr[tabindex]")[u];d&&d.focus()}},[u]),e.jsx("div",{className:"card overflow-hidden",children:e.jsx("div",{className:`overflow-x-auto ${y?"overflow-y-auto":""}`,style:y?{maxHeight:y}:void 0,children:e.jsxs("table",{ref:f,className:"w-full border-collapse",role:"grid","aria-rowcount":s.length,"aria-colcount":h,children:[e.jsx("thead",{className:`bg-gray-50 dark:bg-gray-800/50 ${$?"sticky top-0 z-10":""}`,children:e.jsxs("tr",{role:"row",children:[r.map(a=>e.jsx("th",{scope:"col",role:"columnheader","aria-sort":a.sortable?"none":void 0,className:`
7
+ ${k}
8
+ ${w(a.headerAlign||a.align)}
9
+ text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider
10
+ border-b border-gray-200 dark:border-gray-700
11
+ bg-gray-50 dark:bg-gray-800/50
12
+ whitespace-nowrap
13
+ ${a.sticky?"sticky left-0 z-20":""}
14
+ `,style:{width:a.width,minWidth:a.minWidth},children:a.header},a.key)),p&&t&&e.jsx("th",{scope:"col",role:"columnheader",className:`
15
+ ${k}
16
+ w-12
17
+ border-b border-gray-200 dark:border-gray-700
18
+ bg-gray-50 dark:bg-gray-800/50
19
+ `,"aria-label":"Expand row"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-800",children:i?e.jsx(z,{columns:h,rows:5}):s.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:h,children:e.jsx(F,{message:o,icon:g})})}):s.map((a,d)=>e.jsxs("tr",{role:"row","aria-rowindex":d+1,"aria-selected":t&&N===d?!0:void 0,onClick:t?()=>t(a):void 0,onKeyDown:t?l=>I(l,a,d):void 0,tabIndex:t?0:void 0,className:`
20
+ group
21
+ transition-colors duration-150
22
+ ${t?"cursor-pointer":""}
23
+ ${D&&d%2===1?"bg-gray-50/50 dark:bg-gray-800/25":"bg-white dark:bg-gray-900"}
24
+ hover:bg-primary-50/50 dark:hover:bg-primary-900/10
25
+ focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-inset
26
+ ${N===d?"bg-primary-50 dark:bg-primary-900/20":""}
27
+ ${v?v(a):""}
28
+ `,children:[r.map(l=>e.jsx("td",{role:"gridcell",className:`
29
+ ${j}
30
+ ${w(l.align)}
31
+ ${l.sticky?"sticky left-0 z-10 bg-inherit":""}
32
+ `,style:{width:l.width,minWidth:l.minWidth},children:l.render(a,d)},l.key)),p&&t&&e.jsx("td",{className:`${j} w-12 text-right`,role:"gridcell",children:e.jsx(S,{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(a)))})]})})})}function U({children:r,mono:s=!1,truncate:n=!1,maxWidth:t,secondary:i=!1,className:o=""}){return e.jsx("span",{className:`
33
+ text-sm
34
+ ${s?"font-mono":""}
35
+ ${i?"text-gray-500 dark:text-gray-400":"text-gray-900 dark:text-white"}
36
+ ${n?"block truncate":""}
37
+ ${o}
38
+ `,style:t?{maxWidth:t,display:"block"}:void 0,title:n&&typeof r=="string"?r:void 0,children:r})}function G({tags:r,max:s=3,onTagClick:n}){const t=r.slice(0,s),i=r.length-s;return r.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:[t.map(o=>e.jsx("button",{onClick:n?g=>n(o,g):void 0,role:n?"button":void 0,tabIndex:n?0:void 0,"aria-label":n?`Click to filter by ${o.toUpperCase()}`:void 0,className:`
39
+ inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide shadow
40
+ ${b(o)}
41
+ ${n?"cursor-pointer hover:scale-105":""}
42
+ transition-transform
43
+ `,children:o.toUpperCase()},o)),i>0&&e.jsxs("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:["+",i]})]})}function K({ms:r,slowThreshold:s=1e3,verySlowThreshold:n=5e3}){let t,i;return r>=n?t="text-red-600 dark:text-red-400":r>=s?t="text-yellow-600 dark:text-yellow-400":t="text-gray-600 dark:text-gray-300",r>=1e3?i=`${(r/1e3).toFixed(2)}s`:i=`${Number.isInteger(r)?r:r.toFixed(2)}ms`,e.jsx("span",{className:`text-sm font-mono tabular-nums ${t}`,children:i})}function O({onClick:r}){const s=b("ERROR");return e.jsx("button",{onClick:r,className:`
44
+ inline-flex items-center px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide shadow
45
+ ${s}
46
+ ${r?"cursor-pointer hover:scale-105":""}
47
+ transition-transform
48
+ `,children:"ERROR"})}function P({count:r,onClick:s}){if(r===0)return null;const n=b("N+1");return e.jsx("button",{onClick:s,title:`${r} potential N+1 ${r===1?"query":"queries"} detected`,className:`
49
+ inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide shadow
50
+ ${n}
51
+ ${s?"cursor-pointer hover:scale-105":""}
52
+ transition-transform
53
+ `,children:"N+1"})}export{K as D,O as G,P as N,U as T,G as a,L as b};
@@ -0,0 +1 @@
1
+ import{t as m,a as M,c as b,n as _,b as E,m as Q,d as F,e as B}from"./badgeColors-DQ_P_DOX.js";import{j as T}from"./index-DyvNu-oR.js";function Y(r,e){var u,o,l,h;const t=M(),n=(e==null?void 0:e.weekStartsOn)??((o=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:o.weekStartsOn)??t.weekStartsOn??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,a=m(r,e==null?void 0:e.in),s=a.getDay(),i=(s<n?7:0)+s-n;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function D(r,e){return Y(r,{...e,weekStartsOn:1})}function H(r,e){const t=m(r,e==null?void 0:e.in),n=t.getFullYear(),a=b(t,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const s=D(a),i=b(t,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const u=D(i);return t.getTime()>=s.getTime()?n+1:t.getTime()>=u.getTime()?n:n-1}function S(r,e){const t=m(r,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function X(r,e,t){const[n,a]=_(t==null?void 0:t.in,r,e),s=S(n),i=S(a),u=+s-E(s),o=+i-E(i);return Math.round((u-o)/Q)}function L(r,e){const t=H(r,e),n=b(r,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),D(n)}function R(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function I(r){return!(!R(r)&&typeof r!="number"||isNaN(+m(r)))}function j(r,e){const t=m(r,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function $(r,e){const t=m(r,e==null?void 0:e.in);return X(t,j(t))+1}function V(r,e){const t=m(r,e==null?void 0:e.in),n=+D(t)-+L(t);return Math.round(n/F)+1}function C(r,e){var h,O,x,k;const t=m(r,e==null?void 0:e.in),n=t.getFullYear(),a=M(),s=(e==null?void 0:e.firstWeekContainsDate)??((O=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:O.firstWeekContainsDate)??a.firstWeekContainsDate??((k=(x=a.locale)==null?void 0:x.options)==null?void 0:k.firstWeekContainsDate)??1,i=b((e==null?void 0:e.in)||r,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);const u=Y(i,e),o=b((e==null?void 0:e.in)||r,0);o.setFullYear(n,0,s),o.setHours(0,0,0,0);const l=Y(o,e);return+t>=+u?n+1:+t>=+l?n:n-1}function J(r,e){var u,o,l,h;const t=M(),n=(e==null?void 0:e.firstWeekContainsDate)??((o=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:o.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(l=t.locale)==null?void 0:l.options)==null?void 0:h.firstWeekContainsDate)??1,a=C(r,e),s=b((e==null?void 0:e.in)||r,0);return s.setFullYear(a,0,n),s.setHours(0,0,0,0),Y(s,e)}function K(r,e){const t=m(r,e==null?void 0:e.in),n=+Y(t,e)-+J(t,e);return Math.round(n/F)+1}function c(r,e){const t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}const g={y(r,e){const t=r.getFullYear(),n=t>0?t:1-t;return c(e==="yy"?n%100:n,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):c(t+1,2)},d(r,e){return c(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return c(r.getHours()%12||12,e.length)},H(r,e){return c(r.getHours(),e.length)},m(r,e){return c(r.getMinutes(),e.length)},s(r,e){return c(r.getSeconds(),e.length)},S(r,e){const t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return c(a,e.length)}},y={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},W={G:function(r,e,t){const n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return g.y(r,e)},Y:function(r,e,t,n){const a=C(r,n),s=a>0?a:1-a;if(e==="YY"){const i=s%100;return c(i,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):c(s,e.length)},R:function(r,e){const t=H(r);return c(t,e.length)},u:function(r,e){const t=r.getFullYear();return c(t,e.length)},Q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return c(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return c(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){const n=r.getMonth();switch(e){case"M":case"MM":return g.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){const n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return c(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){const a=K(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(r,e,t){const n=V(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):c(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):g.d(r,e)},D:function(r,e,t){const n=$(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):c(n,e.length)},E:function(r,e,t){const n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return c(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return c(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){const n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){const a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){const n=r.getHours();let a;switch(n===12?a=y.noon:n===0?a=y.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){const n=r.getHours();let a;switch(n>=17?a=y.evening:n>=12?a=y.afternoon:n>=4?a=y.morning:a=y.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return g.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):g.H(r,e)},K:function(r,e,t){const n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):g.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):g.s(r,e)},S:function(r,e){return g.S(r,e)},X:function(r,e,t){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return N(n);case"XXXX":case"XX":return w(n);case"XXXXX":case"XXX":default:return w(n,":")}},x:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"x":return N(n);case"xxxx":case"xx":return w(n);case"xxxxx":case"xxx":default:return w(n,":")}},O:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+q(n,":");case"OOOO":default:return"GMT"+w(n,":")}},z:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+q(n,":");case"zzzz":default:return"GMT"+w(n,":")}},t:function(r,e,t){const n=Math.trunc(+r/1e3);return c(n,e.length)},T:function(r,e,t){return c(+r,e.length)}};function q(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),s=n%60;return s===0?t+String(a):t+String(a)+e+c(s,2)}function N(r,e){return r%60===0?(r>0?"-":"+")+c(Math.abs(r)/60,2):w(r,e)}function w(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=c(Math.trunc(n/60),2),s=c(n%60,2);return t+a+e+s}const v=(r,e)=>{switch(r){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},G=(r,e)=>{switch(r){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},U=(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return v(r,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",v(n,e)).replace("{{time}}",G(a,e))},Z={p:G,P:U},A=/^D+$/,z=/^Y+$/,p=["D","DD","YY","YYYY"];function ee(r){return A.test(r)}function te(r){return z.test(r)}function re(r,e,t){const n=ne(r,e,t);if(console.warn(n),p.includes(r))throw new RangeError(n)}function ne(r,e,t){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ae=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,se=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ce=/^'([^]*?)'?$/,ie=/''/g,ue=/[a-zA-Z]/;function he(r,e,t){var h,O,x,k;const n=M(),a=n.locale??B,s=n.firstWeekContainsDate??((O=(h=n.locale)==null?void 0:h.options)==null?void 0:O.firstWeekContainsDate)??1,i=n.weekStartsOn??((k=(x=n.locale)==null?void 0:x.options)==null?void 0:k.weekStartsOn)??0,u=m(r,t==null?void 0:t.in);if(!I(u))throw new RangeError("Invalid time value");let o=e.match(se).map(f=>{const d=f[0];if(d==="p"||d==="P"){const P=Z[d];return P(f,a.formatLong)}return f}).join("").match(ae).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const d=f[0];if(d==="'")return{isToken:!1,value:oe(f)};if(W[d])return{isToken:!0,value:f};if(d.match(ue))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:f}});a.localize.preprocessor&&(o=a.localize.preprocessor(u,o));const l={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return o.map(f=>{if(!f.isToken)return f.value;const d=f.value;(te(d)||ee(d))&&re(d,e,String(r));const P=W[d[0]];return P(u,d,a.localize,l)}).join("")}function oe(r){const e=r.match(ce);return e?e[1].replace(ie,"'"):r}function me({label:r,value:e,className:t=""}){return T.jsxs("div",{className:`grid grid-cols-[180px_1fr] gap-4 py-3 border-b border-gray-100 dark:border-gray-700 last:border-0 ${t}`,children:[T.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:r}),T.jsx("dd",{className:"text-sm text-gray-900 dark:text-white break-all",children:e})]})}export{me as D,he as f};
@@ -0,0 +1,11 @@
1
+ import{c as n,j as e,H as d,D as h,F as j,C as g}from"./index-DyvNu-oR.js";import{p as c,f as u}from"./badgeColors-DQ_P_DOX.js";import{D as a,f}from"./DetailRow-CouZ8riB.js";import{C as l}from"./types-DZUckfsW.js";import{C as N}from"./CopyButton-CVTvd0EZ.js";import{C as y}from"./circle-check-big-1S8vooWx.js";import{C as x}from"./circle-x-BOe5goDy.js";import"./vendor-DBTT3jXp.js";import"./EntryDetailPage-QTrST2MQ.js";import"./search-D9V4itpU.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 b=n("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
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 k=n("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);function o(r){return r?r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:r<1024*1024*1024?`${(r/(1024*1024)).toFixed(1)}MB`:`${(r/(1024*1024*1024)).toFixed(1)}GB`:"-"}const v={export:"text-blue-600 dark:text-blue-400",import:"text-purple-600 dark:text-purple-400",backup:"text-green-600 dark:text-green-400",restore:"text-orange-600 dark:text-orange-400",migrate:"text-cyan-600 dark:text-cyan-400"};function V({entry:r}){const{payload:s,createdAt:i}=r,t=s.status==="completed"?{icon:y,color:"text-green-500",bg:"bg-green-100 dark:bg-green-900/30"}:{icon:x,color:"text-red-500",bg:"bg-red-100 dark:bg-red-900/30"},m=t.icon,p=v[s.operation]||"text-gray-600 dark:text-gray-400";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(d,{className:`h-5 w-5 ${t.color}`})}),e.jsxs("div",{children:[e.jsxs("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:[s.operation.toUpperCase()," - ",s.format]}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:"Data Dump"})]})]}),(s.source||s.destination)&&e.jsx(N,{text:s.destination||s.source||"",label:"Copy path"})]})}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 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(d,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Operation"})]}),e.jsx("p",{className:`text-lg font-bold ${p}`,children:s.operation.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(m,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Status"})]}),e.jsx("p",{className:`text-lg font-bold ${t.color}`,children: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(h,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Records"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:s.recordCount!==void 0?s.recordCount.toLocaleString():"-"})]}),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(j,{className:"h-4 w-4"}),e.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Size"})]}),e.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-white",children:o(s.fileSize)})]}),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:"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"})]})]})]})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Details"})}),e.jsx("div",{className:"p-4",children:e.jsxs("dl",{className:"divide-y-0",children:[e.jsx(a,{label:"Time",value:e.jsxs("span",{children:[f(c(i),"MMMM do yyyy, h:mm:ss a")," ",e.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:["(",u(c(i),{addSuffix:!0}),")"]})]})}),e.jsx(a,{label:"Operation",value:e.jsx(l,{listType:"dumps",filterType:"operations",filterValue:s.operation,children:s.operation.toUpperCase()})}),e.jsx(a,{label:"Format",value:e.jsx(l,{listType:"dumps",filterType:"formats",filterValue:s.format,children:s.format})}),e.jsx(a,{label:"Status",value:e.jsx(l,{listType:"dumps",filterType:"statuses",filterValue:s.status,children:s.status.toUpperCase()})}),s.source&&e.jsx(a,{label:"Source",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white break-all",children:s.source})}),s.destination&&e.jsx(a,{label:"Destination",value:e.jsx("code",{className:"text-sm font-mono text-gray-900 dark:text-white break-all",children:s.destination})}),s.recordCount!==void 0&&e.jsx(a,{label:"Records",value:s.recordCount.toLocaleString()}),e.jsx(a,{label:"Size",value:o(s.fileSize)}),e.jsx(a,{label:"Duration",value:`${s.duration}ms`}),s.compressed&&e.jsx(a,{label:"Compressed",value:e.jsxs("span",{className:"inline-flex items-center space-x-1",children:[e.jsx(b,{className:"h-4 w-4 text-blue-500"}),e.jsx("span",{children:"Yes"})]})}),s.encrypted&&e.jsx(a,{label:"Encrypted",value:e.jsxs("span",{className:"inline-flex items-center space-x-1",children:[e.jsx(k,{className:"h-4 w-4 text-green-500"}),e.jsx("span",{children:"Yes"})]})})]})})]}),s.error&&e.jsxs("div",{className:"card border-red-200 dark:border-red-800",children:[e.jsx("div",{className:"px-4 py-3 border-b border-red-200 dark:border-red-800 bg-red-50 dark:bg-red-900/20",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(x,{className:"h-5 w-5 text-red-500"}),e.jsx("h2",{className:"text-lg font-semibold text-red-700 dark:text-red-400",children:"Error"})]})}),e.jsx("div",{className:"p-4 bg-red-50/50 dark:bg-red-900/10",children:e.jsx("pre",{className:"text-sm text-red-600 dark:text-red-400 font-mono whitespace-pre-wrap overflow-x-auto",children:s.error})})]})]})}export{V as default};
@@ -0,0 +1 @@
1
+ import{j as a,H as l}from"./index-DyvNu-oR.js";import{e as P,b as B}from"./vendor-DBTT3jXp.js";import{f as M,p as R}from"./badgeColors-DQ_P_DOX.js";import{u as S,P as T,N as $,L as A}from"./PageHeader-BAc6Jvef.js";import{u as z,r as H,C as d}from"./types-DZUckfsW.js";import{T as o,D as L,b}from"./DataTable-DNJpoFzh.js";function J(){const p=P(),{addFilter:t,clearAll:u,serverFilters:c,headerFilters:h,hasFilters:m}=z("dumps"),{entries:x,loading:g,refreshing:i,newEntriesCount:f,hasMore:j,loadMore:y,loadNew:C,autoRefreshEnabled:k,live:w,setAutoRefresh:N,meta:s,isHighlighted:v}=S({type:"dump",limit:50,filters:c}),n=x.filter(e=>H(e)),D=e=>e?e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)}MB`:`${(e/(1024*1024*1024)).toFixed(1)}GB`:"-",E=B.useMemo(()=>[{key:"operation",header:"Operation",width:"120px",render:e=>a.jsx(d,{onClick:r=>{r.stopPropagation(),t("operations",e.payload.operation)},children:e.payload.operation.toUpperCase()})},{key:"format",header:"Format",width:"100px",render:e=>a.jsx(d,{onClick:r=>{r.stopPropagation(),t("formats",e.payload.format)},className:"font-mono",children:e.payload.format})},{key:"records",header:"Records",width:"100px",align:"right",render:e=>e.payload.recordCount!==void 0?a.jsx(o,{children:e.payload.recordCount.toLocaleString()}):a.jsx(o,{secondary:!0,children:"-"})},{key:"size",header:"Size",width:"100px",align:"right",render:e=>a.jsx(o,{children:D(e.payload.fileSize)})},{key:"status",header:"Status",width:"100px",render:e=>a.jsx(d,{onClick:r=>{r.stopPropagation(),t("statuses",e.payload.status)},children:e.payload.status.toUpperCase()})},{key:"duration",header:"Duration",width:"100px",align:"right",render:e=>a.jsx(L,{ms:e.payload.duration||0})},{key:"time",header:"Time",width:"170px",align:"right",render:e=>a.jsx(o,{secondary:!0,className:"text-xs",children:M(R(e.createdAt),{addSuffix:!0})})}],[t]);if(g&&n.length===0)return 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"})});const F=m?"pt-28":"pt-16";return a.jsxs("div",{children:[a.jsx(T,{title:"Dumps",icon:l,iconColor:"text-slate-600 dark:text-slate-400",count:n.length,totalCount:s==null?void 0:s.total,refreshing:i,autoRefreshEnabled:k,live:w,onAutoRefreshToggle:N,filters:h,onClearAllFilters:u}),a.jsxs("div",{className:`${F} space-y-4 transition-all duration-200`,children:[a.jsx($,{count:f,onClick:C,loading:i}),a.jsx(b,{columns:E,data:n,keyExtractor:e=>e.id,onRowClick:e=>p(`/dumps/${e.id}`),rowClassName:e=>v(e.id)?"highlight-new":"",emptyMessage:"No data dumps recorded yet",emptyIcon:a.jsx(l,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})}),a.jsx(A,{hasMore:j,onClick:y,loading:i})]})]})}export{J as default};