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
@@ -0,0 +1,110 @@
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { useState as c, useMemo as f, useCallback as w } from "react";
3
+ import { resolveTimestamp as k } from "adonisjs-server-stats/core";
4
+ import { T as E } from "./TimeAgoCell-o3KigGfM.js";
5
+ import { u as S } from "./index-DwDK-4oX.js";
6
+ import { u as j } from "./useResizableTable-CNJmACdt.js";
7
+ import { F as q } from "./FilterBar-CQ7bD669.js";
8
+ import { E as $ } from "./EmailPreviewOverlay-BmXOAvqG.js";
9
+ function R({ options: l }) {
10
+ const { data: n, isLoading: y, error: h } = S("emails", l), [d, v] = c(""), [u, g] = c(null), [N, o] = c(null), [C, m] = c(!1), a = f(() => {
11
+ const s = n?.emails || [];
12
+ if (!d) return s;
13
+ const i = d.toLowerCase();
14
+ return s.filter(
15
+ (t) => (t.subject || "").toLowerCase().includes(i) || (t.to || "").toLowerCase().includes(i) || (t.from || "").toLowerCase().includes(i) || (t.mailer || "").toLowerCase().includes(i)
16
+ );
17
+ }, [n, d]), b = f(() => a.find((s) => s.id === u), [a, u]), x = w(
18
+ async (s) => {
19
+ if (g(s.id), o(s.html || null), !s.html && s.id) {
20
+ m(!0);
21
+ try {
22
+ const i = l?.debugEndpoint || "/admin/api/debug", t = {};
23
+ l?.authToken && (t.Authorization = `Bearer ${l.authToken}`);
24
+ const p = await fetch(`${i}/emails/${s.id}/preview`, {
25
+ headers: t,
26
+ credentials: l?.authToken ? "omit" : "include"
27
+ });
28
+ p.ok && o(await p.text());
29
+ } catch {
30
+ } finally {
31
+ m(!1);
32
+ }
33
+ }
34
+ },
35
+ [l]
36
+ ), T = w(() => {
37
+ g(null), o(null), m(!1);
38
+ }, []), L = {
39
+ sent: "ss-dbg-email-status-sent",
40
+ sending: "ss-dbg-email-status-sending",
41
+ queueing: "ss-dbg-email-status-queued",
42
+ queued: "ss-dbg-email-status-queued",
43
+ failed: "ss-dbg-email-status-failed"
44
+ }, P = j([a]);
45
+ return y && !n ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading emails..." }) : h ? /* @__PURE__ */ r("div", { className: "ss-dbg-empty", children: [
46
+ "Error: ",
47
+ h.message
48
+ ] }) : b ? /* @__PURE__ */ e(
49
+ $,
50
+ {
51
+ email: b,
52
+ previewHtml: N,
53
+ isLoading: C,
54
+ onClose: T,
55
+ className: "ss-dbg-email-preview"
56
+ }
57
+ ) : /* @__PURE__ */ r("div", { children: [
58
+ /* @__PURE__ */ e(
59
+ q,
60
+ {
61
+ search: d,
62
+ onSearchChange: v,
63
+ placeholder: "Filter emails...",
64
+ summary: `${a.length} emails`
65
+ }
66
+ ),
67
+ a.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No emails captured" }) : /* @__PURE__ */ r("table", { ref: P, className: "ss-dbg-table", children: [
68
+ /* @__PURE__ */ r("colgroup", { children: [
69
+ /* @__PURE__ */ e("col", { style: { width: "50px" } }),
70
+ /* @__PURE__ */ e("col", { style: { width: "140px" } }),
71
+ /* @__PURE__ */ e("col", { style: { width: "140px" } }),
72
+ /* @__PURE__ */ e("col", {}),
73
+ /* @__PURE__ */ e("col", { style: { width: "70px" } }),
74
+ /* @__PURE__ */ e("col", { style: { width: "80px" } }),
75
+ /* @__PURE__ */ e("col", { style: { width: "40px" } }),
76
+ /* @__PURE__ */ e("col", { style: { width: "80px" } })
77
+ ] }),
78
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ r("tr", { children: [
79
+ /* @__PURE__ */ e("th", { children: "#" }),
80
+ /* @__PURE__ */ e("th", { children: "From" }),
81
+ /* @__PURE__ */ e("th", { children: "To" }),
82
+ /* @__PURE__ */ e("th", { children: "Subject" }),
83
+ /* @__PURE__ */ e("th", { children: "Status" }),
84
+ /* @__PURE__ */ e("th", { children: "Mailer" }),
85
+ /* @__PURE__ */ e("th", { title: "Attachments", children: "📎" }),
86
+ /* @__PURE__ */ e("th", { children: "Time" })
87
+ ] }) }),
88
+ /* @__PURE__ */ e("tbody", { children: a.map((s) => /* @__PURE__ */ r("tr", { className: "ss-dbg-email-row", onClick: () => x(s), children: [
89
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", style: { whiteSpace: "nowrap" }, children: s.id }),
90
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-secondary", title: s.from, children: s.from }),
91
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-secondary", title: s.to, children: s.to }),
92
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-sql", children: s.subject }),
93
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `ss-dbg-email-status ${L[s.status] || ""}`, children: s.status }) }),
94
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", children: s.mailer }),
95
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", style: { textAlign: "center" }, children: s.attachmentCount > 0 ? s.attachmentCount : "-" }),
96
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
97
+ E,
98
+ {
99
+ ts: k(s),
100
+ className: "ss-dbg-event-time"
101
+ }
102
+ ) })
103
+ ] }, s.id)) })
104
+ ] })
105
+ ] });
106
+ }
107
+ export {
108
+ R as EmailsTab,
109
+ R as default
110
+ };
@@ -1,23 +1,24 @@
1
- import { jsxs as o, jsx as e, Fragment as g } from "react/jsx-runtime";
2
- import { useState as d, useEffect as f } from "react";
3
- import { timeAgo as y, formatTime as u } from "adonisjs-server-stats/core";
4
- import { a as b, J as N } from "./index-CsImORX6.js";
1
+ import { jsxs as i, jsx as e, Fragment as g } from "react/jsx-runtime";
2
+ import { useState as m, useEffect as f } from "react";
3
+ import { resolveEventName as y, resolveTimestamp as u } from "adonisjs-server-stats/core";
4
+ import { T as w } from "./TimeAgoCell-o3KigGfM.js";
5
+ import { a as b, J as N } from "./index-DwDK-4oX.js";
5
6
  import { D as x } from "./DataTable-YyShr5B-.js";
6
7
  import { F as P } from "./FilterBar-CQ7bD669.js";
7
8
  import { P as k } from "./Pagination-BkmzUDY8.js";
8
- function L({ options: m = {} }) {
9
- const [c, i] = d(1), [r, p] = d(""), { data: l, meta: t, isLoading: h } = b("events", { ...m, page: c, search: r }), v = l || [];
10
- return f(() => i(1), [r]), /* @__PURE__ */ o("div", { children: [
9
+ function A({ options: d = {} }) {
10
+ const [c, o] = m(1), [r, p] = m(""), { data: l, meta: a, isLoading: v } = b("events", { ...d, page: c, search: r }), h = l || [];
11
+ return f(() => o(1), [r]), /* @__PURE__ */ i("div", { children: [
11
12
  /* @__PURE__ */ e(
12
13
  P,
13
14
  {
14
15
  search: r,
15
16
  onSearchChange: p,
16
17
  placeholder: "Filter events...",
17
- summary: `${t?.total ?? 0} events`
18
+ summary: `${a?.total ?? 0} events`
18
19
  }
19
20
  ),
20
- h && !l ? /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Loading events..." }) : /* @__PURE__ */ o(g, { children: [
21
+ v && !l ? /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Loading events..." }) : /* @__PURE__ */ i(g, { children: [
21
22
  /* @__PURE__ */ e("div", { className: "ss-dash-table-wrap", children: /* @__PURE__ */ e(
22
23
  x,
23
24
  {
@@ -26,25 +27,25 @@ function L({ options: m = {} }) {
26
27
  key: "id",
27
28
  label: "#",
28
29
  width: "40px",
29
- render: (s) => /* @__PURE__ */ e("span", { style: { color: "var(--ss-dim)" }, children: s })
30
+ render: (t) => /* @__PURE__ */ e("span", { style: { color: "var(--ss-dim)" }, children: t })
30
31
  },
31
32
  {
32
33
  key: "eventName",
33
34
  label: "Event",
34
- render: (s, a) => {
35
- const n = a.event_name || a.eventName || a.event || "";
35
+ render: (t, n) => {
36
+ const s = y(n);
36
37
  return /* @__PURE__ */ e(
37
38
  "span",
38
39
  {
39
40
  className: "ss-dash-event-name",
40
- title: n,
41
+ title: s,
41
42
  style: {
42
43
  overflow: "hidden",
43
44
  textOverflow: "ellipsis",
44
45
  whiteSpace: "nowrap",
45
46
  display: "block"
46
47
  },
47
- children: n
48
+ children: s
48
49
  }
49
50
  );
50
51
  }
@@ -52,35 +53,35 @@ function L({ options: m = {} }) {
52
53
  {
53
54
  key: "data",
54
55
  label: "Data",
55
- render: (s) => /* @__PURE__ */ e(N, { data: s, maxPreviewLength: 80, className: "ss-dash-event-data" })
56
+ render: (t) => /* @__PURE__ */ e(N, { data: t, maxPreviewLength: 80, className: "ss-dash-event-data" })
56
57
  },
57
58
  {
58
59
  key: "createdAt",
59
60
  label: "Time",
60
61
  width: "80px",
61
- render: (s, a) => {
62
- const n = a.createdAt || a.created_at || a.timestamp;
63
- return /* @__PURE__ */ e("span", { className: "ss-dash-event-time", title: u(n), children: y(n) });
62
+ render: (t, n) => {
63
+ const s = u(n);
64
+ return /* @__PURE__ */ e(w, { ts: s, className: "ss-dash-event-time" });
64
65
  }
65
66
  }
66
67
  ],
67
- data: v,
68
+ data: h,
68
69
  emptyMessage: "No events recorded yet"
69
70
  }
70
71
  ) }),
71
- t && /* @__PURE__ */ e(
72
+ a && /* @__PURE__ */ e(
72
73
  k,
73
74
  {
74
- page: t.page,
75
- lastPage: t.lastPage,
76
- total: t.total,
77
- onPageChange: i
75
+ page: a.page,
76
+ lastPage: a.lastPage,
77
+ total: a.total,
78
+ onPageChange: o
78
79
  }
79
80
  )
80
81
  ] })
81
82
  ] });
82
83
  }
83
84
  export {
84
- L as EventsSection,
85
- L as default
85
+ A as EventsSection,
86
+ A as default
86
87
  };
@@ -0,0 +1,58 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ import { useState as p, useMemo as u } from "react";
3
+ import { resolveTimestamp as g } from "adonisjs-server-stats/core";
4
+ import { T as b } from "./TimeAgoCell-o3KigGfM.js";
5
+ import { u as f, J as v } from "./index-DwDK-4oX.js";
6
+ import { u as w } from "./useResizableTable-CNJmACdt.js";
7
+ import { F as y } from "./FilterBar-CQ7bD669.js";
8
+ function E({ options: c }) {
9
+ const { data: i, isLoading: o, error: d } = f("events", c), [r, m] = p(""), a = u(() => {
10
+ const s = i?.events || [];
11
+ if (!r) return s;
12
+ const n = r.toLowerCase();
13
+ return s.filter(
14
+ (l) => (l.event || "").toLowerCase().includes(n) || (l.data || "").toLowerCase().includes(n)
15
+ );
16
+ }, [i, r]), h = w([a]);
17
+ return o && !i ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading events..." }) : d ? /* @__PURE__ */ t("div", { className: "ss-dbg-empty", children: [
18
+ "Error: ",
19
+ d.message
20
+ ] }) : /* @__PURE__ */ t("div", { children: [
21
+ /* @__PURE__ */ e(
22
+ y,
23
+ {
24
+ search: r,
25
+ onSearchChange: m,
26
+ placeholder: "Filter events...",
27
+ summary: `${a.length} events`
28
+ }
29
+ ),
30
+ a.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No events captured" }) : /* @__PURE__ */ t("table", { ref: h, className: "ss-dbg-table", children: [
31
+ /* @__PURE__ */ t("colgroup", { children: [
32
+ /* @__PURE__ */ e("col", { style: { width: "50px" } }),
33
+ /* @__PURE__ */ e("col", { style: { width: "20%" } }),
34
+ /* @__PURE__ */ e("col", {}),
35
+ /* @__PURE__ */ e("col", { style: { width: "80px" } })
36
+ ] }),
37
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
38
+ /* @__PURE__ */ e("th", { children: "#" }),
39
+ /* @__PURE__ */ e("th", { children: "Event" }),
40
+ /* @__PURE__ */ e("th", { children: "Data" }),
41
+ /* @__PURE__ */ e("th", { children: "Time" })
42
+ ] }) }),
43
+ /* @__PURE__ */ e("tbody", { children: a.map((s) => {
44
+ const n = g(s);
45
+ return /* @__PURE__ */ t("tr", { children: [
46
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", style: { whiteSpace: "nowrap" }, children: s.id }),
47
+ /* @__PURE__ */ e("td", { className: "ss-dbg-event-name", children: s.event }),
48
+ /* @__PURE__ */ e("td", { className: "ss-dbg-event-data", children: /* @__PURE__ */ e(v, { data: s.data, maxPreviewLength: 80, classPrefix: "ss-dbg" }) }),
49
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(b, { ts: n, className: "ss-dbg-event-time" }) })
50
+ ] }, s.id);
51
+ }) })
52
+ ] })
53
+ ] });
54
+ }
55
+ export {
56
+ E as EventsTab,
57
+ E as default
58
+ };