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
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { jsxs as y, jsx as t, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import { useState as l, useCallback as C } from "react";
|
|
3
|
+
import { extractJobs as D, extractJobStats as F, JOB_STATUS_FILTERS as j, getJobStatusBadgeColor as B, formatDuration as A, resolveJobTimestamp as L } from "adonisjs-server-stats/core";
|
|
4
|
+
import { a as R, B as _, J as $ } from "./index-DwDK-4oX.js";
|
|
5
|
+
import { J as M } from "./JobStatsBar-C7RslAFE.js";
|
|
6
|
+
import { T as O } from "./TimeAgoCell-o3KigGfM.js";
|
|
7
|
+
import { D as U } from "./DataTable-YyShr5B-.js";
|
|
8
|
+
import { F as E } from "./FilterBar-CQ7bD669.js";
|
|
9
|
+
import { P as K } from "./Pagination-BkmzUDY8.js";
|
|
10
|
+
function Z({ options: g = {} }) {
|
|
11
|
+
const [f, c] = l(1), [m, x] = l(""), [i, S] = l("all"), [k, n] = l(
|
|
12
|
+
{}
|
|
13
|
+
), p = {};
|
|
14
|
+
i !== "all" && (p.status = i);
|
|
15
|
+
const { data: d, meta: r, isLoading: w, error: J, refresh: h, mutate: u } = R("jobs", {
|
|
16
|
+
...g,
|
|
17
|
+
page: f,
|
|
18
|
+
search: m,
|
|
19
|
+
filters: p
|
|
20
|
+
}), b = D(d), v = F(d), N = C(
|
|
21
|
+
async (e) => {
|
|
22
|
+
n((a) => ({ ...a, [e]: "pending" }));
|
|
23
|
+
try {
|
|
24
|
+
await u(`jobs/${e}/retry`), n((a) => ({ ...a, [e]: "success" })), setTimeout(() => {
|
|
25
|
+
n((a) => {
|
|
26
|
+
const s = { ...a };
|
|
27
|
+
return delete s[e], s;
|
|
28
|
+
}), h();
|
|
29
|
+
}, 1e3);
|
|
30
|
+
} catch {
|
|
31
|
+
n((a) => {
|
|
32
|
+
const s = { ...a };
|
|
33
|
+
return delete s[e], s;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
[u, h]
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
40
|
+
/* @__PURE__ */ t(M, { stats: v, classPrefix: "ss-dash" }),
|
|
41
|
+
/* @__PURE__ */ t(
|
|
42
|
+
E,
|
|
43
|
+
{
|
|
44
|
+
search: m,
|
|
45
|
+
onSearchChange: x,
|
|
46
|
+
placeholder: "Filter jobs...",
|
|
47
|
+
summary: `${r?.total ?? b.length} jobs`,
|
|
48
|
+
children: /* @__PURE__ */ t("div", { className: "ss-dash-btn-group", children: j.map((e) => /* @__PURE__ */ t(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
type: "button",
|
|
52
|
+
className: `ss-dash-btn ${i === e ? "ss-dash-active" : ""}`,
|
|
53
|
+
onClick: () => {
|
|
54
|
+
S(e), c(1);
|
|
55
|
+
},
|
|
56
|
+
children: e.charAt(0).toUpperCase() + e.slice(1)
|
|
57
|
+
},
|
|
58
|
+
e
|
|
59
|
+
)) })
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
w && !d ? /* @__PURE__ */ t("div", { className: "ss-dash-empty", children: "Loading jobs..." }) : J ? /* @__PURE__ */ t("div", { className: "ss-dash-empty", children: "Jobs/Queue not available" }) : /* @__PURE__ */ y(T, { children: [
|
|
63
|
+
/* @__PURE__ */ t("div", { className: "ss-dash-table-wrap", children: /* @__PURE__ */ t(
|
|
64
|
+
U,
|
|
65
|
+
{
|
|
66
|
+
columns: [
|
|
67
|
+
{
|
|
68
|
+
key: "id",
|
|
69
|
+
label: "ID",
|
|
70
|
+
width: "40px",
|
|
71
|
+
render: (e) => /* @__PURE__ */ t("span", { style: { color: "var(--ss-dim)" }, children: e })
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: "name",
|
|
75
|
+
label: "Name",
|
|
76
|
+
render: (e) => /* @__PURE__ */ t("span", { style: { color: "var(--ss-text)" }, title: e, children: e })
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: "status",
|
|
80
|
+
label: "Status",
|
|
81
|
+
width: "90px",
|
|
82
|
+
render: (e) => /* @__PURE__ */ t(_, { color: B(e), children: e })
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "payload",
|
|
86
|
+
label: "Payload",
|
|
87
|
+
render: (e, a) => /* @__PURE__ */ t($, { data: e || a?.data, maxPreviewLength: 60 })
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: "attempts",
|
|
91
|
+
label: "Tries",
|
|
92
|
+
width: "50px",
|
|
93
|
+
render: (e, a) => /* @__PURE__ */ t(
|
|
94
|
+
"span",
|
|
95
|
+
{
|
|
96
|
+
style: {
|
|
97
|
+
color: "var(--ss-muted)",
|
|
98
|
+
textAlign: "center",
|
|
99
|
+
display: "block"
|
|
100
|
+
},
|
|
101
|
+
children: e || a.attemptsMade || 0
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "duration",
|
|
107
|
+
label: "Duration",
|
|
108
|
+
width: "75px",
|
|
109
|
+
render: (e) => /* @__PURE__ */ t("span", { className: "ss-dash-duration", children: e !== null ? A(e) : "-" })
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
key: "timestamp",
|
|
113
|
+
label: "Time",
|
|
114
|
+
width: "70px",
|
|
115
|
+
render: (e, a) => {
|
|
116
|
+
const s = e || L(a);
|
|
117
|
+
return /* @__PURE__ */ t(
|
|
118
|
+
O,
|
|
119
|
+
{
|
|
120
|
+
ts: s,
|
|
121
|
+
className: "ss-dash-event-time",
|
|
122
|
+
style: { whiteSpace: "nowrap" }
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
key: "_actions",
|
|
129
|
+
label: "",
|
|
130
|
+
width: "50px",
|
|
131
|
+
render: (e, a) => {
|
|
132
|
+
const s = a.id, o = k[s];
|
|
133
|
+
return a.status !== "failed" ? null : /* @__PURE__ */ t(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
className: "ss-dash-retry-btn",
|
|
138
|
+
disabled: o === "pending" || o === "success",
|
|
139
|
+
onClick: (P) => {
|
|
140
|
+
P.stopPropagation(), N(s);
|
|
141
|
+
},
|
|
142
|
+
children: o === "pending" ? "..." : o === "success" ? "OK" : "Retry"
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
data: b,
|
|
149
|
+
emptyMessage: "No jobs found"
|
|
150
|
+
}
|
|
151
|
+
) }),
|
|
152
|
+
r && /* @__PURE__ */ t(
|
|
153
|
+
K,
|
|
154
|
+
{
|
|
155
|
+
page: r.page,
|
|
156
|
+
lastPage: r.lastPage,
|
|
157
|
+
total: r.total,
|
|
158
|
+
onPageChange: c
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] })
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
Z as JobsSection,
|
|
166
|
+
Z as default
|
|
167
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useMemo as C, useCallback as A } from "react";
|
|
3
|
+
import { extractJobs as B, extractJobStats as $, JOB_STATUS_FILTERS as D, getJobStatusCssClass as F, formatDuration as L, resolveJobTimestamp as R } from "adonisjs-server-stats/core";
|
|
4
|
+
import { T as P } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
|
+
import { u as k } from "./useDashboardApiBase-Bi36pJ2L.js";
|
|
6
|
+
import { u as E, J as O } from "./index-DwDK-4oX.js";
|
|
7
|
+
import { u as q } from "./useResizableTable-CNJmACdt.js";
|
|
8
|
+
import { F as z } from "./FilterBar-CQ7bD669.js";
|
|
9
|
+
import { J as M } from "./JobStatsBar-C7RslAFE.js";
|
|
10
|
+
function X({ options: d, dashboardPath: f }) {
|
|
11
|
+
const { dashApiBase: h, resolvedOptions: y } = k(f, d), { data: l, isLoading: N, error: u } = E("jobs", y), [n, v] = m(""), [c, x] = m("all"), [b, g] = m(null), o = C(() => {
|
|
12
|
+
const t = B(l), s = c === "all" ? t : t.filter((i) => i.status === c);
|
|
13
|
+
if (!n) return s;
|
|
14
|
+
const r = n.toLowerCase();
|
|
15
|
+
return s.filter((i) => i.name?.toLowerCase().includes(r) || i.id?.toString().includes(r));
|
|
16
|
+
}, [l, c, n]), S = A(
|
|
17
|
+
async (t) => {
|
|
18
|
+
g(t);
|
|
19
|
+
try {
|
|
20
|
+
const { baseUrl: s = "", authToken: r } = d || {}, i = h || d?.debugEndpoint || "/admin/api/debug", J = `${s}${i}/jobs/${t}/retry`, p = { Accept: "application/json" };
|
|
21
|
+
r && (p.Authorization = `Bearer ${r}`), await fetch(J, {
|
|
22
|
+
method: "POST",
|
|
23
|
+
headers: p,
|
|
24
|
+
credentials: r ? "omit" : "same-origin"
|
|
25
|
+
});
|
|
26
|
+
} catch {
|
|
27
|
+
}
|
|
28
|
+
g(null);
|
|
29
|
+
},
|
|
30
|
+
[d, h]
|
|
31
|
+
), w = q([o]);
|
|
32
|
+
if (!h)
|
|
33
|
+
return /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Queue inspector not available (no dashboard configured)" });
|
|
34
|
+
if (N && !l)
|
|
35
|
+
return /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading jobs..." });
|
|
36
|
+
if (u)
|
|
37
|
+
return /* @__PURE__ */ a("div", { className: "ss-dbg-empty", children: [
|
|
38
|
+
"Error: ",
|
|
39
|
+
u.message
|
|
40
|
+
] });
|
|
41
|
+
if (!l)
|
|
42
|
+
return /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Queue inspector not available" });
|
|
43
|
+
const T = $(l);
|
|
44
|
+
return /* @__PURE__ */ a("div", { children: [
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
z,
|
|
47
|
+
{
|
|
48
|
+
search: n,
|
|
49
|
+
onSearchChange: v,
|
|
50
|
+
placeholder: "Filter jobs...",
|
|
51
|
+
summary: `${o.length} jobs`
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
/* @__PURE__ */ a("div", { className: "ss-dbg-job-stats-area", children: [
|
|
55
|
+
/* @__PURE__ */ e(M, { stats: T, classPrefix: "ss-dbg" }),
|
|
56
|
+
/* @__PURE__ */ e("div", { className: "ss-dbg-log-filters", children: D.map((t) => /* @__PURE__ */ e(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
type: "button",
|
|
60
|
+
className: `ss-dbg-job-filter ${c === t ? "ss-dbg-active" : ""}`,
|
|
61
|
+
onClick: () => x(t),
|
|
62
|
+
children: t
|
|
63
|
+
},
|
|
64
|
+
t
|
|
65
|
+
)) })
|
|
66
|
+
] }),
|
|
67
|
+
o.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No jobs found" }) : /* @__PURE__ */ a("table", { ref: w, className: "ss-dbg-table", children: [
|
|
68
|
+
/* @__PURE__ */ a("colgroup", { children: [
|
|
69
|
+
/* @__PURE__ */ e("col", { style: { width: "50px" } }),
|
|
70
|
+
/* @__PURE__ */ e("col", { style: { width: "15%" } }),
|
|
71
|
+
/* @__PURE__ */ e("col", { style: { width: "80px" } }),
|
|
72
|
+
/* @__PURE__ */ e("col", {}),
|
|
73
|
+
/* @__PURE__ */ e("col", { style: { width: "50px" } }),
|
|
74
|
+
/* @__PURE__ */ e("col", { style: { width: "80px" } }),
|
|
75
|
+
/* @__PURE__ */ e("col", { style: { width: "80px" } }),
|
|
76
|
+
/* @__PURE__ */ e("col", { style: { width: "60px" } })
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ a("tr", { children: [
|
|
79
|
+
/* @__PURE__ */ e("th", { children: "ID" }),
|
|
80
|
+
/* @__PURE__ */ e("th", { children: "Name" }),
|
|
81
|
+
/* @__PURE__ */ e("th", { children: "Status" }),
|
|
82
|
+
/* @__PURE__ */ e("th", { children: "Payload" }),
|
|
83
|
+
/* @__PURE__ */ e("th", { children: "Tries" }),
|
|
84
|
+
/* @__PURE__ */ e("th", { children: "Duration" }),
|
|
85
|
+
/* @__PURE__ */ e("th", { children: "Time" }),
|
|
86
|
+
/* @__PURE__ */ e("th", {})
|
|
87
|
+
] }) }),
|
|
88
|
+
/* @__PURE__ */ e("tbody", { children: o.map((t) => {
|
|
89
|
+
const s = t;
|
|
90
|
+
return /* @__PURE__ */ a("tr", { children: [
|
|
91
|
+
/* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", children: t.id }),
|
|
92
|
+
/* @__PURE__ */ e("td", { className: "ss-dbg-c-sql", title: t.name, children: t.name }),
|
|
93
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `ss-dbg-badge ${F(t.status)}`, children: t.status }) }),
|
|
94
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
95
|
+
O,
|
|
96
|
+
{
|
|
97
|
+
data: t.payload || t.data,
|
|
98
|
+
maxPreviewLength: 60,
|
|
99
|
+
classPrefix: "ss-dbg"
|
|
100
|
+
}
|
|
101
|
+
) }),
|
|
102
|
+
/* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", style: { textAlign: "center" }, children: t.attempts || s.attemptsMade || 0 }),
|
|
103
|
+
/* @__PURE__ */ e("td", { className: "ss-dbg-duration", children: t.duration !== null ? L(t.duration) : "-" }),
|
|
104
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
105
|
+
P,
|
|
106
|
+
{
|
|
107
|
+
ts: R(s),
|
|
108
|
+
className: "ss-dbg-event-time"
|
|
109
|
+
}
|
|
110
|
+
) }),
|
|
111
|
+
/* @__PURE__ */ e("td", { children: t.status === "failed" && /* @__PURE__ */ e(
|
|
112
|
+
"button",
|
|
113
|
+
{
|
|
114
|
+
type: "button",
|
|
115
|
+
className: "ss-dbg-retry-btn",
|
|
116
|
+
onClick: () => S(t.id),
|
|
117
|
+
disabled: b === t.id,
|
|
118
|
+
children: b === t.id ? "..." : "Retry"
|
|
119
|
+
}
|
|
120
|
+
) })
|
|
121
|
+
] }, t.id);
|
|
122
|
+
}) })
|
|
123
|
+
] })
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
X as JobsTab,
|
|
128
|
+
X as default
|
|
129
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { T as v } from "./TimeAgoCell-o3KigGfM.js";
|
|
4
|
+
import { resolveLogLevel as u, resolveLogMessage as f, resolveLogTimestamp as h, resolveLogRequestId as L, getStructuredData as x, getLogLevelCssClass as N } from "adonisjs-server-stats/core";
|
|
5
|
+
import { J as y } from "./index-DwDK-4oX.js";
|
|
6
|
+
function $({ log: o, index: c, expanded: l, onToggleExpand: m, onReqIdClick: e }) {
|
|
7
|
+
const n = u(o), d = f(o), p = h(o), a = L(o), t = x(o);
|
|
8
|
+
return /* @__PURE__ */ i(g.Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ i(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: `ss-log-entry${t ? " ss-log-entry-expandable" : ""}`,
|
|
13
|
+
onClick: () => t && m(c),
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ s("span", { className: `ss-log-level ${N(n, "ss-log-level")}`, children: n.toUpperCase() }),
|
|
16
|
+
/* @__PURE__ */ s(v, { ts: p, className: "ss-log-time" }),
|
|
17
|
+
a ? /* @__PURE__ */ s(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
className: "ss-log-reqid",
|
|
21
|
+
title: a,
|
|
22
|
+
onClick: e ? (r) => {
|
|
23
|
+
r.stopPropagation(), e(a);
|
|
24
|
+
} : void 0,
|
|
25
|
+
role: e ? "button" : void 0,
|
|
26
|
+
tabIndex: e ? 0 : void 0,
|
|
27
|
+
onKeyDown: e ? (r) => {
|
|
28
|
+
r.key === "Enter" && (r.stopPropagation(), e(a));
|
|
29
|
+
} : void 0,
|
|
30
|
+
children: a.slice(0, 8)
|
|
31
|
+
}
|
|
32
|
+
) : /* @__PURE__ */ s("span", { className: "ss-log-reqid-empty", children: "--" }),
|
|
33
|
+
t ? /* @__PURE__ */ s("span", { className: `ss-log-expand-icon${l ? " ss-log-expand-icon-open" : ""}`, children: "▶" }) : /* @__PURE__ */ s("span", { style: { width: 14 } }),
|
|
34
|
+
/* @__PURE__ */ s("span", { className: "ss-log-msg", children: d })
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
l && t && /* @__PURE__ */ s("div", { className: "ss-log-detail", children: /* @__PURE__ */ s(y, { data: t, classPrefix: "ss-dbg", defaultExpanded: !0 }) })
|
|
39
|
+
] });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
$ as L
|
|
43
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as a, useCallback as c } from "react";
|
|
3
|
+
import { LOG_LEVELS as B } from "adonisjs-server-stats/core";
|
|
4
|
+
import { a as G } from "./index-DwDK-4oX.js";
|
|
5
|
+
import { F as T } from "./FilterBar-CQ7bD669.js";
|
|
6
|
+
import { L as z } from "./LogEntryRow-CMMkqA9M.js";
|
|
7
|
+
import { P as H } from "./Pagination-BkmzUDY8.js";
|
|
8
|
+
function Z({ options: L = {} }) {
|
|
9
|
+
const [E, i] = a(1), [b, x] = a(""), [r, q] = a("all"), [n, h] = a(""), [u, p] = a(""), [m, y] = a([]), [v, R] = a("level"), [g, $] = a("equals"), [f, C] = a(""), [F, P] = a(null), o = {};
|
|
10
|
+
r !== "all" && (o.level = r), n && (o.request_id = n), m.forEach((e, s) => {
|
|
11
|
+
o[`filter_field_${s}`] = e.field, o[`filter_op_${s}`] = e.operator, o[`filter_value_${s}`] = e.value;
|
|
12
|
+
});
|
|
13
|
+
const { data: I, meta: d, isLoading: w } = G("logs", {
|
|
14
|
+
...L,
|
|
15
|
+
page: E,
|
|
16
|
+
search: b,
|
|
17
|
+
filters: o
|
|
18
|
+
}), S = I || [], D = c((e) => {
|
|
19
|
+
h(e), p(e), i(1);
|
|
20
|
+
}, []), V = c(() => {
|
|
21
|
+
const e = u.trim();
|
|
22
|
+
h(e), i(1);
|
|
23
|
+
}, [u]), _ = c(() => {
|
|
24
|
+
h(""), p(""), i(1);
|
|
25
|
+
}, []), O = c(() => {
|
|
26
|
+
q("all"), i(1);
|
|
27
|
+
}, []), k = c(() => {
|
|
28
|
+
const e = f.trim();
|
|
29
|
+
e && (y((s) => [
|
|
30
|
+
...s,
|
|
31
|
+
{ field: v, operator: g, value: e }
|
|
32
|
+
]), C(""));
|
|
33
|
+
}, [v, g, f]), j = c((e) => {
|
|
34
|
+
y((s) => s.filter((N, K) => K !== e));
|
|
35
|
+
}, []), A = r !== "all" || n !== "" || m.length > 0;
|
|
36
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
37
|
+
/* @__PURE__ */ t(
|
|
38
|
+
T,
|
|
39
|
+
{
|
|
40
|
+
search: b,
|
|
41
|
+
onSearchChange: x,
|
|
42
|
+
placeholder: "Search logs...",
|
|
43
|
+
summary: `${d?.total ?? 0} logs`,
|
|
44
|
+
children: /* @__PURE__ */ l("div", { className: "ss-dash-log-filters", children: [
|
|
45
|
+
B.map((e) => /* @__PURE__ */ t(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
type: "button",
|
|
49
|
+
className: `ss-dash-log-filter ${r === e ? "ss-dash-active" : ""}`,
|
|
50
|
+
onClick: () => {
|
|
51
|
+
q(e), i(1);
|
|
52
|
+
},
|
|
53
|
+
children: e
|
|
54
|
+
},
|
|
55
|
+
e
|
|
56
|
+
)),
|
|
57
|
+
/* @__PURE__ */ t(
|
|
58
|
+
"input",
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
className: "ss-dash-filter-input ss-dash-reqid-input",
|
|
62
|
+
placeholder: "Filter by request ID...",
|
|
63
|
+
value: u,
|
|
64
|
+
onChange: (e) => p(e.target.value),
|
|
65
|
+
onKeyDown: (e) => e.key === "Enter" && V()
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
(u || n) && /* @__PURE__ */ t(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
type: "button",
|
|
72
|
+
className: "ss-dash-btn ss-dash-reqid-clear",
|
|
73
|
+
onClick: () => {
|
|
74
|
+
_();
|
|
75
|
+
},
|
|
76
|
+
children: "Clear"
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] })
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ l("div", { className: "ss-dash-structured-search", children: [
|
|
83
|
+
/* @__PURE__ */ l(
|
|
84
|
+
"select",
|
|
85
|
+
{
|
|
86
|
+
className: "ss-dash-filter-select",
|
|
87
|
+
value: v,
|
|
88
|
+
onChange: (e) => R(e.target.value),
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ t("option", { value: "level", children: "level" }),
|
|
91
|
+
/* @__PURE__ */ t("option", { value: "message", children: "message" }),
|
|
92
|
+
/* @__PURE__ */ t("option", { value: "request_id", children: "request_id" }),
|
|
93
|
+
/* @__PURE__ */ t("option", { value: "userId", children: "userId" }),
|
|
94
|
+
/* @__PURE__ */ t("option", { value: "email", children: "email" }),
|
|
95
|
+
/* @__PURE__ */ t("option", { value: "path", children: "path" })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ l(
|
|
100
|
+
"select",
|
|
101
|
+
{
|
|
102
|
+
className: "ss-dash-filter-select",
|
|
103
|
+
value: g,
|
|
104
|
+
onChange: (e) => $(e.target.value),
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ t("option", { value: "equals", children: "equals" }),
|
|
107
|
+
/* @__PURE__ */ t("option", { value: "contains", children: "contains" }),
|
|
108
|
+
/* @__PURE__ */ t("option", { value: "starts_with", children: "starts with" })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ t(
|
|
113
|
+
"input",
|
|
114
|
+
{
|
|
115
|
+
className: "ss-dash-filter-input",
|
|
116
|
+
placeholder: "Value...",
|
|
117
|
+
value: f,
|
|
118
|
+
onChange: (e) => C(e.target.value),
|
|
119
|
+
onKeyDown: (e) => e.key === "Enter" && k()
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
/* @__PURE__ */ t("button", { type: "button", className: "ss-dash-btn", onClick: k, children: "Add" })
|
|
123
|
+
] }),
|
|
124
|
+
A && /* @__PURE__ */ l("div", { className: "ss-dash-filter-chips", children: [
|
|
125
|
+
r !== "all" && /* @__PURE__ */ l("span", { className: "ss-dash-filter-chip", children: [
|
|
126
|
+
"level: ",
|
|
127
|
+
r,
|
|
128
|
+
/* @__PURE__ */ t(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
className: "ss-dash-filter-chip-remove",
|
|
133
|
+
onClick: O,
|
|
134
|
+
children: "×"
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
] }),
|
|
138
|
+
n && /* @__PURE__ */ l("span", { className: "ss-dash-filter-chip", children: [
|
|
139
|
+
"requestId: ",
|
|
140
|
+
n.slice(0, 8),
|
|
141
|
+
"...",
|
|
142
|
+
/* @__PURE__ */ t(
|
|
143
|
+
"button",
|
|
144
|
+
{
|
|
145
|
+
type: "button",
|
|
146
|
+
className: "ss-dash-filter-chip-remove",
|
|
147
|
+
onClick: _,
|
|
148
|
+
children: "×"
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] }),
|
|
152
|
+
m.map((e, s) => /* @__PURE__ */ l("span", { className: "ss-dash-filter-chip", children: [
|
|
153
|
+
e.field,
|
|
154
|
+
" ",
|
|
155
|
+
e.operator,
|
|
156
|
+
' "',
|
|
157
|
+
e.value,
|
|
158
|
+
'"',
|
|
159
|
+
/* @__PURE__ */ t(
|
|
160
|
+
"button",
|
|
161
|
+
{
|
|
162
|
+
type: "button",
|
|
163
|
+
className: "ss-dash-filter-chip-remove",
|
|
164
|
+
onClick: () => j(s),
|
|
165
|
+
children: "×"
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
] }, s))
|
|
169
|
+
] }),
|
|
170
|
+
w && !I ? /* @__PURE__ */ t("div", { className: "ss-dash-empty", children: "Loading logs..." }) : S.length === 0 ? /* @__PURE__ */ l("div", { className: "ss-dash-empty", children: [
|
|
171
|
+
"No log entries",
|
|
172
|
+
n ? ` matching request ${n}` : r !== "all" ? ` for ${r}` : ""
|
|
173
|
+
] }) : /* @__PURE__ */ t("div", { className: "ss-dash-log-entries", children: S.map((e, s) => /* @__PURE__ */ t(
|
|
174
|
+
z,
|
|
175
|
+
{
|
|
176
|
+
log: e,
|
|
177
|
+
index: s,
|
|
178
|
+
expanded: F === s,
|
|
179
|
+
onToggleExpand: (N) => P(F === N ? null : N),
|
|
180
|
+
onReqIdClick: D
|
|
181
|
+
},
|
|
182
|
+
e.id || s
|
|
183
|
+
)) }),
|
|
184
|
+
d && /* @__PURE__ */ t(
|
|
185
|
+
H,
|
|
186
|
+
{
|
|
187
|
+
page: d.page,
|
|
188
|
+
lastPage: d.lastPage,
|
|
189
|
+
total: d.total,
|
|
190
|
+
onPageChange: i
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
Z as LogsSection,
|
|
197
|
+
Z as default
|
|
198
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useMemo as v, useCallback as x } from "react";
|
|
3
|
+
import { filterLogsByLevel as C, resolveLogRequestId as N, resolveLogMessage as F, LOG_LEVELS as w } from "adonisjs-server-stats/core";
|
|
4
|
+
import { u as E } from "./index-DwDK-4oX.js";
|
|
5
|
+
import { F as I } from "./FilterBar-CQ7bD669.js";
|
|
6
|
+
import { L as k } from "./LogEntryRow-CMMkqA9M.js";
|
|
7
|
+
function M({ options: f }) {
|
|
8
|
+
const { data: t, isLoading: p, error: g } = E("logs", f), [d, L] = i("all"), [n, h] = i(""), [l, m] = i(""), [u, b] = i(null), c = v(() => {
|
|
9
|
+
let e = Array.isArray(t) ? t : t?.logs || t?.entries || [];
|
|
10
|
+
if (e = C(e, d), l) {
|
|
11
|
+
const s = l.toLowerCase();
|
|
12
|
+
e = e.filter((r) => N(r).toLowerCase().includes(s));
|
|
13
|
+
}
|
|
14
|
+
if (n) {
|
|
15
|
+
const s = n.toLowerCase();
|
|
16
|
+
e = e.filter((r) => F(r).toLowerCase().includes(s));
|
|
17
|
+
}
|
|
18
|
+
return e;
|
|
19
|
+
}, [t, d, n, l]), y = x((e) => {
|
|
20
|
+
m((s) => s === e ? "" : e);
|
|
21
|
+
}, []);
|
|
22
|
+
return p && !t ? /* @__PURE__ */ o("div", { className: "ss-dbg-empty", children: "Loading logs..." }) : g ? /* @__PURE__ */ a("div", { className: "ss-dbg-empty", children: [
|
|
23
|
+
"Error: ",
|
|
24
|
+
g.message
|
|
25
|
+
] }) : /* @__PURE__ */ a("div", { children: [
|
|
26
|
+
/* @__PURE__ */ a("div", { className: "ss-dbg-log-filters", children: [
|
|
27
|
+
w.map((e) => /* @__PURE__ */ o(
|
|
28
|
+
"button",
|
|
29
|
+
{
|
|
30
|
+
type: "button",
|
|
31
|
+
className: `ss-dbg-log-filter ${d === e ? "ss-dbg-active" : ""}`,
|
|
32
|
+
onClick: () => L(e),
|
|
33
|
+
children: e
|
|
34
|
+
},
|
|
35
|
+
e
|
|
36
|
+
)),
|
|
37
|
+
l && /* @__PURE__ */ a(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
className: "ss-dbg-log-filter ss-dbg-active",
|
|
42
|
+
onClick: () => m(""),
|
|
43
|
+
children: [
|
|
44
|
+
"req: ",
|
|
45
|
+
l.slice(0, 8),
|
|
46
|
+
" x"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ a("span", { className: "ss-dbg-summary", style: { marginLeft: "auto" }, children: [
|
|
51
|
+
c.length,
|
|
52
|
+
" entries"
|
|
53
|
+
] })
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
|
+
I,
|
|
57
|
+
{
|
|
58
|
+
search: n,
|
|
59
|
+
onSearchChange: h,
|
|
60
|
+
placeholder: "Filter log messages..."
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ o("div", { style: { overflow: "auto", flex: 1 }, children: c.length === 0 ? /* @__PURE__ */ o("div", { className: "ss-dbg-empty", children: "No log entries" }) : c.slice(0, 200).map((e, s) => /* @__PURE__ */ o(
|
|
64
|
+
k,
|
|
65
|
+
{
|
|
66
|
+
log: e,
|
|
67
|
+
index: s,
|
|
68
|
+
expanded: u === s,
|
|
69
|
+
onToggleExpand: (r) => b(u === r ? null : r),
|
|
70
|
+
onReqIdClick: y
|
|
71
|
+
},
|
|
72
|
+
s
|
|
73
|
+
)) })
|
|
74
|
+
] });
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
M as LogsTab,
|
|
78
|
+
M as default
|
|
79
|
+
};
|