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,8 +1,31 @@
1
- import { jsx as e, jsxs as n, Fragment as f } from "react/jsx-runtime";
2
- import { useState as N, useCallback as $ } from "react";
3
- import { formatConfigVal as x, isSecretKey as w, formatUptime as I, timeAgo as S, getTimerLabel as L, formatDuration as y, getIntegrationLabel as M, TAB_ICONS as m, classifyStatus as T } from "adonisjs-server-stats/core";
4
- function h({ status: t, prefix: c }) {
5
- const d = T(t);
1
+ import { useState as f, useRef as M, useCallback as N, useEffect as E } from "react";
2
+ import { UnauthorizedError as j, formatConfigVal as I, isSecretKey as C, formatUptime as A, timeAgo as w, getTimerLabel as R, formatDuration as x, getIntegrationLabel as z, TAB_ICONS as $, classifyStatus as B } from "adonisjs-server-stats/core";
3
+ import { u as D } from "./useApiClient-BVtNCmnL.js";
4
+ import { jsx as e, jsxs as n, Fragment as y } from "react/jsx-runtime";
5
+ function H(l = {}) {
6
+ const {
7
+ baseUrl: c = "",
8
+ debugEndpoint: d = "/admin/api/debug",
9
+ authToken: r,
10
+ refreshInterval: a = 3e3
11
+ } = l, [g, b] = f(null), [v, t] = f(!0), [i, s] = f(null), o = M(null), h = D(c, r), S = N(async () => {
12
+ try {
13
+ const T = await h().get(`${d}/diagnostics`);
14
+ b(T), s(null), t(!1);
15
+ } catch (u) {
16
+ if (u instanceof j) {
17
+ s(u), t(!1), o.current && (clearInterval(o.current), o.current = null);
18
+ return;
19
+ }
20
+ s(u instanceof Error ? u : new Error(String(u))), t(!1);
21
+ }
22
+ }, [d, h]);
23
+ return E(() => (t(!0), s(null), S(), o.current = setInterval(S, a), () => {
24
+ o.current && (clearInterval(o.current), o.current = null);
25
+ }), [S, a]), { data: g, isLoading: v, error: i };
26
+ }
27
+ function p({ status: l, prefix: c }) {
28
+ const d = B(l);
6
29
  let r = `${c}-dot`;
7
30
  return d === "ok" ? r += ` ${c}-dot-ok` : d === "err" && (r += ` ${c}-dot-err`), /* @__PURE__ */ e("span", { className: r });
8
31
  }
@@ -12,33 +35,33 @@ const k = () => /* @__PURE__ */ e(
12
35
  xmlns: "http://www.w3.org/2000/svg",
13
36
  width: "12",
14
37
  height: "12",
15
- viewBox: m.eye.viewBox,
38
+ viewBox: $.eye.viewBox,
16
39
  fill: "none",
17
40
  stroke: "currentColor",
18
41
  strokeWidth: "2",
19
42
  strokeLinecap: "round",
20
43
  strokeLinejoin: "round",
21
- dangerouslySetInnerHTML: { __html: m.eye.elements.join("") }
44
+ dangerouslySetInnerHTML: { __html: $.eye.elements.join("") }
22
45
  }
23
- ), C = () => /* @__PURE__ */ e(
46
+ ), L = () => /* @__PURE__ */ e(
24
47
  "svg",
25
48
  {
26
49
  xmlns: "http://www.w3.org/2000/svg",
27
50
  width: "12",
28
51
  height: "12",
29
- viewBox: m["eye-off"].viewBox,
52
+ viewBox: $["eye-off"].viewBox,
30
53
  fill: "none",
31
54
  stroke: "currentColor",
32
55
  strokeWidth: "2",
33
56
  strokeLinecap: "round",
34
57
  strokeLinejoin: "round",
35
- dangerouslySetInnerHTML: { __html: m["eye-off"].elements.join("") }
58
+ dangerouslySetInnerHTML: { __html: $["eye-off"].elements.join("") }
36
59
  }
37
60
  );
38
- function j({ value: t }) {
39
- const [c, d] = N(!1);
61
+ function V({ value: l }) {
62
+ const [c, d] = f(!1);
40
63
  return /* @__PURE__ */ n("span", { children: [
41
- c ? t : "••••••••",
64
+ c ? l : "••••••••",
42
65
  " ",
43
66
  /* @__PURE__ */ e(
44
67
  "button",
@@ -55,65 +78,65 @@ function j({ value: t }) {
55
78
  cursor: "pointer",
56
79
  verticalAlign: "middle"
57
80
  },
58
- children: c ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ e(k, {})
81
+ children: c ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(k, {})
59
82
  }
60
83
  )
61
84
  ] });
62
85
  }
63
- function A({ current: t, max: c, prefix: d }) {
64
- const r = c > 0 ? Math.min(100, Math.round(t / c * 100)) : 0, s = r >= 100;
86
+ function O({ current: l, max: c, prefix: d }) {
87
+ const r = c > 0 ? Math.min(100, Math.round(l / c * 100)) : 0, a = r >= 100;
65
88
  return /* @__PURE__ */ n("div", { className: `${d}-bar`, children: [
66
89
  /* @__PURE__ */ e("div", { className: `${d}-bar-track`, children: /* @__PURE__ */ e(
67
90
  "div",
68
91
  {
69
- className: `${d}-bar-fill${s ? ` ${d}-bar-fill-warn` : ""}`,
92
+ className: `${d}-bar-fill${a ? ` ${d}-bar-fill-warn` : ""}`,
70
93
  style: { width: `${r}%` }
71
94
  }
72
95
  ) }),
73
- /* @__PURE__ */ n("span", { className: `${d}-bar-pct${s ? ` ${d}-bar-pct-warn` : ""}`, children: [
96
+ /* @__PURE__ */ n("span", { className: `${d}-bar-pct${a ? ` ${d}-bar-pct-warn` : ""}`, children: [
74
97
  r,
75
98
  "%"
76
99
  ] })
77
100
  ] });
78
101
  }
79
- function R({ config: t, prefix: c }) {
80
- const d = Object.entries(t);
81
- return d.length === 0 ? /* @__PURE__ */ e("span", { className: `${c}-c-dim`, children: "-" }) : /* @__PURE__ */ e("span", { className: `${c}-c-muted`, children: d.map(([r, s], g) => /* @__PURE__ */ n("span", { children: [
102
+ function P({ config: l, prefix: c }) {
103
+ const d = Object.entries(l);
104
+ return d.length === 0 ? /* @__PURE__ */ e("span", { className: `${c}-c-dim`, children: "-" }) : /* @__PURE__ */ e("span", { className: `${c}-c-muted`, children: d.map(([r, a], g) => /* @__PURE__ */ n("span", { children: [
82
105
  g > 0 && ", ",
83
106
  /* @__PURE__ */ e("span", { className: `${c}-c-dim`, children: r }),
84
107
  "=",
85
- w(r) && typeof s == "string" ? /* @__PURE__ */ e(j, { value: s }) : /* @__PURE__ */ e("span", { children: x(s) })
108
+ C(r) && typeof a == "string" ? /* @__PURE__ */ e(V, { value: a }) : /* @__PURE__ */ e("span", { children: I(a) })
86
109
  ] }, r)) });
87
110
  }
88
- function o({ label: t, value: c, prefix: d }) {
111
+ function m({ label: l, value: c, prefix: d }) {
89
112
  return /* @__PURE__ */ n("div", { className: `${d}-info-card`, children: [
90
- /* @__PURE__ */ e("span", { className: `${d}-info-card-label`, children: t }),
113
+ /* @__PURE__ */ e("span", { className: `${d}-info-card-label`, children: l }),
91
114
  /* @__PURE__ */ e("span", { className: `${d}-info-card-value`, children: c })
92
115
  ] });
93
116
  }
94
- function E({ data: t, tableClassName: c, classPrefix: d }) {
95
- const r = d || "ss-dash", [s, g] = N(/* @__PURE__ */ new Set()), b = $((i) => {
96
- g((l) => {
97
- const a = new Set(l);
98
- return a.has(i) ? a.delete(i) : a.add(i), a;
117
+ function Q({ data: l, tableClassName: c, classPrefix: d }) {
118
+ const r = d || "ss-dash", [a, g] = f(/* @__PURE__ */ new Set()), b = N((t) => {
119
+ g((i) => {
120
+ const s = new Set(i);
121
+ return s.has(t) ? s.delete(t) : s.add(t), s;
99
122
  });
100
- }, []), v = $(
101
- (i, l) => {
102
- if (l == null) return /* @__PURE__ */ e("span", { className: `${r}-c-dim`, children: "null" });
103
- if (typeof l == "boolean")
104
- return /* @__PURE__ */ e("span", { className: l ? `${r}-c-green` : `${r}-c-red`, children: String(l) });
105
- if (Array.isArray(l)) return /* @__PURE__ */ e("span", { children: l.join(", ") || "-" });
106
- const a = x(l);
107
- if (w(i)) {
108
- const u = s.has(i);
123
+ }, []), v = N(
124
+ (t, i) => {
125
+ if (i == null) return /* @__PURE__ */ e("span", { className: `${r}-c-dim`, children: "null" });
126
+ if (typeof i == "boolean")
127
+ return /* @__PURE__ */ e("span", { className: i ? `${r}-c-green` : `${r}-c-red`, children: String(i) });
128
+ if (Array.isArray(i)) return /* @__PURE__ */ e("span", { children: i.join(", ") || "-" });
129
+ const s = I(i);
130
+ if (C(t)) {
131
+ const o = a.has(t);
109
132
  return /* @__PURE__ */ n("span", { children: [
110
- u ? a : "••••••••",
133
+ o ? s : "••••••••",
111
134
  " ",
112
135
  /* @__PURE__ */ e(
113
136
  "button",
114
137
  {
115
138
  type: "button",
116
- onClick: () => b(i),
139
+ onClick: () => b(t),
117
140
  style: {
118
141
  background: "none",
119
142
  border: "1px solid var(--ss-border)",
@@ -124,25 +147,25 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
124
147
  cursor: "pointer",
125
148
  verticalAlign: "middle"
126
149
  },
127
- children: u ? /* @__PURE__ */ e(C, {}) : /* @__PURE__ */ e(k, {})
150
+ children: o ? /* @__PURE__ */ e(L, {}) : /* @__PURE__ */ e(k, {})
128
151
  }
129
152
  )
130
153
  ] });
131
154
  }
132
- return /* @__PURE__ */ e("span", { children: a });
155
+ return /* @__PURE__ */ e("span", { children: s });
133
156
  },
134
- [s, b, r]
157
+ [a, b, r]
135
158
  );
136
159
  return /* @__PURE__ */ n("div", { children: [
137
160
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Package Info" }),
138
161
  /* @__PURE__ */ n("div", { className: `${r}-info-cards`, children: [
139
- /* @__PURE__ */ e(o, { label: "Version", value: t.package.version || "-", prefix: r }),
140
- /* @__PURE__ */ e(o, { label: "Node.js", value: t.package.nodeVersion || "-", prefix: r }),
141
- /* @__PURE__ */ e(o, { label: "AdonisJS", value: t.package.adonisVersion || "-", prefix: r }),
142
- /* @__PURE__ */ e(o, { label: "Uptime", value: I(t.package.uptime), prefix: r }),
143
- /* @__PURE__ */ e(o, { label: "Renderer", value: t.devToolbar?.renderer || "preact", prefix: r })
162
+ /* @__PURE__ */ e(m, { label: "Version", value: l.package.version || "-", prefix: r }),
163
+ /* @__PURE__ */ e(m, { label: "Node.js", value: l.package.nodeVersion || "-", prefix: r }),
164
+ /* @__PURE__ */ e(m, { label: "AdonisJS", value: l.package.adonisVersion || "-", prefix: r }),
165
+ /* @__PURE__ */ e(m, { label: "Uptime", value: A(l.package.uptime), prefix: r }),
166
+ /* @__PURE__ */ e(m, { label: "Renderer", value: l.devToolbar?.renderer || "preact", prefix: r })
144
167
  ] }),
145
- t.collectors.length > 0 && /* @__PURE__ */ n(f, { children: [
168
+ l.collectors.length > 0 && /* @__PURE__ */ n(y, { children: [
146
169
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Collectors" }),
147
170
  /* @__PURE__ */ n("table", { className: c, children: [
148
171
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
@@ -151,24 +174,24 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
151
174
  /* @__PURE__ */ e("th", { children: "Last Error" }),
152
175
  /* @__PURE__ */ e("th", { children: "Config" })
153
176
  ] }) }),
154
- /* @__PURE__ */ e("tbody", { children: t.collectors.map((i) => /* @__PURE__ */ n("tr", { children: [
177
+ /* @__PURE__ */ e("tbody", { children: l.collectors.map((t) => /* @__PURE__ */ n("tr", { children: [
155
178
  /* @__PURE__ */ n("td", { children: [
156
- /* @__PURE__ */ e("code", { children: i.name }),
157
- i.label && i.label !== i.name && /* @__PURE__ */ n("span", { className: `${r}-c-dim`, children: [
179
+ /* @__PURE__ */ e("code", { children: t.name }),
180
+ t.label && t.label !== t.name && /* @__PURE__ */ n("span", { className: `${r}-c-dim`, children: [
158
181
  " ",
159
- i.label
182
+ t.label
160
183
  ] })
161
184
  ] }),
162
185
  /* @__PURE__ */ n("td", { children: [
163
- /* @__PURE__ */ e(h, { status: i.status, prefix: r }),
164
- i.status
186
+ /* @__PURE__ */ e(p, { status: t.status, prefix: r }),
187
+ t.status
165
188
  ] }),
166
- /* @__PURE__ */ e("td", { className: i.lastError ? `${r}-c-red` : `${r}-c-dim`, children: i.lastError ? /* @__PURE__ */ n(f, { children: [
167
- i.lastError,
168
- i.lastErrorAt && /* @__PURE__ */ e("span", { className: `${r}-c-dim`, style: { fontSize: "10px" }, children: S(i.lastErrorAt) })
189
+ /* @__PURE__ */ e("td", { className: t.lastError ? `${r}-c-red` : `${r}-c-dim`, children: t.lastError ? /* @__PURE__ */ n(y, { children: [
190
+ t.lastError,
191
+ t.lastErrorAt && /* @__PURE__ */ e("span", { className: `${r}-c-dim`, style: { fontSize: "10px" }, children: w(t.lastErrorAt) })
169
192
  ] }) : "-" }),
170
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(R, { config: i.config, prefix: r }) })
171
- ] }, i.name)) })
193
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(P, { config: t.config, prefix: r }) })
194
+ ] }, t.name)) })
172
195
  ] })
173
196
  ] }),
174
197
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Buffers" }),
@@ -178,15 +201,15 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
178
201
  /* @__PURE__ */ e("th", { children: "Usage" }),
179
202
  /* @__PURE__ */ e("th", { children: "Fill %" })
180
203
  ] }) }),
181
- /* @__PURE__ */ e("tbody", { children: Object.entries(t.buffers).map(([i, l]) => /* @__PURE__ */ n("tr", { children: [
182
- /* @__PURE__ */ e("td", { style: { textTransform: "capitalize" }, children: i }),
204
+ /* @__PURE__ */ e("tbody", { children: Object.entries(l.buffers).map(([t, i]) => /* @__PURE__ */ n("tr", { children: [
205
+ /* @__PURE__ */ e("td", { style: { textTransform: "capitalize" }, children: t }),
183
206
  /* @__PURE__ */ n("td", { children: [
184
- l.current.toLocaleString(),
207
+ i.current.toLocaleString(),
185
208
  " / ",
186
- l.max.toLocaleString()
209
+ i.max.toLocaleString()
187
210
  ] }),
188
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(A, { current: l.current, max: l.max, prefix: r }) })
189
- ] }, i)) })
211
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(O, { current: i.current, max: i.max, prefix: r }) })
212
+ ] }, t)) })
190
213
  ] }),
191
214
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Timers" }),
192
215
  /* @__PURE__ */ n("table", { className: c, children: [
@@ -195,14 +218,14 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
195
218
  /* @__PURE__ */ e("th", { children: "Status" }),
196
219
  /* @__PURE__ */ e("th", { children: "Interval" })
197
220
  ] }) }),
198
- /* @__PURE__ */ e("tbody", { children: Object.entries(t.timers).map(([i, l]) => /* @__PURE__ */ n("tr", { children: [
199
- /* @__PURE__ */ e("td", { children: L(i) }),
221
+ /* @__PURE__ */ e("tbody", { children: Object.entries(l.timers).map(([t, i]) => /* @__PURE__ */ n("tr", { children: [
222
+ /* @__PURE__ */ e("td", { children: R(t) }),
200
223
  /* @__PURE__ */ n("td", { children: [
201
- /* @__PURE__ */ e(h, { status: l.active ? "active" : "inactive", prefix: r }),
202
- /* @__PURE__ */ e("span", { className: l.active ? `${r}-c-green` : `${r}-c-dim`, children: l.active ? "active" : "inactive" })
224
+ /* @__PURE__ */ e(p, { status: i.active ? "active" : "inactive", prefix: r }),
225
+ /* @__PURE__ */ e("span", { className: i.active ? `${r}-c-green` : `${r}-c-dim`, children: i.active ? "active" : "inactive" })
203
226
  ] }),
204
- /* @__PURE__ */ e("td", { children: l.active ? l.intervalMs ? y(l.intervalMs) : l.debounceMs ? `${y(l.debounceMs)} (debounce)` : "-" : /* @__PURE__ */ e("span", { className: `${r}-c-dim`, children: "—" }) })
205
- ] }, i)) })
227
+ /* @__PURE__ */ e("td", { children: i.active ? i.intervalMs ? x(i.intervalMs) : i.debounceMs ? `${x(i.debounceMs)} (debounce)` : "-" : /* @__PURE__ */ e("span", { className: `${r}-c-dim`, children: "—" }) })
228
+ ] }, t)) })
206
229
  ] }),
207
230
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Integrations" }),
208
231
  /* @__PURE__ */ n("table", { className: c, children: [
@@ -215,26 +238,26 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
215
238
  /* @__PURE__ */ n("tr", { children: [
216
239
  /* @__PURE__ */ e("td", { children: "Transmit (SSE)" }),
217
240
  /* @__PURE__ */ n("td", { children: [
218
- /* @__PURE__ */ e(h, { status: t.transmit.available ? "connected" : "inactive", prefix: r }),
219
- t.transmit.available ? "connected" : "unavailable"
241
+ /* @__PURE__ */ e(p, { status: l.transmit.available ? "connected" : "inactive", prefix: r }),
242
+ l.transmit.available ? "connected" : "unavailable"
220
243
  ] }),
221
- /* @__PURE__ */ e("td", { style: { fontSize: "11px" }, children: t.transmit.channels.length > 0 ? `Channels: ${t.transmit.channels.join(", ")}` : "-" })
244
+ /* @__PURE__ */ e("td", { style: { fontSize: "11px" }, children: l.transmit.channels.length > 0 ? `Channels: ${l.transmit.channels.join(", ")}` : "-" })
222
245
  ] }),
223
- Object.entries(t.integrations).map(([i, l]) => {
224
- const a = l.active ?? l.available ?? !1, u = l.active ? "active" : l.available ? "available" : "unavailable";
225
- let p = l.mode ? `Mode: ${l.mode}` : "-";
226
- return i === "edgePlugin" && l.active ? p = "@serverStats() tag registered" : i === "cacheInspector" && l.available ? p = "Redis dependency detected" : i === "queueInspector" && l.available && (p = "Queue dependency detected"), /* @__PURE__ */ n("tr", { children: [
227
- /* @__PURE__ */ e("td", { children: M(i) }),
246
+ Object.entries(l.integrations).map(([t, i]) => {
247
+ const s = i.active ?? i.available ?? !1, o = i.active ? "active" : i.available ? "available" : "unavailable";
248
+ let h = i.mode ? `Mode: ${i.mode}` : "-";
249
+ return t === "edgePlugin" && i.active ? h = "@serverStats() tag registered" : t === "cacheInspector" && i.available ? h = "Redis dependency detected" : t === "queueInspector" && i.available && (h = "Queue dependency detected"), /* @__PURE__ */ n("tr", { children: [
250
+ /* @__PURE__ */ e("td", { children: z(t) }),
228
251
  /* @__PURE__ */ n("td", { children: [
229
- /* @__PURE__ */ e(h, { status: a ? "active" : "inactive", prefix: r }),
230
- u
252
+ /* @__PURE__ */ e(p, { status: s ? "active" : "inactive", prefix: r }),
253
+ o
231
254
  ] }),
232
- /* @__PURE__ */ e("td", { className: `${r}-c-dim`, style: { fontSize: "11px" }, children: p })
233
- ] }, i);
255
+ /* @__PURE__ */ e("td", { className: `${r}-c-dim`, style: { fontSize: "11px" }, children: h })
256
+ ] }, t);
234
257
  })
235
258
  ] })
236
259
  ] }),
237
- t.storage && /* @__PURE__ */ n(f, { children: [
260
+ l.storage && /* @__PURE__ */ n(y, { children: [
238
261
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Storage (SQLite)" }),
239
262
  /* @__PURE__ */ n("table", { className: c, children: [
240
263
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
@@ -245,50 +268,50 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
245
268
  /* @__PURE__ */ n("tr", { children: [
246
269
  /* @__PURE__ */ e("td", { children: "Status" }),
247
270
  /* @__PURE__ */ n("td", { children: [
248
- /* @__PURE__ */ e(h, { status: t.storage.ready ? "ready" : "inactive", prefix: r }),
249
- t.storage.ready ? "ready" : "not ready"
271
+ /* @__PURE__ */ e(p, { status: l.storage.ready ? "ready" : "inactive", prefix: r }),
272
+ l.storage.ready ? "ready" : "not ready"
250
273
  ] })
251
274
  ] }),
252
275
  /* @__PURE__ */ n("tr", { children: [
253
276
  /* @__PURE__ */ e("td", { children: "DB Path" }),
254
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: t.storage.dbPath }) })
277
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: l.storage.dbPath }) })
255
278
  ] }),
256
279
  /* @__PURE__ */ n("tr", { children: [
257
280
  /* @__PURE__ */ e("td", { children: "File Size" }),
258
281
  /* @__PURE__ */ n("td", { children: [
259
- t.storage.fileSizeMb.toFixed(1),
282
+ l.storage.fileSizeMb.toFixed(1),
260
283
  " MB"
261
284
  ] })
262
285
  ] }),
263
286
  /* @__PURE__ */ n("tr", { children: [
264
287
  /* @__PURE__ */ e("td", { children: "WAL Size" }),
265
288
  /* @__PURE__ */ n("td", { children: [
266
- t.storage.walSizeMb.toFixed(1),
289
+ l.storage.walSizeMb.toFixed(1),
267
290
  " MB"
268
291
  ] })
269
292
  ] }),
270
293
  /* @__PURE__ */ n("tr", { children: [
271
294
  /* @__PURE__ */ e("td", { children: "Retention" }),
272
295
  /* @__PURE__ */ n("td", { children: [
273
- t.storage.retentionDays,
296
+ l.storage.retentionDays,
274
297
  " days"
275
298
  ] })
276
299
  ] }),
277
300
  /* @__PURE__ */ n("tr", { children: [
278
301
  /* @__PURE__ */ e("td", { children: "Last Cleanup" }),
279
- /* @__PURE__ */ e("td", { children: t.storage.lastCleanupAt ? S(t.storage.lastCleanupAt) : "-" })
302
+ /* @__PURE__ */ e("td", { children: l.storage.lastCleanupAt ? w(l.storage.lastCleanupAt) : "-" })
280
303
  ] })
281
304
  ] })
282
305
  ] }),
283
- t.storage.tables.length > 0 && /* @__PURE__ */ n("table", { className: c, style: { marginTop: 8 }, children: [
306
+ l.storage.tables.length > 0 && /* @__PURE__ */ n("table", { className: c, style: { marginTop: 8 }, children: [
284
307
  /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ n("tr", { children: [
285
308
  /* @__PURE__ */ e("th", { children: "Table" }),
286
309
  /* @__PURE__ */ e("th", { children: "Rows" })
287
310
  ] }) }),
288
- /* @__PURE__ */ e("tbody", { children: t.storage.tables.map((i) => /* @__PURE__ */ n("tr", { children: [
289
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: i.name }) }),
290
- /* @__PURE__ */ e("td", { children: i.rowCount.toLocaleString() })
291
- ] }, i.name)) })
311
+ /* @__PURE__ */ e("tbody", { children: l.storage.tables.map((t) => /* @__PURE__ */ n("tr", { children: [
312
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("code", { children: t.name }) }),
313
+ /* @__PURE__ */ e("td", { children: t.rowCount.toLocaleString() })
314
+ ] }, t.name)) })
292
315
  ] })
293
316
  ] }),
294
317
  /* @__PURE__ */ e("h3", { className: `${r}-internals-title`, children: "Resolved Config" }),
@@ -300,31 +323,31 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
300
323
  /* @__PURE__ */ n("tbody", { children: [
301
324
  /* @__PURE__ */ n("tr", { children: [
302
325
  /* @__PURE__ */ e("td", { children: "intervalMs" }),
303
- /* @__PURE__ */ e("td", { children: t.config.intervalMs })
326
+ /* @__PURE__ */ e("td", { children: l.config.intervalMs })
304
327
  ] }),
305
328
  /* @__PURE__ */ n("tr", { children: [
306
329
  /* @__PURE__ */ e("td", { children: "transport" }),
307
- /* @__PURE__ */ e("td", { children: t.config.transport })
330
+ /* @__PURE__ */ e("td", { children: l.config.transport })
308
331
  ] }),
309
332
  /* @__PURE__ */ n("tr", { children: [
310
333
  /* @__PURE__ */ e("td", { children: "channelName" }),
311
- /* @__PURE__ */ e("td", { children: t.config.channelName })
334
+ /* @__PURE__ */ e("td", { children: l.config.channelName })
312
335
  ] }),
313
336
  /* @__PURE__ */ n("tr", { children: [
314
337
  /* @__PURE__ */ e("td", { children: "endpoint" }),
315
- /* @__PURE__ */ e("td", { children: t.config.endpoint === !1 ? "false" : t.config.endpoint })
338
+ /* @__PURE__ */ e("td", { children: l.config.endpoint === !1 ? "false" : l.config.endpoint })
316
339
  ] }),
317
340
  /* @__PURE__ */ n("tr", { children: [
318
341
  /* @__PURE__ */ e("td", { children: "skipInTest" }),
319
- /* @__PURE__ */ e("td", { children: v("skipInTest", t.config.skipInTest) })
342
+ /* @__PURE__ */ e("td", { children: v("skipInTest", l.config.skipInTest) })
320
343
  ] }),
321
344
  /* @__PURE__ */ n("tr", { children: [
322
345
  /* @__PURE__ */ e("td", { children: "onStats callback" }),
323
- /* @__PURE__ */ e("td", { children: t.config.hasOnStatsCallback ? "defined" : "not defined" })
346
+ /* @__PURE__ */ e("td", { children: l.config.hasOnStatsCallback ? "defined" : "not defined" })
324
347
  ] }),
325
348
  /* @__PURE__ */ n("tr", { children: [
326
349
  /* @__PURE__ */ e("td", { children: "shouldShow callback" }),
327
- /* @__PURE__ */ e("td", { children: t.config.hasShouldShowCallback ? "defined" : "not defined" })
350
+ /* @__PURE__ */ e("td", { children: l.config.hasShouldShowCallback ? "defined" : "not defined" })
328
351
  ] })
329
352
  ] })
330
353
  ] }),
@@ -334,13 +357,14 @@ function E({ data: t, tableClassName: c, classPrefix: d }) {
334
357
  /* @__PURE__ */ e("th", { style: { width: "200px" }, children: "Setting" }),
335
358
  /* @__PURE__ */ e("th", { children: "Value" })
336
359
  ] }) }),
337
- /* @__PURE__ */ e("tbody", { children: Object.entries(t.devToolbar).map(([i, l]) => /* @__PURE__ */ n("tr", { children: [
338
- /* @__PURE__ */ e("td", { children: i === "customPaneCount" ? "customPanes" : i }),
339
- /* @__PURE__ */ e("td", { children: i === "customPaneCount" ? `${l} registered` : v(i, l) })
340
- ] }, i)) })
360
+ /* @__PURE__ */ e("tbody", { children: Object.entries(l.devToolbar).map(([t, i]) => /* @__PURE__ */ n("tr", { children: [
361
+ /* @__PURE__ */ e("td", { children: t === "customPaneCount" ? "customPanes" : t }),
362
+ /* @__PURE__ */ e("td", { children: t === "customPaneCount" ? `${i} registered` : v(t, i) })
363
+ ] }, t)) })
341
364
  ] })
342
365
  ] });
343
366
  }
344
367
  export {
345
- E as I
368
+ Q as I,
369
+ H as u
346
370
  };
@@ -0,0 +1,22 @@
1
+ import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
+ import { SECTION_REFRESH_MS as o } from "adonisjs-server-stats/core";
3
+ import { u as d, I as l } from "./InternalsContent-O8ino9oM.js";
4
+ function u({
5
+ options: e = {},
6
+ debugEndpoint: t = "/admin/api/debug"
7
+ }) {
8
+ const { data: s, isLoading: i, error: r } = d({
9
+ baseUrl: e.baseUrl,
10
+ debugEndpoint: t,
11
+ authToken: e.authToken,
12
+ refreshInterval: o
13
+ });
14
+ return i && !s ? /* @__PURE__ */ a("div", { className: "ss-dash-empty", children: "Loading diagnostics..." }) : r ? /* @__PURE__ */ n("div", { className: "ss-dash-empty", children: [
15
+ "Error: ",
16
+ r.message
17
+ ] }) : s ? /* @__PURE__ */ a(l, { data: s, tableClassName: "ss-dash-table", classPrefix: "ss-dash" }) : /* @__PURE__ */ a("div", { className: "ss-dash-empty", children: "Diagnostics not available" });
18
+ }
19
+ export {
20
+ u as InternalsSection,
21
+ u as default
22
+ };
@@ -0,0 +1,17 @@
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
+ import { u as i, I as d } from "./InternalsContent-O8ino9oM.js";
3
+ function b({ options: s }) {
4
+ const { data: a, isLoading: t, error: r } = i({
5
+ baseUrl: s?.baseUrl,
6
+ debugEndpoint: s?.debugEndpoint,
7
+ authToken: s?.authToken
8
+ });
9
+ return t && !a ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading diagnostics..." }) : r ? /* @__PURE__ */ n("div", { className: "ss-dbg-empty", children: [
10
+ "Error: ",
11
+ r.message
12
+ ] }) : a ? /* @__PURE__ */ e(d, { data: a, tableClassName: "ss-dbg-table", classPrefix: "ss-dbg" }) : /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Diagnostics not available" });
13
+ }
14
+ export {
15
+ b as InternalsTab,
16
+ b as default
17
+ };
@@ -0,0 +1,30 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ function n({ stats: s, classPrefix: c = "ss" }) {
3
+ if (!s) return null;
4
+ const a = c;
5
+ return /* @__PURE__ */ l("div", { className: `${a}-job-stats`, children: [
6
+ /* @__PURE__ */ l("div", { className: `${a}-job-stat`, children: [
7
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-label`, children: "Active:" }),
8
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-value`, children: s.active ?? 0 })
9
+ ] }),
10
+ /* @__PURE__ */ l("div", { className: `${a}-job-stat`, children: [
11
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-label`, children: "Waiting:" }),
12
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-value`, children: s.waiting ?? 0 })
13
+ ] }),
14
+ /* @__PURE__ */ l("div", { className: `${a}-job-stat`, children: [
15
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-label`, children: "Delayed:" }),
16
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-value`, children: s.delayed ?? 0 })
17
+ ] }),
18
+ /* @__PURE__ */ l("div", { className: `${a}-job-stat`, children: [
19
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-label`, children: "Completed:" }),
20
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-value`, children: s.completed ?? 0 })
21
+ ] }),
22
+ /* @__PURE__ */ l("div", { className: `${a}-job-stat`, children: [
23
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-label`, children: "Failed:" }),
24
+ /* @__PURE__ */ e("span", { className: `${a}-job-stat-value ${a}-c-red`, children: s.failed ?? 0 })
25
+ ] })
26
+ ] });
27
+ }
28
+ export {
29
+ n as J
30
+ };