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.
- package/dist/core/field-resolvers.d.ts +64 -0
- package/dist/core/formatters.d.ts +15 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +208 -203
- package/dist/react/CacheSection-BYN53kYO.js +135 -0
- package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
- package/dist/react/CacheTab-DOhuK05d.js +106 -0
- package/dist/react/{ConfigSection-DGgqjAal.js → ConfigSection-B9EHh4Rp.js} +1 -1
- package/dist/react/{ConfigTab-H3OnYqmK.js → ConfigTab-C8kriE2b.js} +1 -1
- package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
- package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
- package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
- package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
- package/dist/react/{EventsSection-C7RQW_LY.js → EventsSection-DJPwHeT8.js} +27 -26
- package/dist/react/EventsTab-B-FoehXC.js +58 -0
- package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
- package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
- package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
- package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
- package/dist/react/JobsSection-DWF4i1t_.js +167 -0
- package/dist/react/JobsTab-DqnifQXV.js +129 -0
- package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
- package/dist/react/LogsSection-C1xC5aP4.js +198 -0
- package/dist/react/LogsTab-CS4sLfLw.js +79 -0
- package/dist/react/{OverviewSection-ABP9ueBo.js → OverviewSection-CxvfOR0v.js} +70 -80
- package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
- package/dist/react/{QueriesTab-BQzcxEiW.js → QueriesTab-x85PjkyS.js} +22 -21
- package/dist/react/RequestsSection-DETN9oZb.js +321 -0
- package/dist/react/{RoutesSection-BRhxrtjZ.js → RoutesSection-CmorkJeC.js} +1 -1
- package/dist/react/{RoutesTab-CpYH5lUw.js → RoutesTab-CbzBOzpc.js} +12 -12
- package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
- package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
- package/dist/react/{TimelineTab-DjLR35Ce.js → TimelineTab-Ue9tUD_n.js} +71 -91
- package/dist/react/{index-CsImORX6.js → index-DwDK-4oX.js} +4 -4
- package/dist/react/index.js +6 -6
- package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
- package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
- package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
- package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
- package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
- package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
- package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
- package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
- package/dist/react/style.css +1 -1
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +3 -3
- package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
- package/dist/src/styles/components.css +67 -0
- package/dist/src/styles/dashboard.css +5 -15
- package/dist/src/styles/debug-panel.css +1 -22
- package/dist/src/styles/utilities.css +3 -1
- package/dist/vue/{CacheSection-ITqvpfH5.js → CacheSection-DT2Mwf_s.js} +1 -1
- package/dist/vue/{ConfigSection-DTn3GslE.js → ConfigSection-BwKwS9lh.js} +1 -1
- package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
- package/dist/vue/{EmailsSection-DtLJ4XoS.js → EmailsSection-B65g0FVS.js} +1 -1
- package/dist/vue/{EventsSection-BOYYz0Ty.js → EventsSection-CxqtVF-o.js} +1 -1
- package/dist/vue/{JobsSection-BazTxcJL.js → JobsSection-rMIyMb-g.js} +1 -1
- package/dist/vue/{LogsSection-D55PjTKX.js → LogsSection-DmmZVJ7D.js} +1 -1
- package/dist/vue/{OverviewSection-1uBKo-Tu.js → OverviewSection-BMabyqw-.js} +49 -50
- package/dist/vue/{QueriesSection-rpoZ4ogd.js → QueriesSection-BfDFwGqH.js} +44 -45
- package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
- package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
- package/dist/vue/{RequestsSection-x7LvT0MC.js → RequestsSection-CTu4jPZ_.js} +143 -147
- package/dist/vue/{RoutesSection-CCD0zZqQ.js → RoutesSection-zQZDedL7.js} +1 -1
- package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
- package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
- package/dist/vue/{index-C8MxnS7Q.js → index-CM3yNVUR.js} +2 -2
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +7 -7
- package/dist/react/CacheSection-baMZotSn.js +0 -146
- package/dist/react/CacheTab-2cw_rMzj.js +0 -117
- package/dist/react/CustomPaneTab-B6r7ha0u.js +0 -98
- package/dist/react/EmailsSection-C-UZISG-.js +0 -262
- package/dist/react/EmailsTab-DbK4Eobn.js +0 -139
- package/dist/react/EventsTab-CfVr7AiM.js +0 -57
- package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
- package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
- package/dist/react/JobsSection-CQHNK_Ls.js +0 -187
- package/dist/react/JobsTab-znzf6jzk.js +0 -153
- package/dist/react/LogsSection-Dmm3rE2B.js +0 -233
- package/dist/react/LogsTab-D8unMV5P.js +0 -108
- package/dist/react/QueriesSection-CnmSkznA.js +0 -461
- package/dist/react/RelatedLogs-3A8RuGKH.js +0 -52
- package/dist/react/RequestsSection-kW79_M7k.js +0 -341
- package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
- package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
- package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as L, useMemo as b } from "react";
|
|
3
|
-
import { compactPreview as x, formatDuration as A, durationSeverity as f, timeAgo as u, formatTime as p } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as D } from "./index-CsImORX6.js";
|
|
5
|
-
import { u as M } from "./useResizableTable-CNJmACdt.js";
|
|
6
|
-
import { F as $ } from "./FilterBar-CQ7bD669.js";
|
|
7
|
-
function P({ pane: t, options: g }) {
|
|
8
|
-
({
|
|
9
|
-
...g
|
|
10
|
-
});
|
|
11
|
-
const { data: o, isLoading: y, error: h, clearData: N } = D(
|
|
12
|
-
t.endpoint.replace(/^\//, ""),
|
|
13
|
-
{
|
|
14
|
-
...g,
|
|
15
|
-
debugEndpoint: ""
|
|
16
|
-
// Use endpoint directly
|
|
17
|
-
}
|
|
18
|
-
), [i, S] = L(""), c = b(() => {
|
|
19
|
-
if (!o) return [];
|
|
20
|
-
const e = t.dataKey || t.id;
|
|
21
|
-
let s = o;
|
|
22
|
-
for (const n of e.split("."))
|
|
23
|
-
s = s?.[n];
|
|
24
|
-
return Array.isArray(s) ? s : [];
|
|
25
|
-
}, [o, t.dataKey, t.id]), d = b(() => {
|
|
26
|
-
if (!i) return c;
|
|
27
|
-
const e = i.toLowerCase(), s = t.columns.filter((n) => n.searchable).map((n) => n.key);
|
|
28
|
-
return s.length === 0 ? c : c.filter(
|
|
29
|
-
(n) => s.some((a) => {
|
|
30
|
-
const m = n[a];
|
|
31
|
-
return m !== null && String(m).toLowerCase().includes(e);
|
|
32
|
-
})
|
|
33
|
-
);
|
|
34
|
-
}, [c, i, t.columns]), w = (e, s) => {
|
|
35
|
-
if (e == null)
|
|
36
|
-
return /* @__PURE__ */ r("span", { className: "ss-dbg-c-dim", children: "-" });
|
|
37
|
-
switch (s.format || "text") {
|
|
38
|
-
case "time":
|
|
39
|
-
return /* @__PURE__ */ r("span", { className: "ss-dbg-event-time", title: p(e), children: typeof e == "number" ? u(e) : String(e) });
|
|
40
|
-
case "timeAgo":
|
|
41
|
-
return /* @__PURE__ */ r("span", { className: "ss-dbg-event-time", title: p(e), children: u(e) });
|
|
42
|
-
case "duration": {
|
|
43
|
-
const a = typeof e == "number" ? e : parseFloat(String(e));
|
|
44
|
-
return isNaN(a) ? String(e) : /* @__PURE__ */ r(
|
|
45
|
-
"span",
|
|
46
|
-
{
|
|
47
|
-
className: `ss-dbg-duration ${f(a) === "very-slow" ? "ss-dbg-very-slow" : f(a) === "slow" ? "ss-dbg-slow" : ""}`,
|
|
48
|
-
children: A(a)
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
case "method":
|
|
53
|
-
return /* @__PURE__ */ r("span", { className: `ss-dbg-method ss-dbg-method-${String(e).toLowerCase()}`, children: String(e) });
|
|
54
|
-
case "json": {
|
|
55
|
-
let a = e;
|
|
56
|
-
if (typeof e == "string")
|
|
57
|
-
try {
|
|
58
|
-
a = JSON.parse(e);
|
|
59
|
-
} catch {
|
|
60
|
-
}
|
|
61
|
-
return x(a, 80);
|
|
62
|
-
}
|
|
63
|
-
case "badge": {
|
|
64
|
-
const a = String(e).toLowerCase(), k = (s.badgeColorMap || {})[a] || "muted";
|
|
65
|
-
return /* @__PURE__ */ r("span", { className: `ss-dbg-badge ss-dbg-badge-${k}`, children: String(e) });
|
|
66
|
-
}
|
|
67
|
-
default:
|
|
68
|
-
return String(e);
|
|
69
|
-
}
|
|
70
|
-
}, C = M([d]);
|
|
71
|
-
return y && !o ? /* @__PURE__ */ l("div", { className: "ss-dbg-empty", children: [
|
|
72
|
-
"Loading ",
|
|
73
|
-
t.label,
|
|
74
|
-
"..."
|
|
75
|
-
] }) : h ? /* @__PURE__ */ l("div", { className: "ss-dbg-empty", children: [
|
|
76
|
-
"Error: ",
|
|
77
|
-
h.message
|
|
78
|
-
] }) : /* @__PURE__ */ l("div", { children: [
|
|
79
|
-
t.search && /* @__PURE__ */ r(
|
|
80
|
-
$,
|
|
81
|
-
{
|
|
82
|
-
search: i,
|
|
83
|
-
onSearchChange: S,
|
|
84
|
-
placeholder: t.search.placeholder,
|
|
85
|
-
summary: `${d.length} items`,
|
|
86
|
-
children: t.clearable && /* @__PURE__ */ r("button", { type: "button", className: "ss-dbg-btn-clear", onClick: N, children: "Clear" })
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
d.length === 0 ? /* @__PURE__ */ r("div", { className: "ss-dbg-empty", children: "No data" }) : /* @__PURE__ */ l("table", { ref: C, className: "ss-dbg-table", children: [
|
|
90
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: t.columns.map((e) => /* @__PURE__ */ r("th", { children: e.label }, e.key)) }) }),
|
|
91
|
-
/* @__PURE__ */ r("tbody", { children: d.map((e, s) => /* @__PURE__ */ r("tr", { children: t.columns.map((n) => /* @__PURE__ */ r("td", { children: w(e[n.key], n) }, n.key)) }, e.id ?? s)) })
|
|
92
|
-
] })
|
|
93
|
-
] });
|
|
94
|
-
}
|
|
95
|
-
export {
|
|
96
|
-
P as CustomPaneTab,
|
|
97
|
-
P as default
|
|
98
|
-
};
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import { jsxs as r, jsx as a, Fragment as i } from "react/jsx-runtime";
|
|
2
|
-
import { useState as n, useEffect as N, useCallback as C } from "react";
|
|
3
|
-
import { timeAgo as P, formatTime as A } from "adonisjs-server-stats/core";
|
|
4
|
-
import { a as T } from "./index-CsImORX6.js";
|
|
5
|
-
import { D as j } from "./DataTable-YyShr5B-.js";
|
|
6
|
-
import { F as $ } from "./FilterBar-CQ7bD669.js";
|
|
7
|
-
import { P as F } from "./Pagination-BkmzUDY8.js";
|
|
8
|
-
function q({ options: d = {} }) {
|
|
9
|
-
const [y, h] = n(1), [o, g] = n(""), [p, c] = n(null), [u, m] = n(null), { data: v, meta: l, isLoading: x } = T("emails", { ...d, page: y, search: o }), w = v || [];
|
|
10
|
-
N(() => h(1), [o]);
|
|
11
|
-
const k = C(
|
|
12
|
-
async (e) => {
|
|
13
|
-
if (e.html) {
|
|
14
|
-
c(e.id), m(e.html);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
const { baseUrl: s = "", dashboardEndpoint: t = "/__stats/api", authToken: f } = d, _ = `${s}${t}/emails/${e.id}/preview`, b = { Accept: "text/html" };
|
|
19
|
-
f && (b.Authorization = `Bearer ${f}`);
|
|
20
|
-
const S = await (await fetch(_, { headers: b, credentials: "same-origin" })).text();
|
|
21
|
-
c(e.id), m(S);
|
|
22
|
-
} catch {
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
[d]
|
|
26
|
-
);
|
|
27
|
-
if (p && u) {
|
|
28
|
-
const e = w.find((s) => s.id === p);
|
|
29
|
-
return /* @__PURE__ */ r("div", { className: "ss-dash-email-preview", id: "ss-dash-email-preview", children: [
|
|
30
|
-
/* @__PURE__ */ r("div", { className: "ss-dash-email-preview-header", children: [
|
|
31
|
-
/* @__PURE__ */ a("div", { className: "ss-dash-email-preview-meta", id: "ss-dash-email-preview-meta", children: e && /* @__PURE__ */ r(i, { children: [
|
|
32
|
-
/* @__PURE__ */ a("strong", { children: "Subject:" }),
|
|
33
|
-
" ",
|
|
34
|
-
e.subject,
|
|
35
|
-
" | ",
|
|
36
|
-
/* @__PURE__ */ a("strong", { children: "From:" }),
|
|
37
|
-
" ",
|
|
38
|
-
e.from_addr || e.from,
|
|
39
|
-
" | ",
|
|
40
|
-
/* @__PURE__ */ a("strong", { children: "To:" }),
|
|
41
|
-
" ",
|
|
42
|
-
e.to_addr || e.to,
|
|
43
|
-
(e.cc || e.cc_addr) && /* @__PURE__ */ r(i, { children: [
|
|
44
|
-
" | ",
|
|
45
|
-
/* @__PURE__ */ a("strong", { children: "CC:" }),
|
|
46
|
-
" ",
|
|
47
|
-
e.cc || e.cc_addr
|
|
48
|
-
] }),
|
|
49
|
-
" | ",
|
|
50
|
-
/* @__PURE__ */ a("strong", { children: "Status:" }),
|
|
51
|
-
" ",
|
|
52
|
-
/* @__PURE__ */ a("span", { className: `ss-dash-badge ss-dash-email-status-${e.status}`, children: e.status }),
|
|
53
|
-
e.mailer && /* @__PURE__ */ r(i, { children: [
|
|
54
|
-
" | ",
|
|
55
|
-
/* @__PURE__ */ a("strong", { children: "Mailer:" }),
|
|
56
|
-
" ",
|
|
57
|
-
e.mailer
|
|
58
|
-
] })
|
|
59
|
-
] }) }),
|
|
60
|
-
/* @__PURE__ */ a(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
type: "button",
|
|
64
|
-
className: "ss-dash-btn",
|
|
65
|
-
id: "ss-dash-email-preview-close",
|
|
66
|
-
onClick: () => {
|
|
67
|
-
c(null), m(null);
|
|
68
|
-
},
|
|
69
|
-
children: "Close"
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ a(
|
|
74
|
-
"iframe",
|
|
75
|
-
{
|
|
76
|
-
className: "ss-dash-email-iframe",
|
|
77
|
-
id: "ss-dash-email-iframe",
|
|
78
|
-
srcDoc: u,
|
|
79
|
-
title: "Email preview",
|
|
80
|
-
sandbox: ""
|
|
81
|
-
}
|
|
82
|
-
)
|
|
83
|
-
] });
|
|
84
|
-
}
|
|
85
|
-
return /* @__PURE__ */ r("div", { children: [
|
|
86
|
-
/* @__PURE__ */ a(
|
|
87
|
-
$,
|
|
88
|
-
{
|
|
89
|
-
search: o,
|
|
90
|
-
onSearchChange: g,
|
|
91
|
-
placeholder: "Filter emails...",
|
|
92
|
-
summary: `${l?.total ?? 0} emails`
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
x && !v ? /* @__PURE__ */ a("div", { className: "ss-dash-empty", children: "Loading emails..." }) : /* @__PURE__ */ r(i, { children: [
|
|
96
|
-
/* @__PURE__ */ a("div", { className: "ss-dash-table-wrap", children: /* @__PURE__ */ a(
|
|
97
|
-
j,
|
|
98
|
-
{
|
|
99
|
-
columns: [
|
|
100
|
-
{
|
|
101
|
-
key: "id",
|
|
102
|
-
label: "#",
|
|
103
|
-
width: "40px",
|
|
104
|
-
render: (e) => /* @__PURE__ */ a("span", { style: { color: "var(--ss-dim)" }, children: e })
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
key: "from",
|
|
108
|
-
label: "From",
|
|
109
|
-
width: "150px",
|
|
110
|
-
render: (e, s) => {
|
|
111
|
-
const t = s.from_addr || s.from || "";
|
|
112
|
-
return /* @__PURE__ */ a(
|
|
113
|
-
"span",
|
|
114
|
-
{
|
|
115
|
-
title: t,
|
|
116
|
-
style: {
|
|
117
|
-
color: "var(--ss-text-secondary)",
|
|
118
|
-
overflow: "hidden",
|
|
119
|
-
textOverflow: "ellipsis",
|
|
120
|
-
whiteSpace: "nowrap",
|
|
121
|
-
display: "block"
|
|
122
|
-
},
|
|
123
|
-
children: t
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
key: "to",
|
|
130
|
-
label: "To",
|
|
131
|
-
width: "150px",
|
|
132
|
-
render: (e, s) => {
|
|
133
|
-
const t = s.to_addr || s.to || "";
|
|
134
|
-
return /* @__PURE__ */ a(
|
|
135
|
-
"span",
|
|
136
|
-
{
|
|
137
|
-
title: t,
|
|
138
|
-
style: {
|
|
139
|
-
color: "var(--ss-text-secondary)",
|
|
140
|
-
overflow: "hidden",
|
|
141
|
-
textOverflow: "ellipsis",
|
|
142
|
-
whiteSpace: "nowrap",
|
|
143
|
-
display: "block"
|
|
144
|
-
},
|
|
145
|
-
children: t
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
key: "subject",
|
|
152
|
-
label: "Subject",
|
|
153
|
-
render: (e) => {
|
|
154
|
-
const s = e || "";
|
|
155
|
-
return /* @__PURE__ */ a(
|
|
156
|
-
"span",
|
|
157
|
-
{
|
|
158
|
-
title: s,
|
|
159
|
-
style: {
|
|
160
|
-
color: "var(--ss-sql-color)",
|
|
161
|
-
overflow: "hidden",
|
|
162
|
-
textOverflow: "ellipsis",
|
|
163
|
-
whiteSpace: "nowrap",
|
|
164
|
-
display: "block"
|
|
165
|
-
},
|
|
166
|
-
children: s
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
key: "status",
|
|
173
|
-
label: "Status",
|
|
174
|
-
width: "80px",
|
|
175
|
-
render: (e) => {
|
|
176
|
-
const s = e || "";
|
|
177
|
-
return /* @__PURE__ */ a("span", { className: `ss-dash-badge ss-dash-email-status-${s}`, children: s });
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
key: "attachmentCount",
|
|
182
|
-
label: "ATT",
|
|
183
|
-
width: "40px",
|
|
184
|
-
render: (e, s) => {
|
|
185
|
-
const t = s.attachment_count || s.attachmentCount || 0;
|
|
186
|
-
return t > 0 ? /* @__PURE__ */ a(
|
|
187
|
-
"span",
|
|
188
|
-
{
|
|
189
|
-
style: { color: "var(--ss-dim)", textAlign: "center", display: "block" },
|
|
190
|
-
children: t
|
|
191
|
-
}
|
|
192
|
-
) : /* @__PURE__ */ a(
|
|
193
|
-
"span",
|
|
194
|
-
{
|
|
195
|
-
style: { color: "var(--ss-dim)", textAlign: "center", display: "block" },
|
|
196
|
-
children: "-"
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
key: "mailer",
|
|
203
|
-
label: "Mailer",
|
|
204
|
-
width: "70px",
|
|
205
|
-
render: (e) => {
|
|
206
|
-
const s = e || "";
|
|
207
|
-
return /* @__PURE__ */ a(
|
|
208
|
-
"span",
|
|
209
|
-
{
|
|
210
|
-
title: s,
|
|
211
|
-
style: {
|
|
212
|
-
color: "var(--ss-muted)",
|
|
213
|
-
overflow: "hidden",
|
|
214
|
-
textOverflow: "ellipsis",
|
|
215
|
-
whiteSpace: "nowrap",
|
|
216
|
-
display: "block"
|
|
217
|
-
},
|
|
218
|
-
children: s
|
|
219
|
-
}
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
key: "createdAt",
|
|
225
|
-
label: "Time",
|
|
226
|
-
width: "80px",
|
|
227
|
-
render: (e, s) => {
|
|
228
|
-
const t = s.createdAt || s.created_at || s.timestamp;
|
|
229
|
-
return /* @__PURE__ */ a(
|
|
230
|
-
"span",
|
|
231
|
-
{
|
|
232
|
-
className: "ss-dash-event-time",
|
|
233
|
-
style: { whiteSpace: "nowrap" },
|
|
234
|
-
title: A(t),
|
|
235
|
-
children: P(t)
|
|
236
|
-
}
|
|
237
|
-
);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
],
|
|
241
|
-
data: w,
|
|
242
|
-
onRowClick: k,
|
|
243
|
-
rowClassName: "ss-dash-email-row",
|
|
244
|
-
emptyMessage: "No emails captured yet"
|
|
245
|
-
}
|
|
246
|
-
) }),
|
|
247
|
-
l && /* @__PURE__ */ a(
|
|
248
|
-
F,
|
|
249
|
-
{
|
|
250
|
-
page: l.page,
|
|
251
|
-
lastPage: l.lastPage,
|
|
252
|
-
total: l.total,
|
|
253
|
-
onPageChange: h
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
] })
|
|
257
|
-
] });
|
|
258
|
-
}
|
|
259
|
-
export {
|
|
260
|
-
q as EmailsSection,
|
|
261
|
-
q as default
|
|
262
|
-
};
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { useState as n, useMemo as f, useCallback as v } from "react";
|
|
3
|
-
import { timeAgo as j, formatTime as k } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as A } from "./index-CsImORX6.js";
|
|
5
|
-
import { u as P } from "./useResizableTable-CNJmACdt.js";
|
|
6
|
-
import { F as q } from "./FilterBar-CQ7bD669.js";
|
|
7
|
-
function B({ options: d }) {
|
|
8
|
-
const { data: o, isLoading: y, error: u } = A("emails", d), [c, N] = n(""), [g, b] = n(null), [p, h] = n(null), [x, m] = n(!1), a = f(() => {
|
|
9
|
-
const t = o?.emails || [];
|
|
10
|
-
if (!c) return t;
|
|
11
|
-
const l = c.toLowerCase();
|
|
12
|
-
return t.filter(
|
|
13
|
-
(r) => (r.subject || "").toLowerCase().includes(l) || (r.to || "").toLowerCase().includes(l) || (r.from || "").toLowerCase().includes(l) || (r.mailer || "").toLowerCase().includes(l)
|
|
14
|
-
);
|
|
15
|
-
}, [o, c]), i = f(() => a.find((t) => t.id === g), [a, g]), C = v(
|
|
16
|
-
async (t) => {
|
|
17
|
-
if (b(t.id), h(t.html || null), !t.html && t.id) {
|
|
18
|
-
m(!0);
|
|
19
|
-
try {
|
|
20
|
-
const l = d?.debugEndpoint || "/admin/api/debug", r = {};
|
|
21
|
-
d?.authToken && (r.Authorization = `Bearer ${d.authToken}`);
|
|
22
|
-
const w = await fetch(`${l}/emails/${t.id}/preview`, {
|
|
23
|
-
headers: r,
|
|
24
|
-
credentials: d?.authToken ? "omit" : "include"
|
|
25
|
-
});
|
|
26
|
-
w.ok && h(await w.text());
|
|
27
|
-
} catch {
|
|
28
|
-
} finally {
|
|
29
|
-
m(!1);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
[d]
|
|
34
|
-
), L = v(() => {
|
|
35
|
-
b(null), h(null), m(!1);
|
|
36
|
-
}, []), T = {
|
|
37
|
-
sent: "ss-dbg-email-status-sent",
|
|
38
|
-
sending: "ss-dbg-email-status-sending",
|
|
39
|
-
queueing: "ss-dbg-email-status-queued",
|
|
40
|
-
queued: "ss-dbg-email-status-queued",
|
|
41
|
-
failed: "ss-dbg-email-status-failed"
|
|
42
|
-
}, S = P([a]);
|
|
43
|
-
return y && !o ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading emails..." }) : u ? /* @__PURE__ */ s("div", { className: "ss-dbg-empty", children: [
|
|
44
|
-
"Error: ",
|
|
45
|
-
u.message
|
|
46
|
-
] }) : i ? /* @__PURE__ */ s("div", { className: "ss-dbg-email-preview", children: [
|
|
47
|
-
/* @__PURE__ */ s("div", { className: "ss-dbg-email-preview-header", children: [
|
|
48
|
-
/* @__PURE__ */ s("div", { className: "ss-dbg-email-preview-meta", children: [
|
|
49
|
-
/* @__PURE__ */ s("div", { children: [
|
|
50
|
-
/* @__PURE__ */ e("strong", { children: "Subject:" }),
|
|
51
|
-
" ",
|
|
52
|
-
i.subject
|
|
53
|
-
] }),
|
|
54
|
-
/* @__PURE__ */ s("div", { children: [
|
|
55
|
-
/* @__PURE__ */ e("strong", { children: "From:" }),
|
|
56
|
-
" ",
|
|
57
|
-
i.from
|
|
58
|
-
] }),
|
|
59
|
-
/* @__PURE__ */ s("div", { children: [
|
|
60
|
-
/* @__PURE__ */ e("strong", { children: "To:" }),
|
|
61
|
-
" ",
|
|
62
|
-
i.to
|
|
63
|
-
] }),
|
|
64
|
-
i.cc && /* @__PURE__ */ s("div", { children: [
|
|
65
|
-
/* @__PURE__ */ e("strong", { children: "CC:" }),
|
|
66
|
-
" ",
|
|
67
|
-
i.cc
|
|
68
|
-
] })
|
|
69
|
-
] }),
|
|
70
|
-
/* @__PURE__ */ e("button", { className: "ss-dbg-btn-clear", onClick: L, type: "button", children: "×" })
|
|
71
|
-
] }),
|
|
72
|
-
x ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading preview..." }) : p ? /* @__PURE__ */ e(
|
|
73
|
-
"iframe",
|
|
74
|
-
{
|
|
75
|
-
className: "ss-dbg-email-iframe",
|
|
76
|
-
srcDoc: p,
|
|
77
|
-
title: "Email preview",
|
|
78
|
-
sandbox: ""
|
|
79
|
-
}
|
|
80
|
-
) : /* @__PURE__ */ e("div", { style: { padding: "12px", whiteSpace: "pre-wrap" }, children: i.text || "No content" })
|
|
81
|
-
] }) : /* @__PURE__ */ s("div", { children: [
|
|
82
|
-
/* @__PURE__ */ e(
|
|
83
|
-
q,
|
|
84
|
-
{
|
|
85
|
-
search: c,
|
|
86
|
-
onSearchChange: N,
|
|
87
|
-
placeholder: "Filter emails...",
|
|
88
|
-
summary: `${a.length} emails`
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
a.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No emails captured" }) : /* @__PURE__ */ s("table", { ref: S, className: "ss-dbg-table", children: [
|
|
92
|
-
/* @__PURE__ */ s("colgroup", { children: [
|
|
93
|
-
/* @__PURE__ */ e("col", { style: { width: "50px" } }),
|
|
94
|
-
/* @__PURE__ */ e("col", { style: { width: "140px" } }),
|
|
95
|
-
/* @__PURE__ */ e("col", { style: { width: "140px" } }),
|
|
96
|
-
/* @__PURE__ */ e("col", {}),
|
|
97
|
-
/* @__PURE__ */ e("col", { style: { width: "70px" } }),
|
|
98
|
-
/* @__PURE__ */ e("col", { style: { width: "80px" } }),
|
|
99
|
-
/* @__PURE__ */ e("col", { style: { width: "40px" } }),
|
|
100
|
-
/* @__PURE__ */ e("col", { style: { width: "80px" } })
|
|
101
|
-
] }),
|
|
102
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
|
|
103
|
-
/* @__PURE__ */ e("th", { children: "#" }),
|
|
104
|
-
/* @__PURE__ */ e("th", { children: "From" }),
|
|
105
|
-
/* @__PURE__ */ e("th", { children: "To" }),
|
|
106
|
-
/* @__PURE__ */ e("th", { children: "Subject" }),
|
|
107
|
-
/* @__PURE__ */ e("th", { children: "Status" }),
|
|
108
|
-
/* @__PURE__ */ e("th", { children: "Mailer" }),
|
|
109
|
-
/* @__PURE__ */ e("th", { title: "Attachments", children: "📎" }),
|
|
110
|
-
/* @__PURE__ */ e("th", { children: "Time" })
|
|
111
|
-
] }) }),
|
|
112
|
-
/* @__PURE__ */ e("tbody", { children: a.map((t) => /* @__PURE__ */ s("tr", { className: "ss-dbg-email-row", onClick: () => C(t), children: [
|
|
113
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", style: { whiteSpace: "nowrap" }, children: t.id }),
|
|
114
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-secondary", title: t.from, children: t.from }),
|
|
115
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-secondary", title: t.to, children: t.to }),
|
|
116
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-sql", children: t.subject }),
|
|
117
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `ss-dbg-email-status ${T[t.status] || ""}`, children: t.status }) }),
|
|
118
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", children: t.mailer }),
|
|
119
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", style: { textAlign: "center" }, children: t.attachmentCount > 0 ? t.attachmentCount : "-" }),
|
|
120
|
-
/* @__PURE__ */ e(
|
|
121
|
-
"td",
|
|
122
|
-
{
|
|
123
|
-
className: "ss-dbg-event-time",
|
|
124
|
-
title: k(
|
|
125
|
-
t.timestamp || t.created_at || t.createdAt
|
|
126
|
-
),
|
|
127
|
-
children: j(
|
|
128
|
-
t.timestamp || t.created_at || t.createdAt
|
|
129
|
-
)
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
] }, t.id)) })
|
|
133
|
-
] })
|
|
134
|
-
] });
|
|
135
|
-
}
|
|
136
|
-
export {
|
|
137
|
-
B as EmailsTab,
|
|
138
|
-
B as default
|
|
139
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { useState as u, useMemo as g } from "react";
|
|
3
|
-
import { timeAgo as p, formatTime as b } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as f, J as v } from "./index-CsImORX6.js";
|
|
5
|
-
import { u as w } from "./useResizableTable-CNJmACdt.js";
|
|
6
|
-
import { F as y } from "./FilterBar-CQ7bD669.js";
|
|
7
|
-
function D({ options: c }) {
|
|
8
|
-
const { data: i, isLoading: o, error: d } = f("events", c), [a, m] = u(""), n = g(() => {
|
|
9
|
-
const t = i?.events || [];
|
|
10
|
-
if (!a) return t;
|
|
11
|
-
const r = a.toLowerCase();
|
|
12
|
-
return t.filter(
|
|
13
|
-
(l) => (l.event || "").toLowerCase().includes(r) || (l.data || "").toLowerCase().includes(r)
|
|
14
|
-
);
|
|
15
|
-
}, [i, a]), h = w([n]);
|
|
16
|
-
return o && !i ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading events..." }) : d ? /* @__PURE__ */ s("div", { className: "ss-dbg-empty", children: [
|
|
17
|
-
"Error: ",
|
|
18
|
-
d.message
|
|
19
|
-
] }) : /* @__PURE__ */ s("div", { children: [
|
|
20
|
-
/* @__PURE__ */ e(
|
|
21
|
-
y,
|
|
22
|
-
{
|
|
23
|
-
search: a,
|
|
24
|
-
onSearchChange: m,
|
|
25
|
-
placeholder: "Filter events...",
|
|
26
|
-
summary: `${n.length} events`
|
|
27
|
-
}
|
|
28
|
-
),
|
|
29
|
-
n.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No events captured" }) : /* @__PURE__ */ s("table", { ref: h, className: "ss-dbg-table", children: [
|
|
30
|
-
/* @__PURE__ */ s("colgroup", { children: [
|
|
31
|
-
/* @__PURE__ */ e("col", { style: { width: "50px" } }),
|
|
32
|
-
/* @__PURE__ */ e("col", { style: { width: "20%" } }),
|
|
33
|
-
/* @__PURE__ */ e("col", {}),
|
|
34
|
-
/* @__PURE__ */ e("col", { style: { width: "80px" } })
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ s("tr", { children: [
|
|
37
|
-
/* @__PURE__ */ e("th", { children: "#" }),
|
|
38
|
-
/* @__PURE__ */ e("th", { children: "Event" }),
|
|
39
|
-
/* @__PURE__ */ e("th", { children: "Data" }),
|
|
40
|
-
/* @__PURE__ */ e("th", { children: "Time" })
|
|
41
|
-
] }) }),
|
|
42
|
-
/* @__PURE__ */ e("tbody", { children: n.map((t) => {
|
|
43
|
-
const r = t.timestamp || t.created_at || t.createdAt;
|
|
44
|
-
return /* @__PURE__ */ s("tr", { children: [
|
|
45
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", style: { whiteSpace: "nowrap" }, children: t.id }),
|
|
46
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-event-name", children: t.event }),
|
|
47
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-event-data", children: /* @__PURE__ */ e(v, { data: t.data, maxPreviewLength: 80, classPrefix: "ss-dbg" }) }),
|
|
48
|
-
/* @__PURE__ */ e("td", { className: "ss-dbg-event-time", title: b(r), children: p(r) })
|
|
49
|
-
] }, t.id);
|
|
50
|
-
}) })
|
|
51
|
-
] })
|
|
52
|
-
] });
|
|
53
|
-
}
|
|
54
|
-
export {
|
|
55
|
-
D as EventsTab,
|
|
56
|
-
D as default
|
|
57
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as l, jsxs as E } from "react/jsx-runtime";
|
|
2
|
-
import { useState as i, useRef as I, useCallback as v, useEffect as C } from "react";
|
|
3
|
-
import { UnauthorizedError as S, SECTION_REFRESH_MS as b } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as y } from "./useApiClient-BVtNCmnL.js";
|
|
5
|
-
import { I as N } from "./InternalsContent-DBzsI0CG.js";
|
|
6
|
-
function k({
|
|
7
|
-
options: f = {},
|
|
8
|
-
debugEndpoint: c = "/admin/api/debug"
|
|
9
|
-
}) {
|
|
10
|
-
const { baseUrl: m = "", authToken: d } = f, [n, h] = i(null), [g, t] = i(!0), [o, s] = i(null), r = I(null), u = y(m, d), a = v(async () => {
|
|
11
|
-
try {
|
|
12
|
-
const p = await u().get(`${c}/diagnostics`);
|
|
13
|
-
h(p), s(null), t(!1);
|
|
14
|
-
} catch (e) {
|
|
15
|
-
if (e instanceof S) {
|
|
16
|
-
s(e), t(!1), r.current && (clearInterval(r.current), r.current = null);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
s(e instanceof Error ? e : new Error(String(e))), t(!1);
|
|
20
|
-
}
|
|
21
|
-
}, [c, u]);
|
|
22
|
-
return C(() => (t(!0), s(null), a(), r.current = setInterval(a, b), () => {
|
|
23
|
-
r.current && (clearInterval(r.current), r.current = null);
|
|
24
|
-
}), [a]), g && !n ? /* @__PURE__ */ l("div", { className: "ss-dash-empty", children: "Loading diagnostics..." }) : o ? /* @__PURE__ */ E("div", { className: "ss-dash-empty", children: [
|
|
25
|
-
"Error: ",
|
|
26
|
-
o.message
|
|
27
|
-
] }) : n ? /* @__PURE__ */ l(N, { data: n, tableClassName: "ss-dash-table", classPrefix: "ss-dash" }) : /* @__PURE__ */ l("div", { className: "ss-dash-empty", children: "Diagnostics not available" });
|
|
28
|
-
}
|
|
29
|
-
export {
|
|
30
|
-
k as InternalsSection,
|
|
31
|
-
k as default
|
|
32
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx as l, jsxs as E } from "react/jsx-runtime";
|
|
2
|
-
import { useState as i, useRef as I, useCallback as h, useEffect as v } from "react";
|
|
3
|
-
import { UnauthorizedError as y } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as C } from "./useApiClient-BVtNCmnL.js";
|
|
5
|
-
import { I as N } from "./InternalsContent-DBzsI0CG.js";
|
|
6
|
-
const R = 3e3;
|
|
7
|
-
function j({ options: f }) {
|
|
8
|
-
const { baseUrl: d = "", debugEndpoint: o = "/admin/api/debug", authToken: m } = f || {}, [s, g] = i(null), [b, r] = i(!0), [c, n] = i(null), e = I(null), u = C(d, m), a = h(async () => {
|
|
9
|
-
try {
|
|
10
|
-
const p = await u().get(`${o}/diagnostics`);
|
|
11
|
-
g(p), n(null), r(!1);
|
|
12
|
-
} catch (t) {
|
|
13
|
-
if (t instanceof y) {
|
|
14
|
-
n(t), r(!1), e.current && (clearInterval(e.current), e.current = null);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
n(t instanceof Error ? t : new Error(String(t))), r(!1);
|
|
18
|
-
}
|
|
19
|
-
}, [o, u]);
|
|
20
|
-
return v(() => (r(!0), n(null), a(), e.current = setInterval(a, R), () => {
|
|
21
|
-
e.current && (clearInterval(e.current), e.current = null);
|
|
22
|
-
}), [a]), b && !s ? /* @__PURE__ */ l("div", { className: "ss-dbg-empty", children: "Loading diagnostics..." }) : c ? /* @__PURE__ */ E("div", { className: "ss-dbg-empty", children: [
|
|
23
|
-
"Error: ",
|
|
24
|
-
c.message
|
|
25
|
-
] }) : s ? /* @__PURE__ */ l(N, { data: s, tableClassName: "ss-dbg-table", classPrefix: "ss-dbg" }) : /* @__PURE__ */ l("div", { className: "ss-dbg-empty", children: "Diagnostics not available" });
|
|
26
|
-
}
|
|
27
|
-
export {
|
|
28
|
-
j as InternalsTab,
|
|
29
|
-
j as default
|
|
30
|
-
};
|