adonisjs-server-stats 1.10.3 → 1.11.1

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 (89) hide show
  1. package/dist/core/field-resolvers.d.ts +64 -0
  2. package/dist/core/formatters.d.ts +15 -0
  3. package/dist/core/index.d.ts +1 -1
  4. package/dist/core/index.js +208 -203
  5. package/dist/react/CacheSection-BYN53kYO.js +135 -0
  6. package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
  7. package/dist/react/CacheTab-DOhuK05d.js +106 -0
  8. package/dist/react/{ConfigSection-DGgqjAal.js → ConfigSection-B9EHh4Rp.js} +1 -1
  9. package/dist/react/{ConfigTab-H3OnYqmK.js → ConfigTab-C8kriE2b.js} +1 -1
  10. package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
  11. package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
  12. package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
  13. package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
  14. package/dist/react/{EventsSection-C7RQW_LY.js → EventsSection-DJPwHeT8.js} +27 -26
  15. package/dist/react/EventsTab-B-FoehXC.js +58 -0
  16. package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
  17. package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
  18. package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
  19. package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
  20. package/dist/react/JobsSection-DWF4i1t_.js +167 -0
  21. package/dist/react/JobsTab-DqnifQXV.js +129 -0
  22. package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
  23. package/dist/react/LogsSection-C1xC5aP4.js +198 -0
  24. package/dist/react/LogsTab-CS4sLfLw.js +79 -0
  25. package/dist/react/{OverviewSection-ABP9ueBo.js → OverviewSection-CxvfOR0v.js} +70 -80
  26. package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
  27. package/dist/react/{QueriesTab-BQzcxEiW.js → QueriesTab-x85PjkyS.js} +22 -21
  28. package/dist/react/RequestsSection-DETN9oZb.js +321 -0
  29. package/dist/react/{RoutesSection-BRhxrtjZ.js → RoutesSection-CmorkJeC.js} +1 -1
  30. package/dist/react/{RoutesTab-CpYH5lUw.js → RoutesTab-CbzBOzpc.js} +12 -12
  31. package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
  32. package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
  33. package/dist/react/{TimelineTab-DjLR35Ce.js → TimelineTab-Ue9tUD_n.js} +71 -91
  34. package/dist/react/{index-CsImORX6.js → index-DwDK-4oX.js} +4 -4
  35. package/dist/react/index.js +6 -6
  36. package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
  37. package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
  38. package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
  39. package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
  40. package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
  41. package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
  42. package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
  43. package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
  44. package/dist/react/style.css +1 -1
  45. package/dist/src/edge/client/dashboard.js +2 -2
  46. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  47. package/dist/src/edge/client-vue/dashboard.js +3 -3
  48. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
  49. package/dist/src/styles/components.css +67 -0
  50. package/dist/src/styles/dashboard.css +5 -15
  51. package/dist/src/styles/debug-panel.css +1 -22
  52. package/dist/src/styles/utilities.css +3 -1
  53. package/dist/vue/{CacheSection-ITqvpfH5.js → CacheSection-DT2Mwf_s.js} +1 -1
  54. package/dist/vue/{ConfigSection-DTn3GslE.js → ConfigSection-BwKwS9lh.js} +1 -1
  55. package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
  56. package/dist/vue/{EmailsSection-DtLJ4XoS.js → EmailsSection-B65g0FVS.js} +1 -1
  57. package/dist/vue/{EventsSection-BOYYz0Ty.js → EventsSection-CxqtVF-o.js} +1 -1
  58. package/dist/vue/{JobsSection-BazTxcJL.js → JobsSection-rMIyMb-g.js} +1 -1
  59. package/dist/vue/{LogsSection-D55PjTKX.js → LogsSection-DmmZVJ7D.js} +1 -1
  60. package/dist/vue/{OverviewSection-1uBKo-Tu.js → OverviewSection-BMabyqw-.js} +49 -50
  61. package/dist/vue/{QueriesSection-rpoZ4ogd.js → QueriesSection-BfDFwGqH.js} +44 -45
  62. package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
  63. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
  64. package/dist/vue/{RequestsSection-x7LvT0MC.js → RequestsSection-CTu4jPZ_.js} +143 -147
  65. package/dist/vue/{RoutesSection-CCD0zZqQ.js → RoutesSection-zQZDedL7.js} +1 -1
  66. package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
  67. package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
  68. package/dist/vue/{index-C8MxnS7Q.js → index-CM3yNVUR.js} +2 -2
  69. package/dist/vue/index.js +1 -1
  70. package/dist/vue/style.css +1 -1
  71. package/package.json +7 -7
  72. package/dist/react/CacheSection-baMZotSn.js +0 -146
  73. package/dist/react/CacheTab-2cw_rMzj.js +0 -117
  74. package/dist/react/CustomPaneTab-B6r7ha0u.js +0 -98
  75. package/dist/react/EmailsSection-C-UZISG-.js +0 -262
  76. package/dist/react/EmailsTab-DbK4Eobn.js +0 -139
  77. package/dist/react/EventsTab-CfVr7AiM.js +0 -57
  78. package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
  79. package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
  80. package/dist/react/JobsSection-CQHNK_Ls.js +0 -187
  81. package/dist/react/JobsTab-znzf6jzk.js +0 -153
  82. package/dist/react/LogsSection-Dmm3rE2B.js +0 -233
  83. package/dist/react/LogsTab-D8unMV5P.js +0 -108
  84. package/dist/react/QueriesSection-CnmSkznA.js +0 -461
  85. package/dist/react/RelatedLogs-3A8RuGKH.js +0 -52
  86. package/dist/react/RequestsSection-kW79_M7k.js +0 -341
  87. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
  88. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
  89. package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
@@ -1,338 +0,0 @@
1
- import { defineComponent as I, ref as c, computed as $, watch as Y, nextTick as j, onBeforeUnmount as K, openBlock as s, createElementBlock as l, Fragment as r, createElementVNode as t, toDisplayString as a, normalizeClass as g, unref as u, renderList as b, normalizeStyle as L, createTextVNode as N, createCommentVNode as p, createVNode as J, withDirectives as Q, vModelText as X, withModifiers as Z } from "vue";
2
- import { initSplitPane as ee, formatDuration as m, TAB_ICONS as V, formatTime as te, timeAgo as se, durationSeverity as le } from "adonisjs-server-stats/core";
3
- import { u as ae } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as ne } from "./useResizableTable-BoivAevK.js";
5
- import { _ as oe } from "./RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js";
6
- const de = {
7
- key: 0,
8
- class: "ss-dbg-empty"
9
- }, ie = { class: "ss-dbg-empty" }, re = {
10
- key: 2,
11
- class: "ss-dbg-tl-detail-wrapper"
12
- }, ue = { class: "ss-dbg-tl-detail-header" }, ce = { class: "ss-dbg-tl-detail-url" }, ge = { class: "ss-dbg-tl-meta" }, be = { class: "ss-dbg-tl-legend" }, ve = { id: "ss-dbg-tl-waterfall" }, he = {
13
- key: 0,
14
- class: "ss-dbg-empty"
15
- }, me = ["title"], fe = { class: "ss-dbg-tl-track" }, pe = ["title"], _e = { class: "ss-dbg-tl-dur" }, ye = {
16
- key: 0,
17
- class: "ss-dbg-tl-warnings"
18
- }, ke = { class: "ss-dbg-tl-legend" }, we = { id: "ss-dbg-tl-waterfall" }, Ce = {
19
- key: 0,
20
- class: "ss-dbg-empty"
21
- }, Te = ["title"], xe = { class: "ss-dbg-tl-track" }, $e = ["title"], Le = { class: "ss-dbg-tl-dur" }, Re = {
22
- key: 0,
23
- class: "ss-dbg-tl-warnings"
24
- }, Be = {
25
- key: 3,
26
- class: "ss-dbg-empty"
27
- }, De = { class: "ss-dbg-search-bar" }, Ee = { class: "ss-dbg-summary" }, Se = {
28
- key: 0,
29
- class: "ss-dbg-empty"
30
- }, Ae = ["onClick"], Me = {
31
- class: "ss-dbg-c-dim",
32
- style: { "white-space": "nowrap" }
33
- }, Ne = { class: "ss-dbg-c-text" }, qe = ["href"], Oe = ["viewBox", "innerHTML"], Pe = {
34
- class: "ss-dbg-c-muted",
35
- style: { "text-align": "center" }
36
- }, Ve = ["title"], Ge = /* @__PURE__ */ I({
37
- __name: "TimelineTab",
38
- props: {
39
- data: {},
40
- dashboardPath: {},
41
- baseUrl: {},
42
- debugEndpoint: {},
43
- authToken: {}
44
- },
45
- setup(R) {
46
- const _ = R, y = c(""), v = c(null), n = c(null), B = c(!1), h = c(null), U = ae(_.baseUrl || "", _.authToken), k = $(() => {
47
- const i = _.data;
48
- if (!i) return [];
49
- const o = Array.isArray(i) ? i : i.traces || [];
50
- if (!y.value.trim()) return o;
51
- const e = y.value.toLowerCase();
52
- return o.filter(
53
- (d) => d.url.toLowerCase().includes(e) || d.method.toLowerCase().includes(e) || String(d.statusCode).includes(e)
54
- );
55
- }), w = {
56
- request: "#1e3a5f",
57
- middleware: "rgba(30, 58, 95, 0.7)",
58
- db: "#6d28d9",
59
- view: "#0e7490",
60
- mail: "#059669",
61
- event: "#b45309",
62
- custom: "#525252"
63
- }, q = {
64
- request: "Request",
65
- middleware: "Middleware",
66
- db: "Database",
67
- view: "View",
68
- mail: "Mail",
69
- event: "Event",
70
- custom: "Custom"
71
- };
72
- function H(i) {
73
- v.value === i.id ? (v.value = null, n.value = null, h.value = null) : (v.value = i.id, z(i.id));
74
- }
75
- function O() {
76
- v.value = null, n.value = null, h.value = null;
77
- }
78
- let f = null;
79
- async function z(i) {
80
- f && f.abort(), f = new AbortController(), B.value = !0, h.value = null, n.value = null;
81
- const o = _.debugEndpoint || "/admin/api/debug";
82
- try {
83
- const d = await U().get(`${o}/traces/${i}`);
84
- n.value = d;
85
- } catch (e) {
86
- if (e instanceof Error && e.name === "AbortError") return;
87
- h.value = e instanceof Error ? e.message : "Failed to load trace";
88
- } finally {
89
- B.value = !1;
90
- }
91
- }
92
- const C = $(() => n.value?.spans || []), T = $(() => n.value?.warnings || []);
93
- function P(i, o) {
94
- const e = o || 1, d = e > 0 ? i.startOffset / e * 100 : 0, G = e > 0 ? Math.max(i.duration / e * 100, 0.5) : 0.5;
95
- return {
96
- left: `${d}%`,
97
- width: `${G}%`,
98
- background: w[i.category] || w.custom
99
- };
100
- }
101
- const { tableRef: F } = ne(() => k.value), D = c(null), E = c(null), S = c(null), A = c(null);
102
- let x = null;
103
- const M = $(() => n.value ? n.value.logs || [] : []);
104
- Y([v, n], async () => {
105
- x?.(), x = null, n.value && M.value.length > 0 && (await j(), D.value && E.value && S.value && A.value && (x = ee({
106
- container: D.value,
107
- handle: E.value,
108
- topPane: S.value,
109
- bottomPane: A.value,
110
- storageKey: "ss-dbg-timeline-split"
111
- })));
112
- }), K(() => {
113
- f && f.abort(), x?.();
114
- });
115
- function W(i) {
116
- const o = le(i);
117
- return o === "very-slow" ? "ss-dbg-very-slow" : o === "slow" ? "ss-dbg-slow" : "";
118
- }
119
- return (i, o) => (s(), l("div", null, [
120
- v.value !== null ? (s(), l(r, { key: 0 }, [
121
- B.value ? (s(), l("div", de, "Loading trace detail...")) : h.value ? (s(), l(r, { key: 1 }, [
122
- t("div", { class: "ss-dbg-tl-detail-header" }, [
123
- t("button", {
124
- type: "button",
125
- class: "ss-dbg-btn-clear",
126
- onClick: O
127
- }, "← Back")
128
- ]),
129
- t("div", ie, "Error: " + a(h.value), 1)
130
- ], 64)) : n.value ? (s(), l("div", re, [
131
- t("div", ue, [
132
- t("button", {
133
- type: "button",
134
- class: "ss-dbg-btn-clear",
135
- onClick: O
136
- }, "← Back"),
137
- t("span", {
138
- class: g(`ss-dbg-method ss-dbg-method-${n.value.method.toLowerCase()}`)
139
- }, a(n.value.method), 3),
140
- t("span", ce, a(n.value.url), 1),
141
- t("span", {
142
- class: g(`ss-dbg-status ss-dbg-status-${Math.floor(n.value.statusCode / 100)}xx`)
143
- }, a(n.value.statusCode), 3),
144
- t("span", ge, a(u(m)(n.value.totalDuration)) + " · " + a(n.value.spanCount) + " spans ", 1)
145
- ]),
146
- M.value.length > 0 ? (s(), l("div", {
147
- key: 0,
148
- ref_key: "splitContainerRef",
149
- ref: D,
150
- class: "ss-dbg-split-container"
151
- }, [
152
- t("div", {
153
- ref_key: "splitTopRef",
154
- ref: S,
155
- class: "ss-dbg-split-top"
156
- }, [
157
- t("div", be, [
158
- (s(), l(r, null, b(w, (e, d) => t("span", {
159
- key: d,
160
- class: "ss-dbg-tl-legend-item"
161
- }, [
162
- t("span", {
163
- class: "ss-dbg-tl-legend-dot",
164
- style: L({ background: e })
165
- }, null, 4),
166
- N(" " + a(q[d] || d), 1)
167
- ])), 64))
168
- ]),
169
- t("div", ve, [
170
- C.value.length === 0 ? (s(), l("div", he, " No spans captured for this request ")) : p("", !0),
171
- (s(!0), l(r, null, b(C.value, (e) => (s(), l("div", {
172
- key: e.id,
173
- class: "ss-dbg-tl-row"
174
- }, [
175
- t("span", {
176
- class: "ss-dbg-tl-label",
177
- title: e.label
178
- }, a(e.label), 9, me),
179
- t("span", fe, [
180
- t("span", {
181
- class: g(`ss-dbg-tl-bar ss-dbg-tl-bar-${e.category}`),
182
- style: L(P(e, n.value.totalDuration)),
183
- title: `${e.label}: ${u(m)(e.duration)}`
184
- }, null, 14, pe)
185
- ]),
186
- t("span", _e, a(u(m)(e.duration)), 1)
187
- ]))), 128))
188
- ]),
189
- T.value.length > 0 ? (s(), l("div", ye, [
190
- o[2] || (o[2] = t("div", { class: "ss-dbg-tl-warnings-title" }, "Warnings", -1)),
191
- (s(!0), l(r, null, b(T.value, (e, d) => (s(), l("div", {
192
- key: d,
193
- class: "ss-dbg-tl-warning"
194
- }, a(e), 1))), 128))
195
- ])) : p("", !0)
196
- ], 512),
197
- t("div", {
198
- ref_key: "splitHandleRef",
199
- ref: E,
200
- class: "ss-dbg-split-handle"
201
- }, null, 512),
202
- t("div", {
203
- ref_key: "splitBottomRef",
204
- ref: A,
205
- class: "ss-dbg-split-bottom"
206
- }, [
207
- J(oe, {
208
- logs: M.value,
209
- "class-prefix": "ss-dbg"
210
- }, null, 8, ["logs"])
211
- ], 512)
212
- ], 512)) : (s(), l(r, { key: 1 }, [
213
- t("div", ke, [
214
- (s(), l(r, null, b(w, (e, d) => t("span", {
215
- key: d,
216
- class: "ss-dbg-tl-legend-item"
217
- }, [
218
- t("span", {
219
- class: "ss-dbg-tl-legend-dot",
220
- style: L({ background: e })
221
- }, null, 4),
222
- N(" " + a(q[d] || d), 1)
223
- ])), 64))
224
- ]),
225
- t("div", we, [
226
- C.value.length === 0 ? (s(), l("div", Ce, " No spans captured for this request ")) : p("", !0),
227
- (s(!0), l(r, null, b(C.value, (e) => (s(), l("div", {
228
- key: e.id,
229
- class: "ss-dbg-tl-row"
230
- }, [
231
- t("span", {
232
- class: "ss-dbg-tl-label",
233
- title: e.label
234
- }, a(e.label), 9, Te),
235
- t("span", xe, [
236
- t("span", {
237
- class: g(`ss-dbg-tl-bar ss-dbg-tl-bar-${e.category}`),
238
- style: L(P(e, n.value.totalDuration)),
239
- title: `${e.label}: ${u(m)(e.duration)}`
240
- }, null, 14, $e)
241
- ]),
242
- t("span", Le, a(u(m)(e.duration)), 1)
243
- ]))), 128))
244
- ]),
245
- T.value.length > 0 ? (s(), l("div", Re, [
246
- o[3] || (o[3] = t("div", { class: "ss-dbg-tl-warnings-title" }, "Warnings", -1)),
247
- (s(!0), l(r, null, b(T.value, (e, d) => (s(), l("div", {
248
- key: d,
249
- class: "ss-dbg-tl-warning"
250
- }, a(e), 1))), 128))
251
- ])) : p("", !0)
252
- ], 64))
253
- ])) : (s(), l("div", Be, "Loading trace detail..."))
254
- ], 64)) : (s(), l(r, { key: 1 }, [
255
- t("div", De, [
256
- Q(t("input", {
257
- "onUpdate:modelValue": o[0] || (o[0] = (e) => y.value = e),
258
- class: "ss-dbg-search",
259
- placeholder: "Filter traces...",
260
- type: "text"
261
- }, null, 512), [
262
- [X, y.value]
263
- ]),
264
- t("span", Ee, a(k.value.length) + " traces", 1)
265
- ]),
266
- k.value.length === 0 ? (s(), l("div", Se, "No traces captured")) : (s(), l("table", {
267
- key: 1,
268
- ref_key: "tableRef",
269
- ref: F,
270
- class: "ss-dbg-table"
271
- }, [
272
- o[4] || (o[4] = t("thead", null, [
273
- t("tr", null, [
274
- t("th", null, "#"),
275
- t("th", null, "Method"),
276
- t("th", null, "URL"),
277
- t("th", null, "Status"),
278
- t("th", null, "Duration"),
279
- t("th", null, "Spans"),
280
- t("th", null, "Time")
281
- ])
282
- ], -1)),
283
- t("tbody", null, [
284
- (s(!0), l(r, null, b(k.value, (e) => (s(), l("tr", {
285
- key: e.id,
286
- class: "ss-dbg-email-row",
287
- onClick: (d) => H(e)
288
- }, [
289
- t("td", Me, a(e.id), 1),
290
- t("td", null, [
291
- t("span", {
292
- class: g(`ss-dbg-method ss-dbg-method-${e.method.toLowerCase()}`)
293
- }, a(e.method), 3)
294
- ]),
295
- t("td", Ne, [
296
- N(a(e.url) + " ", 1),
297
- R.dashboardPath ? (s(), l("a", {
298
- key: 0,
299
- href: `${R.dashboardPath}#requests?id=${e.id}`,
300
- target: "_blank",
301
- class: "ss-dbg-deeplink",
302
- onClick: o[1] || (o[1] = Z(() => {
303
- }, ["stop"]))
304
- }, [
305
- (s(), l("svg", {
306
- viewBox: u(V)["open-external"].viewBox,
307
- width: "12",
308
- height: "12",
309
- fill: "none",
310
- stroke: "currentColor",
311
- "stroke-width": "2",
312
- innerHTML: u(V)["open-external"].elements.join("")
313
- }, null, 8, Oe))
314
- ], 8, qe)) : p("", !0)
315
- ]),
316
- t("td", null, [
317
- t("span", {
318
- class: g(`ss-dbg-status ss-dbg-status-${Math.floor(e.statusCode / 100)}xx`)
319
- }, a(e.statusCode), 3)
320
- ]),
321
- t("td", {
322
- class: g(["ss-dbg-duration", W(e.totalDuration)])
323
- }, a(u(m)(e.totalDuration)), 3),
324
- t("td", Pe, a(e.spanCount), 1),
325
- t("td", {
326
- class: "ss-dbg-event-time",
327
- title: u(te)(e.timestamp)
328
- }, a(u(se)(e.timestamp)), 9, Ve)
329
- ], 8, Ae))), 128))
330
- ])
331
- ], 512))
332
- ], 64))
333
- ]));
334
- }
335
- });
336
- export {
337
- Ge as default
338
- };